xian
released this
Assets
2
Robolectric 4.0 brings support for the Android P (SDK 28) release, new and improved support and testing APIs for dozens of Android classes, initial support for some androidx-test APIs, and a complete rewrite of the resource handling code making it behave much more like a real Android device. This is a beta release: public APIs should be fairly stable, but expect to find some bugs here and there.
With the major version number bump to 4.0, we're making changes to some public APIs, detailed below. We're working on a migration tool to help convert your existing tests to be compatible with Robolectric 4.0.
New since 4.0-alpha-3
- Support for binary resources mode in P.
- Added support for
androidx.test'sActivityScenarioAPI.
API Changes
- Most
@Implementationmethods in shadow classes are nowprotectedinstead ofpublic. Tests should always prefer to call SDK methods directly on Android classes rather than on their shadows [issue #4007]. RuntimeEnvironment.applicationhas been deprecated, useandroidx.test.core.app.ApplicationProvider.getApplicationContext()instead.AutoCloseableis now supported. In earlier versions of Robolectric, try-with-resources blocks would fail to callclose()on the resource.- Bumped Android P to build 4913185.
New and improved SDK support and testing APIs for numerous Android classes, including:
ActivityManager.getAppTasks()ApplicationPackageManagercontent providers,canRequestPackageInstalls()AppOpsManagerAsyncQueryHandlerAudioManager.getActivePlaybackConfiguration()BackupManagerBluetoothAdapterprofile connection state and bond stateBuild.getSerial()CameraManagerandCameraCharacteristicsCamera.Parameterspreview sizesCarrierConfigManager.getConfigForSubId()ConnectivityManagersupport forNetworkCapabilities,requestNetwork().ContentResolver.openOutputStream(), 'getSyncAdapterTypes()'Context.bindServiceAsUser()DevicePolicyManager.setUserProvisioningState()EuiccManagerFontFamily- Improvements to
AccessibilityNodeInfo NotificationManagersupport forAutomaticZenRulesPackageManager.checkPermission()checksPackageInfo.requestedPermissionsFlagsto determine if a permission is granted.Path,PathMeasure, andPathParserSensorManagerService.stopSelfResult()ShadowSensor.newInstance()SmsSubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex(),getActiveSubscriptionInfoCount()etc., 'getDefaultSubscriptionId()'SystemClock.elapsedRealtimeNanos()andcurrentNetworkTimeMillis()TelecomManager.silenceRinger()TelephonyManager.getSubscriberId(),getSimSerialNumber(), 'getVoiceNetworkType()'TextToSpeechTileandTileServiceminimal implementationTimeZoneFinderUsbManagerUserManagernow supports multiple users.UserStatsManagertest API:ShadowUserStatsManager.simulateTimeChange(); useEventBuildercan be used to return arbitrary eventsVMRuntime.is64Bit(),ShadowVMRuntime.setIs64Bit(),ShadowBuild.setSupported64BitAbis()WebStorageWebView.saveState()andrestoreState()WifiManager.connect(int, ActionListener)- Fixed a bug in
RoboCursor.getLong(). - Fixed a deadlock related to saving preferences.
- Improved support for Java 9.
- Fixes to
Looper.myLooper() - Support for color gamut and HDR in
@Config(qualifiers). - Added subscribe and search functionality to
ShadowMediaBrowserCompat. Also added easy ways to createMediaItems and get all createdMediaItems with their parent-child relationships [thanks Jehron Petty and Noah Luddy!].getRoot(),getItem(),subscribe(), andsearch()can only be called successfully afterShadowMediaBroswserCompat.connect()is called.- The default root id is
root_id. This is what will be returned bygetRoot()by default. The root id can be changed withsetRootId(). Note that if the root is created withcreateMediaItem(),setRootId()must also be called with the samemediaId. - There is no
getSessionToken()method inShadowMediaBrowserCompat. Follow issue #3962 for updates.
New since Robolectric 3.8
Features
- Support for the Android 28 API [Issue #3933]
- Add errorprone/auto-refactoring support [Issue #3944]
- Verify shadow
@Implementationmethods against SDKs [Issue #3952] - Support Espresso typeText [Issue #3919]
- Add SupportFragmentController#setupFragment() [Issue #3911]
- Shadow get/setNotificationPolicy on NotificationManager [Issue #3911]
- Adds a simple Shadow for JobService so classes that extend it can call jobFinished() without crashing. [Issue #3911]
- Add createSensorEvent and sendSensorEventToListeners to ShadowSensorManager [Issue #3911]
- Make the result of WifiScanner#startScan() configurable. [Issue #3911]
- Add functionality for setting the unbadged application icon in ShadowPackageManager [Issue #3919]
- Support OnAlarmListener call in ShadowAlarmManager [Issue #3919]
- Add ParameterizedRobolectricTestRunner#parameter annotation and remove dependency on XStream [Issue #3919]
- Support CookieManager.removeAllCookies. [Issue #3919]
- Add overloads to PendingIntent.send [Issue #3919]
- Support retrieving the last message sent via Messenger [Issue #3919]
- Add implementation for getAppStandbyBuckets and setAppStandbyBuckets to ShadowUsageStatsManager [Issue #3919]
- Adding error behavior to ShadowGeocoder. [Issue #3919]
- Add basic GLES20 support. [Issue #3924], [Issue #3944]
- Add support for new LocationManager API in Android P [Issue #3924]
- Add support to ShadowPowerManager to capture rebooting. [Issue #3924]
- Add support for Parcel.read/writeBlob [Issue #3924]
- Improve ShadowSoundPool adding the ability to query played sounds. [Issue #3944]
- Add method to override system properties [Issue #3944]
- Add BluetoothDevice#getUuids/setUuids [Issue #3944]
- Enhance support for BluetoothGatt [Issue #3944]
- Implement the newer AudioManager request and abandon audio focus api [Issue #3944]
- Add ShadowPackageManager#addSystemSharedLibraryName [Issue #3944]
- Add setMode and checkOpNotThrow (hidden) APIs to ShadowAppOpsManager [Issue #3944]
- Update ShadowDebug to allow for method tracing. [Issue #3944]
- Add setTimeZone method to ShadowAlarmManager [Issue #3944]
- Add ShadowVisualVoicemailSms [Issue #3944]
- Add scrollBy methods to ShadowView and ShadowScrollView [Issue #3944]
- Add ShadowEventLog and ShadowProcess.setUid() [Issue #3944]
- Add a Shadow class for MediaBrowserCompat. [Issue #3944]
- Support ConnectivityManager#reportNetworkConnectivity [Issue #3944]
- Add shadow for DropboxManager. [Issue #3944]
- Add support for DisplayManager#setDisplaySaturation [Issue #3952]
- Add scrollBy methods to ShadowView and ShadowScrollView [Issue #3952]
- Add shadow for UsageStatsManager.queryUsageStats() and a builder for UsageStats. [Issue #3952]
- Extend ShadowNfcAdapter to verify ndefPushMessage and emulate absence of NFC hardware [Issue #3952]
- Improve fidelity of WifiInfo by removing shadows in favor of using real Android code. [Issue #3911]
- Add a Shadow class for MediaControllerCompat. [Issue #3956]
- Add ShadowNotificationManager#setNotificationPolicyAccessGranted(float) [Issue #3956]
- Add support for isSystemUser to ShadowUserManager. [Issue #3956]
- Adding a basic Shadow for the CaptioningManager. [Issue #3956]
- Add layerType to ShadowView [Issue #3956]
Bug fixes
- Implement ShadowDevicePolicyManager#setPackagesSuspended correctly. [Issue #3911]
- Add a NoOp implementation of NfcAdapter#setOnNdefPushCompleteCallback. [Issue #3911]
- Fix string HTML attributes in binary resources. [Issue #3911]
- Avoid throwing in Bitmap#reconfigure for non-native backed Bitmaps. [Issue #3911]
- Overriding getActivityIntent in ActivityTestRule has no effect [Issue #3918]
- Improved handling of lockTaskMode that works now across activities and ActivityManager. [Issue #3924]
- Fix NPEs when calling Surface#release and getString [Issue #3924]
- Enhance TelephonyManager support [Issue #3944]
- Set DataSource in ShadowMediaPlayer.create() [Issue #3944]
- Fix signature of ShadowAccessibilityNodeInfo.setTraversalBefore()/After [Issue #3944]
- Added a few methods to the ShadowCamera to prevent an NPE in Camera.Parameters and execute callbacks passed to takePicture [Issue #3952]
- Improved package lost sequence number check [Issue #3956]
- Don't modify PendingIntent extras upon sending it [Issue #2503]
Deprecations
- Deprecate SupportFragmentTestUtil [Issue #3911]
Removals
- Remove ShadowApplication.getApplicationContext() in favor of RuntimeEnvironment#application [Issue #3911]
- Remove unused ShadowFrameLayout [Issue #3924]
- Remove @implementation methods from ShadowViewGroup that are not necessary as we can just call the real implementation instead. [Issue #3924]
- Delete shadows.MotionEventBuilder in favor of using androidx.test.core.view.MotionEventBuilder [Issue #3956]
Known Issues
Use Robolectric:
testCompile "org.robolectric:robolectric:4.0-beta-1"Find more details here. Report issues here. Enjoy!
brettchabot
released this
Assets
2
Robolectric 4.0 Alpha 3 brings support for Android 28 release, errorprone, shadow method validation and many other improvements. This is an alpha release, use with caution. APIs are likely to change before the final release of Robolectric 4.0.
Features
- Support for the Android 28 API [Issue #3933]
- Add errorprone/auto-refactoring support [Issue #3944]
- Verify shadow @implementation methods against SDKs [Issue #3952]
- Support Espresso typeText [Issue #3919]
- Add SupportFragmentController#setupFragment() [Issue #3911]
- Shadow get/setNotificationPolicy on NotificationManager [Issue #3911]
- Adds a simple Shadow for JobService so classes that extend it can call jobFinished() without crashing. [Issue #3911]
- Add createSensorEvent and sendSensorEventToListeners to ShadowSensorManager [Issue #3911]
- Make the result of WifiScanner#startScan() configurable. [Issue #3911]
- Add functionality for setting the unbadged application icon in ShadowPackageManager [Issue #3919]
- Support OnAlarmListener call in ShadowAlarmManager [Issue #3919]
- Add ParameterizedRobolectricTestRunner#parameter annotation and remove dependency on XStream [Issue #3919]
- Support CookieManager.removeAllCookies. [Issue #3919]
- Add overloads to PendingIntent.send [Issue #3919]
- Support retrieving the last message sent via Messenger [Issue #3919]
- Add implementation for getAppStandbyBuckets and setAppStandbyBuckets to ShadowUsageStatsManager [Issue #3919]
- Adding error behavior to ShadowGeocoder. [Issue #3919]
- Add basic GLES20 support. [Issue #3924], [Issue #3944]
- Add support for new LocationManager API in Android P [Issue #3924]
- Add support to ShadowPowerManager to capture rebooting. [Issue #3924]
- Add support for Parcel.read/writeBlob [Issue #3924]
- Improve ShadowSoundPool adding the ability to query played sounds. [Issue #3944]
- Add method to override system properties [Issue #3944]
- Add BluetoothDevice#getUuids/setUuids [Issue #3944]
- Enhance support for BluetoothGatt [Issue #3944]
- Implement the newer AudioManager request and abandon audio focus api [Issue #3944]
- Add ShadowPackageManager#addSystemSharedLibraryName [Issue #3944]
- Add setMode and checkOpNotThrow (hidden) APIs to ShadowAppOpsManager [Issue #3944]
- Update ShadowDebug to allow for method tracing. [Issue #3944]
- Add setTimeZone method to ShadowAlarmManager [Issue #3944]
- Add ShadowVisualVoicemailSms [Issue #3944]
- Add scrollBy methods to ShadowView and ShadowScrollView [Issue #3944]
- Add ShadowEventLog and ShadowProcess.setUid() [Issue #3944]
- Add a Shadow class for MediaBrowserCompat. [Issue #3944]
- Support ConnectivityManager#reportNetworkConnectivity [Issue #3944]
- Add shadow for DropboxManager. [Issue #3944]
- Add support for DisplayManager#setDisplaySaturation [Issue #3952]
- Add scrollBy methods to ShadowView and ShadowScrollView [Issue #3952]
- Add shadow for UsageStatsManager.queryUsageStats() and a builder for UsageStats. [Issue #3952]
- Extend ShadowNfcAdapter to verify ndefPushMessage and emulate absence of NFC hardware [Issue #3952]
- Improve fidelity of WifiInfo by removing shadows in favor of using real Android code. [Issue #3911]
- Add a Shadow class for MediaControllerCompat. [Issue #3956]
- Add ShadowNotificationManager#setNotificationPolicyAccessGranted(float) [Issue #3956]
- Add support for isSystemUser to ShadowUserManager. [Issue #3956]
- Adding a basic Shadow for the CaptioningManager. [Issue #3956]
- Add layerType to ShadowView [Issue #3956]
Bug fixes
- Implement ShadowDevicePolicyManager#setPackagesSuspended correctly. [Issue #3911]
- Add a NoOp implementation of NfcAdapter#setOnNdefPushCompleteCallback. [Issue #3911]
- Fix string HTML attributes in binary resources. [Issue #3911]
- Avoid throwing in Bitmap#reconfigure for non-native backed Bitmaps. [Issue #3911]
- Overriding getActivityIntent in ActivityTestRule has no effect [Issue #3918]
- Improved handling of lockTaskMode that works now across activities and ActivityManager. [Issue #3924]
- Fix NPEs when calling Surface#release and getString [Issue #3924]
- Enhance TelephonyManager support [Issue #3944]
- Set DataSource in ShadowMediaPlayer.create() [Issue #3944]
- Fix signature of ShadowAccessibilityNodeInfo.setTraversalBefore()/After [Issue #3944]
- Added a few methods to the ShadowCamera to prevent an NPE in Camera.Parameters and execute callbacks passed to takePicture [Issue #3952]
- Improved package lost sequence number check [Issue #3956]
- Don't modify PendingIntent extras upon sending it [Issue #2503]
Deprecations
- Deprecate SupportFragmentTestUtil [Issue #3911]
Removals
- Remove ShadowApplication.getApplicationContext() in favor of RuntimeEnvironment#application [Issue #3911]
- Remove unused ShadowFrameLayout [Issue #3924]
- Remove @implementation methods from ShadowViewGroup that are not necessary as we can just call the real implementation instead. [Issue #3924]
- Delete shadows.MotionEventBuilder in favor of using androidx.test.core.view.MotionEventBuilder [Issue #3956]
Known Issues
- Binary resources are not yet supported for Android P.
Use Robolectric:
testCompile "org.robolectric:robolectric:4.0-alpha-3"Find more details here. Report issues here. Enjoy!
brettchabot
released this
Assets
2
Robolectric 4.0 Alpha 2 brings support for androidx.test APIs and the Android P beta platform. This is an alpha release, use with caution. APIs are likely to change before the final release of Robolectric 4.0.
Features
- Support the androidx test 1.1.0-alpha2 APIs, including initial support for Espresso interactions (button clicks)
- Support for the Android P beta platform
Known Issues
- Binary resources are not yet supported for Android P.
Use Robolectric:
testCompile "org.robolectric:robolectric:4.0-alpha-2"Find more details here. Report issues here. Enjoy!
xian
released this
Assets
2
Robolectric 4.0 Alpha 1 brings support for Android Jetpack Test APIs, major performance and fidelity improvements, and numerous other fixes and improvements. This is an alpha release, use with caution. APIs are likely to change before the final release of Robolectric 4.0.
Features
- Support for
androidx.testAPIs for testing. - Support for loading resources processed using the Android build toolchain (
aapt) (requires Android Gradle Plugin 3.2, or Bazel'sandroid_local_test) [issue #3850].
Changes
- Remove deprecated
@Configpropertiesconstants,buildDir, andabiSplit[issues #3831 and #3859]. - Correct ShadowBitmap.createdFrom fields [issue #3841].
- Provide a way for excluding packages to acquire in the sandbox classloader [issue #3676—thanks @kageiit].
Known Issues
- Binary resources are not yet supported for Android P.
- The supported version of Android P is Developer Preview 2. To be updated shortly.
android.support.testis supported right now,androidx.testcoming shortly.
Use Robolectric:
testCompile "org.robolectric:robolectric:4.0-alpha-1"Find more details here. Report issues here. Enjoy!
brettchabot
released this
Assets
2
Robolectric 3.8 brings support for Android P, performance improvements, and numerous other fixes and improvements.
Features
- Add support for Android P Developer Preview rev 2 [issue #3821].
- Performance improvement: remove redundant rest of shadows before tests. [issue #3814].
- Add
ActivityController.windowFocusChanged()API. NotificationManagersimulation improvements [issue #3617].- Add shadow support for
ActivityManager.getMyMemoryState[issue #3775]. - Add
isStopped()method toShadowTextToSpeech[issue #3818]. - Shadow DevicePolicyManager.getStorageEncryptionStatus [issue #3807].
- Added
setManifestShortcuts()andsetMaxShortcutCountPerActivity()toShadowShortcutManager[issue #3803]. - Add shadow support for
Settings#canDrawOverlays().
Deprecations
ShadowNetworkInfo#newInstance()andsetConnectionStatus().
Bug Fixes
- Fix
ShadowMediaPlayerdoes not correctly handle instantiation off the UI thread. [issue #3050]. - Allow Jacoco code coverage to work with Robolectric. [issue #3791].
- Collapse internal whitespace down to single space character in string [issue #3791].
- Cleanup Shadow
MessageQueue/LooperandViewRootImpl.
Misc
- Update android O-MR1 platform to newer build [issue #3817].
- Move
JarInstrumentorto sandbox module [issue #3806].
Use Robolectric:
testCompile "org.robolectric:robolectric:3.8"Find more details here. Report issues here. Enjoy!
brettchabot
released this
Assets
2
Robolectric 3.7.1 contains two regression fixes.
Bug Fixes
- Filter out disabled components in PackageManager query/resolve methods [#3748].
- Fix 'PackageParser' compile errors when referencing ShadowPackageManager.addPackage [#3752].
Dependencies
- Requires compiling against SDK 27.
- Introduces an optional dependency on
com.android.support.test:monitor:1.0.2-alpha1. If your project already depends oncom.android.support.test.*, you should upgrade to 1.0.2-alpha1 to avoid potential conflicts e.g.java.lang.VerifyError: class org.robolectric.android.fakes.RoboMonitoringInstrumentation overrides final method specifyDexMakerCacheProperty.
Use Robolectric:
testCompile "org.robolectric:robolectric:3.7.1"Find more details here. Report issues here. Enjoy!
jongerrish
released this
Assets
2
Robolectric 3.7 brings simulation improvements and better shadow support as well as numerous other fixes and improvements.
This is the second of several releases in which we're replacing Robolectric's hacked-together approximations of the Android resource management code with actual code from the framework. The result should be a vastly more correct Android simulation.
Features
- System Services
- Initial support for
FingerprintManager,KeyguardManager,SearchManager,ShortcutManager,UsbManager,RestrictionsManager,TextClassificationManager, andAutofillManager. - Vastly improved support for
PackageManager, using much more actual Android framework code for manifest parsing. - Improved support for
UserManager,WifiManager,TelephonyManager, andDevicePolicyManager.
- Initial support for
- Support for building using Bazel — instructions here.
- System properties now more closely correspond to the Android framework values.
- Improvements to Shadow support.
@Implementationmethods can and should now be protected.- Performance improvements to shadow handling of > ~1 second per test run, big impact for the interactive use case.
- New developer's guide for Shadow authors.
- Beta support for ATSL's
ActivityTestRuleand Espresso Intents. - Lots of other stuff; see change list below.
Dependencies
- Requires compiling against SDK 27.
- Introduces an optional dependency on
com.android.support.test:monitor:1.0.2-alpha1. If your project already depends oncom.android.support.test.*, you should upgrade to 1.0.2-alpha1 to avoid potential conflicts e.g.java.lang.VerifyError: class org.robolectric.android.fakes.RoboMonitoringInstrumentation overrides final method specifyDexMakerCacheProperty.
Migration Notes
- The shadow methods for Managers listed above have been switched from
publictoprotected. Your test code may have been calling these erroneously instead of calling the Android SDK method, e.g: prefer
PackageManager.getPackageInfo()toShadowPackageManager.getPackageInfo(). This is easily fixed by calling the SDK method instead. AndroidManifesthas been removed; instead, usePackageManagerAPIs.
Deprecations
ShadowApplication.getReceiversForIntent()andhasReceiversForIntent()are deprecated; usePackageManagerAPIs instead.ShadowUserManager.setSerlialNumberForUser()is deprecated; useaddUserProfile()instead.@Implementation(inheritImplementationMethods = true)is largely unnecessary and will be removed in a forthcoming release.- Shadow support for
equals/hashcode/toStringsupport in cases where the method exists only on a parent of the shadowed class is deprecated. Don't shadowequals()for the purposes of testing or assertions, rather only for simulation equivalency. RoboLayoutInflateris deprecated; useLayoutInflaterinstead.RoboVibratoris deprecated, functionality has moved toShadowVibrator.
Changes
- Support
FingerprintManager[issue #3266—thanks @andreszamoraglobant]. ShadowMatrixdoes not implement map* methods [issue #3602—thanks @Kalabasa].- Unit test with
WifiManagerthrows NPE [issue #3655—thanks @qsjh898]. - Read system properties from android-all.jar!build.prop [issue #3620].
- Change Robolectric's
ShadowAccessibilityNodeInfo.equals()test to use a unique sourceID[issue #3623]. - Fix errorprone warnings [issue #3633].
- Allow
@Implementationmethods to be protected instead of public [issue #3130]. - Remove deprecated
ManifestIdentifier.create()[issue #3634]. - Default
minSdkVersionshould be Jelly Bean (16), not 1 [issue #3650]. - Fix asset path searches to include all transitively reachable asset paths [issue #3652].
- Reapply removal of deprecated
ManifestFactory.create()[issue #3636]. - Fix hash stability bug when overriding shadows using
@Config[issue #3667]. - Remove
ShadowPackageManager#setQueryIntentImplicitly[issue #3672]. - Reintroduce
ATSLsupport as an optional dependency [issue #3679]. - Add support to method
getFromLocationonShadowGeocoder[issue #3678—thanks @josecoelho]. - Handle parsing float attribute values with no leading numbers [issue #3699].
- Refactor instrumentation [issue #3654].
- Collect perf metrics for shadow method lookup [issue #3706].
- Refactor
@Implementationmethod resolution [issue #3705]. - Optimize class analysis for instrumentation [issue #3707].
- Add
RGBA_F16togetBytesPerPixelinShadowBitmap[issue #3687]. - Apply sheepfood changes missed during prior syncs [issue #3718].
- Switch Robolectric shadow tests to use android_local_test [issue #3715].
- Fix
Parcel.readByteArray()[issue #3710—thanks @cesar1000]. - Implement
ShadowMatrixmapPointsandmapVectors[issue #3609—thanks @Kalabasa]. - Remove references to
AndroidManifestfrom shadows [issue #3682]. UserManagersimulation improvements [issue #3681].- Adds handling of permission groups to the
PackageManager[issue #3680]. - Delete
ShadowActivityThreadTest[issue #3717]. - Allow
ConfigMergerto be overridden [issue #3713]. - Add
ShadowTelephonyManager.setIsSmsCapable[issue #3702]. - Add support for
FingerprintManager[issue #3696]. - Test cleanups [issue #3695].
- Add missing methods for testing
ConnectivityManager.OnNetworkActiveLi… [issue #3694]. - Fix Resource mapping tests [issue #3691].
- Ignore multidex for
RoboInstrumentationand code cleanup [issue #3690]. - Add
android.net.INetworkPolicyManagertoServiceManager[issue #3689]. - Fix
InstrumentationRegistryTestwhen running on device [issue #3686]. - Re-introduce
ActivityTestRulesupport [issue #3685]. - Prepare Robolectric's test to run with AGP [issue #3683].
KeyguardManagersimulation improvements [issue #3644].UserManagersimulation enhancements [issue #3643].- Add support for
UserManager.getApplicationRestrictions()[issue #3637]. DevicePolicyManagersimulation enhancements [issue #3675].- Remove check for min
JDKversion, Robolectric requires Java 8 anyway [issue #3669]. - Properly set
activityInfo.exportedand permission and addShadowPackageManager.getIntentFiltersForXXXAPIs [issue #3666]. UserManagersimulation enhancements [issue #3662].RestrictionsManangersupportgetManifestRestrictions()[issue #3660].KeyguardManagersimulation improvements [issue #3658].- Add support for
RestrictionsManager[issue #3656]. - Switch
ProxyMakerto use reflection to run on ART API < 26 [issue #3649]. UserManagersimulation enhancements [issue #3648].- Remove obsolete
ShadowsAdapterAPIs [issue #3627]. - Fix imports [issue #3625].
- Remove
@DeprecatedTestLifeCycle.createApplication()[issue #3624]. - Remove obsolete references to
Robolectric.getShadowsAdapter()[issue #3622]. - Fix infinite loop with styles [issue #3616—thanks @nll].
KeyguardManager'sisKeyguardSecure()is API 16 [issue #3631].- Re-work resetter code to simplify [issue #3629].
- Remove
RuntimeEnvironment.getAppManifest[issue #3628]. - Cache setup database in
SQLiteDatabaseTest[issue #3444]. - Optimize
InstrumentingClassLoader.getCommonSuperClass()[issue #3726]. - Refactor instrumentation even more [issue #3730].
- Updating string resources parsing [issue #3177—thanks @pivotal-james-zcheng].
- Xml resource string escaping [issue #3671—thanks @menny].
- Handle receiver class names with no leading '.' [issue #3740].
- Move
WORKSPACEfile and fix path [issue #3735—thanks @dkelmer]. - Add dependencies for bazel projects using Robolectric [issue #3731—thanks @dkelmer].
- Implement support for O system services [issue #3729].
WifiManagersimulation enhancements [issue #3727].- Make some
@Implementationmethods protected [issue #3724]. - Add basic shadow tro prevent
NPEwhen dereferencing [issue #3739]. - Add test case for default shared preferences [issue #3612—thanks @roostertech].
- Stub out restore() method in
ShadowCanvas[issue #3521—thanks @cesar1000]. - Support
ATSLIntents verification API on Robolectric [issue #3728]. - Replace
RobolayoutInflatorwithPhoneLayoutInflatoras per framework [issue #3741]. - Clean up new APIs in 3.7 [issue #3714].
- Switch Vibrator from fake to Shadow [issue #3742].
- Implement equals() in
ShadowPorterDuffColorFilter[issue #3522—thanks @cesar1000]. - Add utility to
ShadowToastto check whether a toast was cancelled [issue #3711—thanks @cesar1000]. SharedPreferenceswill not persist edits acrossgetSharedPreferencescalls [issue #3510—thanks @setheclark].SharedPreferences' commit() hangs if executed after apply() on Android O [issue #3641—thanks @kzaikin].BadParcelableExceptionwhen unmarshalling Parcelable extending class [issue #2398—thanks @menny].- Problem of
WARNINGs[issue #3646—thanks @XinyueZ].
Use Robolectric:
testCompile "org.robolectric:robolectric:3.7"Find more details here. Report issues here. Enjoy!