Skip to content

Releases: robolectric/robolectric

Robolectric 3.1.3

28 Dec 19:13
Compare
Choose a tag to compare

Android Simulation Changes:

  • Robolectric's handling of styles and themes is now much more faithful to Android's actual behavior. Missing styles (often from AppCompat) are now more likely to cause failures, so you'll generally want to set a theme, either through your manifest or programmatically.
  • Missing resources and attributes which silently failed or defaulted to platform attributes with the same name will now raise errors.
  • Robolectric's PackageManager is more fully implemented; e.g. you can now setPackagesForUid().

API Changes:

  • ContentProviders should be created using Robolectric.buildContentProvider(), which simulates how the framework creates them (and calls onCreate() automatically).
  • RoboMenuItems should be constructed with a context.
  • RobolectricTestRunner has been changed to make it easier to customize manifest loading, while retaining caching. If you have a custom test runner, you should override getManifestFactory() instead of getAppManifest().
  • You can enable style resolution debug output by turning on logging (by setting the robolectric.logging.enabled system property to "true").

Known Issues:

  • Some issues resolving styles (particularly related to AppCompat) still exist.

Robolectric 3.1.2

28 Dec 19:14
Compare
Choose a tag to compare

Android Simulation Changes:

  • Improvements to Multidex, Play Services, and Maps support.
  • Fixed NullPointerException when attempting to load non-existent resource (now correctly throws ResourceNotFoundException).

Robolectric 3.1.1

28 Dec 19:16
Compare
Choose a tag to compare

Robolectric 3.1

07 Jun 02:37
@erd erd
Compare
Choose a tag to compare

Robolectric 3.1

Features

  • Support for Lollipop MR1
  • Support for Marshmallow
  • Better shadows for Play Services
  • Use invokedynamic for shadows and intrinsics

Upgrade Notes

Known Issues

  • PowerMock does not work (#2429)

Robolectric 3.0

08 Jul 20:07
@erd erd
Compare
Choose a tag to compare

Robolectric 3.0

After a long wait, Robolectric 3.0 is now available.

Features

  • Support for KitKat
  • Support for Lollipop
  • Support for add-on shadows
  • Out of the box support for Gradle / Android Studio.

Upgrade Notes

See https://github.com/robolectric/robolectric/wiki/2.4-to-3.0-Upgrade-Guide

Robolectric 2.4

07 Nov 18:55
Compare
Choose a tag to compare

Robolectric 2.4

Fellow Android testing enthusiasts, Robolectric 2.4 has been released!

Features

  • Compatibility with JDK 7 & 8.
  • Better style and theme resolution. Robolectric now has more realistic resource resolution for style references in themes. This increases compatibility with appcompat-v7.
  • Add additional configuration options to the @Config annotation including, application class name, path to res directory, paths to library res directories.
  • Improved real android implementation jar management. Robolectric will fingerprint and cache the android-all jars downloaded at runtime so they are downloaded fewer times.
  • Allow for running tests offline (controllable via robolectric.offline and robolectric.dependency.dir system properties).

Contributor Features

  • Robolectric's shadowOf methods are now created using an annotation processor. In addition, the processor also performs validation on the use of @Implementation, @Implements, @Resetter, and @RealObject annotations.

Bug Fixes

  • ShadowNotification and ShadowNotification.Builder enhancements and bug fixes.
  • Tons of small improvements and bug fixes.

Upgrade Notes

  • Removed dependency on fest-assert, fest-reflect, and fest-util.

Robolectric 2.3

20 May 00:55
@erd erd
Compare
Choose a tag to compare

Robolectric 2.3

We're happy to announce that Robolectric 2.3 has been released!

Features

  • Robolectric will now load (at runtime) the Android SDK that matches either the value of targetSdkVersion or the value specified in a @config annotation.
  • Robolectric now uses a real implementation of SQLite instead of a collection of shadows and fakes. Tests can now be written to verify real database behavior.
  • Robolectric will now parse content provider declarations from your manifest and return them via the ContentResolver mechanism. In addition, CursorLoaders and AsyncTaskLoaders are now correctly tied into Robolectric's scheduler mechanism.
  • New ServiceController component (similar to ActivityController) which can be used to safely drive a service through its lifecycle.
  • Meta-data values, permissions, and intent filters are now parsed out of the manifest and available from ShadowApplication
  • Removal of a bunch of unnecessary shadows.

Bug Fixes

  • Lots of resource and manifest parsing fixes.
  • Lots of miscellaneous improvements to shadows.

Upgrade Notes

  • The reflective lifecycle methods on ShadowActivity (callOnCreate, callOnResume, etc) have been removed. You are now required to use an ActivityController to move an Activity through its lifecycle.

Robolectric 2.2

03 Dec 05:07
@erd erd
Compare
Choose a tag to compare

We are happy to announce that the latest version of Robolectric, 2.2, has been released. This release represents several months of work by the Robolectric team and includes some notable improvements. Most interesting is that we've moved one step closer to "Android Reality" by removing one of the main fake pieces of Robolectric — the RoboWindow. We now use the real implementation of Window from the AOSP sources. This has far-reaching consequences but the main one is that we now support the native ActionBar. Your code can now call getActionBar() without getting back a null, and you'll be able to interact with an ActionBar in your tests as well.

Features

  • Robolectric now does not have a fake implementation of Window (RoboWindow). It has been removed and we now use the internal PhoneWindow class. This allows the getActionBar()method in Activity to return a real ActionBar implementation in tests.
  • To create and manage Activity instances, you must now use the ActivityController interface (see Robolectric.buildActivity()).
  • Added visible() method to ActivityController. visible() must be called on an activity in order for View.isShown() to report back anything but false, since it hooks up the Activity's view hierarchy to the WindowManager.
  • Some shadows were removed (ShadowListActivity)

Bug Fixes

  • Animation.hasEnded() works as expected.
  • AsyncTasks no longer swallow exceptions that are thrown during onPostExecute().
  • Context.startActivity() calls can now optionally check if the specified Activity is in thePackageManager using Robolectric.checkActivities(true).
  • Many many issues fixed.
  • Better support for Windows development environments.
  • Documentation updates!

Robolectric 2.1

03 Dec 05:09
@erd erd
Compare
Choose a tag to compare

Features

  • Layout inflation is now handled by real Android OS code.
  • Improved support for “style” attribute and theme queries in layout attributes.
  • Implemented AssetManager.openXmlResourceParser().
  • Support for using disk-based SQLite databases.

Bug Fixes

  • ActionBarSherlock should work, pretty much.
  • Fixed bugs in Handler.sendMessageAtTime(), and various timing issues.
  • Numerous other fixes and improvements from the Robolectric community! Thank you contributors!

Robolectric 2.0

18 Mar 14:46
@erd erd
Compare
Choose a tag to compare

Features

  • Support for library projects.
  • More realistic resource loading, including system resources.
  • Much better support for resource qualifiers (e.g. locale, resolution, etc.).
  • Groundwork to remove many shadows and use actual android sdk code.
  • Moved to org.robolectric package and maven groupId.
  • Switched from Javassist to ASM for bytecode manipulation: much faster.
  • All classes in android.support.* are now unshadowed and should work as expected.
  • Improved resource and library project support.
  • Massive realism upgrade.
  • Dramatically improved resource loading, with support for themes and styles.
  • Easier TestRunner setup and configuration.
  • The new @config annotation to specify config for a test class or test method:
  • The SDK level to report: @config(reportSdk=Build.VERSION_CODES.FROYO)
  • Qualifiers for resource loading: @config(qualifiers="fr-port-hdpi")
  • Custom shadow classes to enable.
  • For classes and methods that aren’t explicitly shadowed, Robolectric now calls through to the real SDK code.
  • Views now complain if you try to pass in a null Context. Don’t do it!
  • SDK method execution is now much much faster, especially in cases where we use the actual SDK code rather than a shadow (which will increasingly be the normal case).
  • Performance and memory use improvements.
  • Removed Hamcrest matchers; use fest-android instead.
  • Numerous fixes and improvements from the Robolectric community. Thank you, contributors!