robolectric

Android Unit Testing Framework

OTHER License

Stars
5.8K
Committers
672

Bot releases are visible (Hide)

robolectric - Robolectric 3.4 RC4

Published by brettchabot over 7 years ago

NOTE: Robolectric 3.4-rc4 is a outdated release candidate; please use 3.4-rc5 instead.

robolectric - Robolectric 3.4 RC3

Published by hoisie over 7 years ago

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

robolectric - Robolectric 3.4 RC2

Published by hoisie over 7 years ago

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

robolectric - Robolectric 3.4 RC1

Published by xian over 7 years ago

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

robolectric - Robolectric 3.3.2

Published by jongerrish over 7 years ago

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 - Robolectric 3.3.1

Published by xian over 7 years ago

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 - Robolectric 3.3

Published by xian over 7 years ago

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 - Robolectric 3.2

Published by xian over 7 years ago

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 - Robolectric 3.2.2

Published by xian almost 8 years ago

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 - Robolectric 3.2.1

Published by xian almost 8 years ago

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 - Robolectric 3.2-rc1

Published by xian almost 8 years ago

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

robolectric - Robolectric 3.1.4

Published by xian almost 8 years ago

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.

robolectric - Robolectric 3.1.1

Published by xian almost 8 years ago

robolectric - Robolectric 3.1.2

Published by xian almost 8 years ago

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 - Robolectric 3.1.3

Published by xian almost 8 years ago

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 - Robolectric 3.1

Published by erd over 8 years ago

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

robolectric - Robolectric 3.0

Published by erd over 9 years ago

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 - Robolectric 2.0

Published by erd over 9 years ago

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!
robolectric - Robolectric 2.4

Published by ry4n1m3 almost 10 years ago

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 - Robolectric 2.3

Published by erd over 10 years ago

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.