Skip to content

Releases: robolectric/robolectric

Robolectric 3.4 RC2

17 May 21:54
Compare
Choose a tag to compare
Robolectric 3.4 RC2 Pre-release
Pre-release

NOTE: Robolectric 3.4-rc2 is a outdated release candidate; please use 3.4-rc3 instead.

Robolectric 3.4 RC1

16 May 00:34
Compare
Choose a tag to compare
Robolectric 3.4 RC1 Pre-release
Pre-release

NOTE: Robolectric 3.4-rc1 is a outdated release candidate; please use 3.4-rc2 instead.

Robolectric 3.3.2

28 Mar 23:05
Compare
Choose a tag to compare

Robolectric 3.3.2 provides support for Android O Developer Preview 1, improves startup time, and resolves a licensing issue.

Features:

  • Initial support for Android O runtime [issue #2988].

Bug Fixes:

  • Fix issues with PackageManager simulation: addPackage() should not create sessions [issues #2984 and #2950].
  • Fix deadlock caused by synchronicity of Scheduler [issues #2115, #1043, and #2982].
  • Fix NoClassDefFoundError: javax/microedition/khronos/opengles/GL [issues #2960 and #1932].
  • Fixed: instrumentation fails for abstract subclasses of framework classes [issue #2951 and #2983].

Misc:

  • Switch from VTD to StAX for parsing resource xml; resolves licensing issue and reduces resource parsing time by about 60% [issues #2964, #2865, and #1414].
  • Clean up temp dirs left behind after test runs.

Use Robolectric:

testCompile "org.robolectric:robolectric:3.3.2"

Find more details here. Report issues here. Enjoy!

Robolectric 3.3.1

09 Mar 01:45
Compare
Choose a tag to compare

Robolectric 3.3.1 fixes a few bugs; details below.

Android Simulation Changes

  • Support PackageManager.getXml() [issue #2953].

Bug Fixes:

  • Fix issue with PowerMock [issues #2944, #2749, #2952].
  • Allow overriding the assets directory in Gradle builds [issue #2939].
  • Fix Html.fromHtml()/System.arraycopy() bug [issue #2959].

Use Robolectric:

testCompile "org.robolectric:robolectric:3.3.1"

Find more details here. Report issues here. Enjoy!

Robolectric 3.3

03 Mar 01:31
Compare
Choose a tag to compare

Robolectric 3.3 fixes some long-standing bugs (notably PowerMock and Mockito integration) and adds some significant new features. Details below.

New Features

Android Simulation Changes

  • <array> resources are now supported [issue #2064].
  • Context#getExternalFilesDirs now supported [issue #2818].
  • Implemented android.opengl.Matrix [issue #2893].
  • Implemented a bunch of methods in PackageManager: [issue #2913].
    • checkSignatures()
    • getDefaultActivityIcon()
    • getInstalledApplications()
    • getInstallerPackageName() and setInstallerPackageName()
    • getPackageSizeInfo() (Use addPackage() to control behavior.)
    • getPermissionInfo() (Use manifest or addPermissionInfo() to control behavior.)
    • resolveContentProvider()
  • Implemented a bunch of methods in AccountManager: [issue #2906].
    • All methods which return a AccountManagerFuture will now post their work to the specified Handler, so it will be deferred or executed immediately depending on the state of its Scheduler.
  • Added initial support for WifiP2pManager [issue #2933].
  • View.getGlobalVisibleRect() now uses the framework implementation unless setGlobalVisibleRect() has been called.

API Changes:

  • Several classes have moved to new packages. See Migration Guide for details [issue #2873].
  • PackageManager's behavior is moving from a subclass to a shadow. See the Migration Guide [issue #2887]
  • Deprecated RuntimeEnvironment.getPackageManager(). Use Android APIs instead.
  • Deprecated ShadowConfiguration. Use Configuration directly instead.
  • Deprecated ShadowView#getQualifiers(). Use Robolectric.getQualifiers() instead.
  • Deprecated *Controller.withIntent() and .attach() [issue #2938].
  • Removed deprecated ShadowLocation. Note that Location.equals() is no longer shadowed with special equality rules. [issue #2932]
  • Removed deprecated ShadowNotification.getProgressBar(), ShadowDrawable.reset(), ShadowContentResolver.registerProvider(), ShadowContentResolver.getContentObserver(), ShadowImageView.getImageResourceId(), and ShadowImageView.getImageBitmap() [issue #2932].
  • Removed deprecated ShadowIntentFilter.
  • Removed deprecated RoboAttributeSet and Attribute class. Use Robolectric.buildAttributeSet() instead.
  • Removed deprecated MultiApiRobolectricTestRunner [issue #2924].
  • The jars that comprise Robolectric have changed a bit. If your build system doesn't automatically pull in dependencies, see this post on (hermetic builds)[http://robolectric.org/blog/2017/03/01/hermetic-builds/] for more info.

Bug Fixes:

  • Fixed: PowerMock broken [issue #2208].
  • Fixed: Mockito experimental mocking of finals is broken [issue #2677].
  • Fixed a bug causing styleable attribute lookup in application resources to fail sometimes [issue #2878].
  • Fixed a bug which caused non-layout resources to be seen as layouts [issue #2882].
  • Fixed View.getWindowId() to behave more like Android [issue #2888].
  • Fixed a bug in BitmapRegionDecoder [issue #2926].
  • Fixed a bug in PackageMAnager.queryIntentContentProviders() [issue #2927].

Known Issues:

  • Some styles may still not resolve properly [issue #2787].

Use Robolectric:

testCompile "org.robolectric:robolectric:3.3"

Find more details here.

Robolectric 3.2.2

11 Jan 23:43
Compare
Choose a tag to compare

Bug Fixes:

  • Fixed: PhoneUtils broken starting from M (getResourceAsStream is broken) [issue #2773].
  • Fixed: Robolectric reports all tests running with SDK [16] [issue #2836].
  • Fixed: Memory Leak when testing Activities [issue #2068].
  • Fixed: Global robolectric.properties file is not loaded [issue #2843].

API Changes:

  • ShadowLocation has been deprecated and will be removed in a future major release.

Known Issues:

  • PowerMock broken [issue #2208].
  • Mockito experimental mocking of finals is broken [issue #2677].
  • Some styles may still not resolve properly [issue #2787].

Use Robolectric:

testCompile "org.robolectric:robolectric:3.2.2"

Find more details here.

Robolectric 3.2.1

06 Jan 23:59
Compare
Choose a tag to compare

Bug Fixes:

  • Fixed: Unable to run Robolectric 3.2 under Windows [issue #2814].
  • Fixed: Mockito @InjectMocks broken [issue #2442].
  • RoboCursor.getColumnCount() now returns the number of columns in the result data (as before), unless you explicitly call setColumnCount() [issue #2830].
  • Xml with non-reference style attribute value should return 0 for getStyleAttribute() [issue #2829].

Known Issues:

  • PowerMock broken [issue #2208].
  • Mockito experimental mocking of finals is broken [issue #2677].
  • Some styles may still not resolve properly [issue #2787].

Use Robolectric:

testCompile "org.robolectric:robolectric:3.2.1"

Find more details here.

Robolectric 3.2

27 Jan 02:48
Compare
Choose a tag to compare

Android SDK Support

  • Android N (API level 24, framework code version 7.0.0_r1) and N_MR1 (API level 25, framework code version 7.1.0_r7) are now supported.
  • Android M (API level 23) framework code has been bumped from 6.0.0_r1 to 6.0.1_r3.
  • Numerous resource resolution bugs related to AppCompat 24 when running on older SDKs have been fixed.

New Features

  • RobolectricTestRunner now supports running tests against multiple SDKs. See Configuring Robolectric for more details.

Android Simulation Changes:

  • Matrix is now more fully implemented.
  • Matrix.toString() no longer returns a summary of operations. You may use shadowOf(matrix).getDescription() or shadowOf(matrix).getPostOperations() etc. instead.
  • Matrix operations applied to Bitmaps now cause the size of the Bitmap to change accordingly.
  • Drawable resources declared as <item type="drawable"/> are now supported.
  • Location listeners registered multiple times with LocationManager.requestLocationUpdates() will only receive one notification.
  • Parcelable.readException(), writeInterfaceToken() and enforceInterface() are now implemented.
  • Binary Drawables with qualifiers (e.g. in drawable-hdpi) can now be accessed using Resources.openRawResource().
  • BitmapRegionDecoder is now implemented; bitmap width and height are correctly detected.
  • AssetManager.getThemeValue() now honors the value of the resolveRefs argument, and correctly handles style references to attributes in another package.
  • ShadowIcon provides accessors for hidden Icon internals.
  • JobScheduler.cancel() and Looper.quitSafely() are now implemented.
  • Canvas.drawBitmap() with destination RectF is now implemented.
  • IntentFilter now uses all-framework code. Previously, equals() and hashCode() had a partial shadow implementation, but now they are unimplemented.
  • Some additional methods on RoboCursor are now implemented.
  • XmlPullParser.getIdAttributeResourceValue() now resolves references.
  • NotificationManager.getActiveNotifications() is now implemented.
  • Added basic support for device protected storage contexts.
  • Added basic support for setting state of UserManager.isUserUnlocked().

API Changes:

  • ManifestFactory.identify() won't be called with manifest = "--default" any more.
  • Specify @Implements(minSdk/maxSdk) or @Implementation(minSdk/maxSdk) to restrict shadow classes and methods to the given Android SDK levels.
  • ShadowIntentFilter has been deprecated and will be removed in the next major release.
  • If you are doing custom configuration using a subclass of RobolectricTestRunner you'll probably need to make a few changes. See Migration Guide for details.
  • When injecting a RoboCursor, be sure to call setColumnNames() on it if you care about what getColumnCount() will return later.

Bug Fixes:

  • Fixed java.util.ServiceConfigurationError: org.robolectric.internal.ShadowProvider: Provider org.robolectric.Shadows not a subtype [issue #2737].
  • A number of race conditions and minor bugs have been fixed.

Known Issues:

  • Robolectric still has issues with PowerMock and Mockito [issues #2429 and #2677]. We'll have a fix soon, promise!
  • Some styles may still not resolve properly [issue #2787].
  • Fails to run on Windows [issue #2814].

Thanks to the many contributors to this release!

Use Robolectric:

testCompile "org.robolectric:robolectric:3.2"

Find more details here.

Robolectric 3.2-rc1

29 Dec 21:51
Compare
Choose a tag to compare
Robolectric 3.2-rc1 Pre-release
Pre-release

NOTE: Robolectric 3.2-rc1 is a outdated release candidate; please use 3.2 instead.

Robolectric 3.1.4

28 Dec 19:17
Compare
Choose a tag to compare

This release fixes an issue that prevented running tests for projects without an explicit dependency on org.robolectric:shadows-core. If version 3.1.3 was working for you, there'll be no changes in 3.1.4.