Skip to content

Releases: robolectric/robolectric

Robolectric 4.5

22 Jan 17:57
Compare
Choose a tag to compare

Robolectric 4.5 adds support for Android API 30 (R final) and contains many bug fixes and other enhancements.

More detailed release notes are forthcoming.

For all changes view the comparison to 4.4.

Use Robolectric:

testCompile "org.robolectric:robolectric:4.5"

Robolectric 4.5 Beta 1

17 Jan 16:26
Compare
Choose a tag to compare
Pre-release

NOTE: Robolectric 4.5-beta-1 is a outdated preview release; please use 4.5 or later instead.

Robolectric 4.5 Alpha 3

16 Nov 00:09
Compare
Choose a tag to compare
Pre-release

NOTE: Robolectric 4.5-alpha-3 is a outdated preview release; please use 4.5 or later instead.

Robolectric 4.5 Alpha 2

01 Nov 23:21
Compare
Choose a tag to compare
Pre-release

NOTE: Robolectric 4.5-alpha-2 is a outdated preview release; please use 4.5 or later instead.

Robolectric 4.5 Alpha 1

30 Sep 05:15
Compare
Choose a tag to compare
Pre-release

NOTE: Robolectric 4.5-alpha-1 is a outdated preview release; please use 4.5 or later instead.

Robolectric 4.4

24 Aug 01:29
Compare
Choose a tag to compare

Robolectric 4.4 is a massive release in terms of improvements to Android compatibility. The most noticeable item in the release is that the new PAUSED looper mode is now the default. You can read about the PAUSED looper in more detail here: http://robolectric.org/blog/2019/06/04/paused-looper/.

Note:

  1. Not all changes are listed in the release notes. There were many other minor changes (such as dependency version bumps) that weren't included in this list for brevity. For all changes view the comparison to 4.3.1.
  2. Some of the pull requests in this release may contain duplicate changes from other pull requests in this release. We apologize for this messy history, it was the result of some misconfigured code sync tool. We’ve taken measures to ensure it doesn’t happen any more.

Use Robolectric:

testCompile "org.robolectric:robolectric:4.4"

SDK/JVM support

Deprecations

  • Deprecate LooperMode LEGACY in favor of PAUSED (#5490), and default to PAUSED looper mode (#5491)
  • Accessibility checking is now deprecated and has been moved into a separate maven artifact org.robolectric:plugin-accessibility-deprecated. Accessibility checking will be removed entirely from Robolectric 4.5. Please switch to Espresso for accessibility checking. (#5547)
  • Deprecate ShadowContentResolver shadow API because they do not work with ContentProviderClient (#5376)
  • Deprecate ShadowLocationManager.getLocationUpdateListeners and ShadowLocationManager.getLocationUpdateListeners (#5150)
  • Make it an error to run on Q with an unsupported java version
    instead of just silently skipping tests (#5290)
  • Deprecate Robolectric's custom cursor implementation (#5613)
  • The BouncyCastle security provider is now considered deprecated due to the incompatibility with Java 9+ (#5849, #5850). This was preventing Robolectric tests (and Robolectric itself) from making HTTPS network requests on Java 9+. Long term the plan is to switch to Conscrypt.

Android support / Robolectric test API improvements

  • Fix bug in ShadowImageDecoder.decodeBitmap (#4966)
  • Use real setting for WIFI_SCAN_ALWAYS_AVAILABLE (#4968)
  • Add a shadow for Font.Builder (#4993)
  • Add killProcess implementation to ShadowProcess (#4985)
  • Add a shadow for CallLog.Calls (#4996)
  • Add a shadow for CallScreeningService (#4997)
  • Add several shadows for camera2 classes (#4874)
  • Add option to avoid calling ShadowApplication.onServiceDisconnected in ShadowApplication.unbindService (#4979)
  • Add ability to simulate Bluetooth unavailable in ShadowBluetoothAdapter (#5002)
  • Implement ShadowApplicationPackageManager.getApplicationIcon(ApplicationInfo) (#5005)
  • Add ability to simulate SecurityExceptions in bindService (#4980)
  • Add ability to simulate enabled/disabled networks in ShadowWifiManager (#4974)
  • Add ability to simulate wifi usability system APIs in ShadowWifiManager (#5168)
  • Add null check in ShadowWifiManager.addNetwork (#5014)
  • Add shadow implementation of ShadowTelephonyManager#getDataState (#5003)
  • Fall back to Android's implementation of getResourcesForApplication (#4969)
  • Implement ShadowTypeface.equals and ShadowTypeface.hashCode (#4992)
  • Add ability to make ShadowContentResolver.registerContentObserver throw an exception (#4988)
  • Implement ShadowSubscriptionManager.getActiveSubscriptionInfoCountMax (#5010)
  • Add ability to set system dialer package in ShadowTelecomManager (#4986)
  • Implement ShadowSensorManager.registerListener 5-arg overload (#5014)
  • Add ability to get last flags set in ShadowUIModeManager (#5027)
  • Add a shadow for BluetoothA2dp (#5034)
  • Add shadow implementation for BluetoothDevice.createRfcommSocketToServiceRecord (#5034)
  • Add shadow implementations for BluetoothDevice.setPin and BluetoothDevice.setPairingConfirmation (and ability to get the values set) (#5116)
  • Adding shadow implementations of BluetoothDevice.getAlias and BlueToothDevice.getAliasName and related test APIs (#5222)
  • Adds the ability to get broadcast intents sent to a specific user (#5045)
  • Validate intents passed to start/stop/bindService (#5053)
  • Complete rewrite of ShadowLocationManager to improve fidelity (#5035, #5062, #5152, #5587, #5666)
  • Add ability to clear broadcast intents in ShadowContextWrapper (#5066)
  • Fix package name ShadowApplicationPackageManager's Activity Chooser (#5068)
  • Add shadow implementation for MediaPlayer#setDataSource(Context, Uri) (#5064)
  • Add shadow implementation for UserManager.getUserHandle(int) (#5065)
  • Add shadow implementations for DevicePolicyManager.setSystemUpdatePolicy and DevicePolicyManager.getSystemUpdatePolicy (#5069)
  • Remove ShadowOverscroller (#5081)
  • Add ability to simulate return value of AccessibilityService.getWindows list in ShadowAccessibilityService (#5083)
  • Fix bug in ShadowParcel.writeByteArray (#5089)
  • Add shadow implementation for UserManager.getUserName (#5099)
  • Improve fidelity of ShadowTime#parse3339 (#5101)
  • Add shadow for BiometricManager (#5072)
  • Propagate RemoteException from Binder#onTransact method (#4984)
  • Add shadow for android.service.notification.NotificationListenerService.Ranking (#5113)
  • Add support for VibrationEffect.Prebaked in ShadowSystemVibrator (#5119
  • Add the ability to set Tx and Rx packets/bytes for ShadowTrafficStats (#5121)
  • Add shadow implementation for Activity.getCallingPackage (and the ability to set it) (#5126)
  • Add shadows for several telephony classes (android.telecom.Call, android.telecom.InCallAdapter, android.telecom.InCallService, android.telecom.Phone) (#5107)
  • Improve fidelity of ShadowCookieManager.removeSessionCookies (#5130)
  • Improve fidelity of OpEntry.getTime() and OpEntry.getDuration() in Q (#5133)
  • Set default NetworkCapabilities for the two Robolectric created Networks (#5129)
  • Set the mimetype in ShadowBitmapFactory.decodeStream() (#5128)
  • Add module support for ShadowPackageManager and ShadowApplicationPackageManager (#5136)
  • Add the ability to set the external storage directory in ShadowEnvironment (#5140)
  • Add support for the dataChanged API in ShadowBackupManager (#5137)
  • Add ShadowContentResolver.registerInputStreamSupplier (#5142)
  • Notify settings ContentResolver when settings change (#5138)
  • Include size and mtime members in Os.stat variants (#5148)
  • Implement ShadowInstrumentation.execStartActivity variant with UserHandle (#5096)
  • Add ability to add entries to ShadowDropBoxManager (#5160)
  • Fix ShadowSigningInfo parceling (#5163)
  • Add ability to set Build.VERSION.SECURITY_PATCH (#5173), Build.PRODUCT (#5304), Build.BRAND (#5566), and Build.HARDWARE (#5619)
  • Add support for DisplayManager BrightnessConfiguration APIs (#5170)
  • Add ability to simulate location power save modes in ShadowPowerManager (#5176)
  • Add shadow method and test API for PowerManager.isLightDeviceIdleMode (#5226)
  • Add support for Android Q usb port statuses in ShadowUsbManager (#5175)
  • Add ability to simulate sending and downloading multimedia messages in ShadowSmsManager (#5177)
  • Add ability to query the number of times a WebView was reloaded (#5182)
  • Add ability to simulate WebViewClient and WebViewClient callbacks on page loads (#5188, #5199)
  • Add shadow method for WebView.getTitle (#5200)
  • Add test APIs to check if WebViewDatabase.clearFormData was called (#5201)
  • Add ability to override autofill service component name to ShadowAutofillManager (#5181)
  • Add ability to construct AttestedKeyPair objects (#5183)
  • Add shadow method for CameraCaptureSessionImpl.capture (#5191)
  • Add shadow method and test APIs for MediaScannerConnection.scanFile (#5178)
  • Add synchronous support to ShadowMediaCodec and the ability to apply fake codecs (#5195)
  • Add shadow methods for CameraParameters metering and focus areas and test APIs (#5189)
  • Add shadow method for AudioManager.getActiveRecordingConfigurations and test APIs (#5198)
  • Add ShadowAudioRecord (#5202, #5789)
  • Add several shadow methods for SliceManager (#5227)
  • Add shadow methods for new Android Q variants of setPackagesSuspended (#5135)
  • Add shadow method and test APIs for AccessibilityManager.sendAccessibilityEvent (#5192)
  • Add ability to log time in ShadowLog (#5224)
  • Add shadow for SuspendDialogInfo system API (#5232)
  • Add shadow method for PackageManager.canonicalToCurrentPackageNames and the ShadowPackageManageraddCanonicalName test API (#5233)
  • Add better support for camera2 CaptureRequestBuilder (#5230)
  • Add shadow method for Os.sysconf and a shadow API to set sysconf values (#5247)
  • Add shadow method for PackageManager.setDistractingPackageRestrictions and shadow API to get the set value (#5248)
  • Add shadow method for Bitmap.extractAlpha(Paint, int[]) (#5240)
  • Add the ability to set the user id in ContextImpl (#5253)
  • Fix some bugs in ShadowStorageManager StorageVolume logic (#5251, #5250)
  • Add shadow method for Trace.isEnabled and shadow API to toggle the value (#5256)
  • Fix infinite loop when using CameraManager (#5269)
  • Add shadow class for MediaController (#5266, #5395)
  • Add shadow method for MediaMetadataRetriever.setDataSource and a shadow API to add bitmaps to a data source (#5279)
  • Add shadow method for MediaMetadataRetriever.getScaledFrameAtTime and the ability to set scaled frames (#5279)
  • Add shadow method for BluetoothDevice.getBluetoothClass and the ability to set the bluetooth class (#5277)
  • Add shadow methods for PendingIntent.readPendingIntentOrNullFromParcel and PendingIntent.writePendingIntentOrNullToParcel (#5283)
  • Improve fidelity of AccessibilityWindowInfo.equals (#5278)
  • Add shadow methods for DevicePolicyManager.bindDeviceAdminSer...
Read more

Robolectric 4.4 Beta 1

17 Aug 07:09
Compare
Choose a tag to compare
Pre-release

NOTE: Robolectric 4.4-beta-1 is a outdated preview release; please use 4.4 or later instead.

Robolectric 4.4 Alpha 5

13 Aug 17:45
Compare
Choose a tag to compare
Pre-release

NOTE: Robolectric 4.4-alpha-5 is a outdated preview release; please use 4.4 or later instead.

Robolectric 4.4 Alpha 4

13 Aug 17:46
Compare
Choose a tag to compare
Pre-release

NOTE: Robolectric 4.4-alpha-5 is a outdated preview release; please use 4.4-beta or later instead.

Robolectric 4.4 Alpha 3

13 Aug 17:48
Compare
Choose a tag to compare
Pre-release

NOTE: Robolectric 4.4-alpha-3 is a outdated preview release; please use 4.4 or later instead.