What’s New

Robolectric

Developer Tools

Runs Android unit tests on the JVM, without an emulator or a device.

Latest robolectric-4.16.1 · by RobolectricWebsiterobolectric/robolectric

Changelog

robolectric-4.17-beta-2Pre-release

Robolectric 4.17 Beta 2

Changed 1
  • Enable CONSCRYPT mode for Mac arm64, making CONSCRYPT mode available on all supported platforms
Fixed 1
  • Fix issue #11345

Robolectric 4.17 Beta 2 is a minor release that fixes https://github.com/robolectric/robolectric/issues/11345. It also enables CONSCRYPT mode for Mac arm64, meaning that CONSCRYPT mode is now enabled for all platforms supported by Robolectric.

Full Changelog: https://github.com/robolectric/robolectric/compare/robolectric-4.17-beta-1...robolectric-4.17-beta-2

robolectric-4.17-beta-1Pre-release

Robolectric 4.17-beta-1

Added 8
  • Support for SDK 37
  • Shadow for getDeviceOwnerComponentOnAnyUser
  • ShadowTelMan implementation of get/setPreferredOpportunisticDataSubscription
  • Robolectric support for AccessibilityWindowInfo.get/setRegionInScreen()
  • Support for mouse wheel scroll events to the simulator
  • SurroundingTextCallback to ShadowAccessibilityInputConnection
  • setInformationElements() to WifiScanResultBuilder
  • isWallpaperBackupEligible and getWallpaperFile with cropping
Changed 4
  • ShadowCameraCharacteristics.set(Key<T>, Object) has been changed to set(Key<T>, T) to correctly reflect type enforcement in the framework
  • Make all static fields emitted by Reflector volatile
  • Update listener logic of getProfileProxy to match actual behavior
  • Update ShadowTelephonyManager to support updateAvailalbeNetworks
Fixed 3
  • UiModeManager contrast handling in in-development SDK
  • ShadowPausedLooper#poll when sync barrier is blocking the queue
  • UserManager.isMainUser on in-development SDK
Removed 1
  • AndroidVersions has been removed in favor of using android.os.Build constants
Deprecated 1
  • Scheduler#size is unsupported on SDKs greater than Baklava

Robolectric 4.17-beta-1 supports SDK 37 and contains many other features and enhancements.

Please note you may need to add jvmFlags configuration when using JDKs >= 17 at https://robolectric.org/getting-started/

If you have any issues, please file them here.

Breaking Changes
  • AndroidVersions has been removed in favor of using android.os.Build constants
  • ShadowCameraCharacteristics.set(Key, Object) has been changed to set(Key, T), in order to correctly reflect type enforcement in the framework
What's Changed
New Contributors

Full Changelog: https://github.com/robolectric/robolectric/compare/robolectric-4.16.1...robolectric-4.17-beta-1

robolectric-4.16

Robolectric 4.16

Robolectric 4.16 supports Android Baklava (SDK 36), and you need to use JDK 21 if running tests with SDK 36 target. It also removes support for Android L (SDK 21 and 22).

One exciting new feature is native resources (ResourcesMode.NATIVE). Note this is currently only available in SDK 36.

If you have any issues, please file them here.

What's Changed
New Contributors

Full Changelog: https://github.com/robolectric/robolectric/compare/robolectric-4.15.1...robolectric-4.16

robolectric-4.15.1

Robolectric 4.15.1

Robolectric 4.15.1 is a minor release that fixes https://github.com/robolectric/robolectric/issues/9595, where the onClick handler now being invoked in Compose on certain API levels. Thanks to @GisoBartels for the fix.

It also fixes https://github.com/robolectric/robolectric/issues/10419, where a Java 16 dependency was added to Robolectric, even though many API levels should support Java 11. Thanks to @yschimke for the report and @utzcoz for the fix.

Full Changelog: https://github.com/robolectric/robolectric/compare/robolectric-4.15...robolectric-4.15.1

robolectric-4.15

Robolectric 4.15

Robolectric 4.15 contains a lot of minor improvements, fidelity improvements, bug fixes, and shadow API enhancements. It also introduces the Robolectric Simulator, which makes it possible to launch an interactive preview of Android UI in a Robolectric environment.

NOTE Robolectric 4.15 does NOT support Android Baklava (SDK 36). Baklava will be supported in Robolectric 4.16.

If you encounter any issues, please file them on the GitHub issues page.

A huge thanks to @MGaetan89 and @utzcoz for all of their hard work that went into this release.

What's Changed

The following symbols have been removed in Robolectric 4.15.

Removed symbolReplacement
AndroidManifest#supportsLegacyResourcesMode()N/A
AndroidManifest#supportsBinaryResourcesMode()N/A
ConfigMergerProvider<Config>
DependencyResolver#getLocalArtifactUrls(DependencyJar)DependencyResolver#getLocalArtifactUrl(DependencyJar)
Fs#fileFromPath(String path)Fs#fromUrl(path)
Fs#newFile(File file)file.toPath() 
FsFile#getPath()Fs#externalize(this)
FsFile#join(String name)this.resolve(name)
InvokeDynamicClassInstrumentorClassInstrumentor
ManifestIdentifier(Path, Path, Path, String, List<Path>)ManifestIdentifier(String, Path, Path, Path, List<ManifestIdentifier>)
MavenManifestFactoryN/A
PackageItemData#getClassName()PackageItemData#getName()
Provider<T>javax.inject.Provider<T>
Qualifiers#addScreenWidth(String, int)Configuration#screenWidthDp
Qualifiers#addSmallestScreenWidth(String, int)Configuration#smallestScreenWidthDp
Qualifiers#getOrientation(String)Configuration#orientation
Qualifiers#getPlatformVersion(String)Build.VERSION#SDK_INT
Qualifiers#getScreenWidth(String)Configuration#screenWidthDp
Qualifiers#getSmallestScreenWidth(String)Configuration#smallestScreenWidthDp
RoboSettingsSet the specific system property directly
Scheduler#idleConstantly(boolean)Scheduler#setIdleState(IdleState)
SdkPickerDefaultSdkPicker
ShadowApplication#addWakeLock(PowerManager.WakeLock wl)ShadowPowerManager.addWakeLock(wl)
ShadowApplication#clearWakeLocks()ShadowPowerManager.clearWakeLocks()
ShadowApplication#getAppWidgetManager()Context#getSystemService(Context.APPWIDGET_SERVICE)
ShadowApplication#getBluetoothAdapter()BluetoothManager#getAdapter()
ShadowApplication#getForegroundThreadScheduler()Robolectric.getForegroundThreadScheduler()
ShadowApplication#getInstance()shadowOf(RuntimeEnvironment.getApplication())
ShadowApplication#getLatestWakeLock()ShadowPowerManager.getLatestWakeLock()
ShadowMap#convertToShadowName(String)N/A
XmlResourceParserImpl(Document, String, String, String, ResourceTable)XmlResourceParserImpl(Document, Path, String, String, ResourceTable)
List of changes
New Contributors

Full Changelog: https://github.com/robolectric/robolectric/compare/robolectric-4.14.1...robolectric-4.15

robolectric-4.14

Robolectric 4.14

Robolectric 4.14 adds support for Android V (SDK 35)!

If you encounter any issues, please file them on the GitHub issues page.

Thanks to everyone who contributed to the release, especially our GSoC contributors @Mia0451 and @Devashishbasu!

What's Changed

Full Changelog: https://github.com/robolectric/robolectric/compare/robolectric-4.13...robolectric-4.14

Discussion