Android Unit Testing Framework
Robolectric 4.10 adds support for native Android graphics. It is currently disabled by default and can be enabled using @GraphicsMode(NATIVE)
. When native graphics is enabled, interactions with Android graphics classes use real native Android graphics code and are much higher fidelity.
In Robolectric 4.10, ReflectionHelpers.setStaticField
no longer removes the final
keyword from static fields. This is because removing final
using reflection stops working in JDK 18 due to https://openjdk.java.net/jeps/416. To remove final
from static fields, consider using some instrumentation-based approach, such as mockito-inline.
ResourcesManager
configuration when applying qualifiers https://github.com/robolectric/robolectric/pull/7697
Pattern
as the same if the pattern and flags are the same https://github.com/robolectric/robolectric/pull/7776
Full Changelog: https://github.com/robolectric/robolectric/compare/robolectric-4.9.2...robolectric-4.10-alpha-1
NOTE: Robolectric 4.10-alpha-1 is an outdated preview release; please use 4.10 or later instead.
Robolectric 4.9.2 is a minor release that primarily fixes https://github.com/robolectric/robolectric/issues/7879, which was an issue using native SQLite with older Linux machines.
It also includes:
Full Changelog: https://github.com/robolectric/robolectric/compare/robolectric-4.9.1...robolectric-4.9.2
Robolectric 4.9.1 is a minor release that fixes several issues:
Full Changelog: https://github.com/robolectric/robolectric/compare/robolectric-4.9...robolectric-4.9.1
Robolectric 4.9 adds support for Android T (API level 33).
This release removes shadows supportv4 module fully.
It also installs the Conscrypt as the primary Security provider. See http://robolectric.org/blog/2022/09/06/Umesh-GSoC-on-ConscryptMode/ for details.
4.9 also turns on NATIVE sqlite mode by default for Mac and Linux. Windows will continue to use the LEGACY SQLite mode.
UiController#loopMainThreadUntilIdle
on registered idling resources being idle. https://github.com/robolectric/robolectric/pull/7148
nCreateTextureLayer
https://github.com/robolectric/robolectric/pull/7166
targetSdk
from AndroidManifest.xml by @Umesh-01 in https://github.com/robolectric/robolectric/pull/7232
ShadowChoreographer
methods https://github.com/robolectric/robolectric/pull/7278
ShadowContextWrapper.grantPermissions()
when sending broadcasts to receivers with permissions. https://github.com/robolectric/robolectric/pull/7463
ShadowUiAutomation#setRotation
https://github.com/robolectric/robolectric/pull/7537
getDeclaredField
helper in more parts of ReflectionHelpers https://github.com/robolectric/robolectric/pull/7544
Truth.assertThat(java.lang.Boolean)
that ignore the result to call isTrue()
on it instead. https://github.com/robolectric/robolectric/pull/7553
idx
and offset
correctly from sparse resource entries https://github.com/robolectric/robolectric/pull/7594
Full Changelog: https://github.com/robolectric/robolectric/compare/robolectric-4.8...robolectric-4.9-alpha-1
NOTE: Robolectric 4.9-alpha-1 is an outdated preview release; please use 4.9 or later instead.
This is a minor release that fixes a number of issues, including:
https://github.com/robolectric/robolectric/issues/7413, an issue closing SQLite databases.
https://github.com/robolectric/robolectric/issues/7479, an initialization error in CountDownTimer.
testCompile "org.robolectric:robolectric:4.8.2"
This is a minor release that fixes #7286, a NoClassDefError that can occur. Thanks for @utzcoz for the fix (#7284).
Robolectric 4.8 adds support for Android S V2 (API level 32). It also contains many bug fixes and API enhancements.
ShadowVibrator#addSupportedPrimitives
to enable in https://github.com/robolectric/robolectric/pull/6907
windowConfiguration
bounds when updating the display metrics in https://github.com/robolectric/robolectric/pull/6922
VibrationAttributes
in ShadowVibrator
and exposes a getter getVibrationAttributesFromLastVibration
to get VibrationAttributes for the last vibration. in https://github.com/robolectric/robolectric/pull/7018
ShadowWindowManagerGlobal#getLastDragClipData
method in https://github.com/robolectric/robolectric/pull/7019
ShadowPausedSystemClock
thread safe in https://github.com/robolectric/robolectric/pull/7083
robolectric.rendernode.enableMatrix
flag in https://github.com/robolectric/robolectric/pull/7099
getTotalSize
, setTotalSize
, getBytesSoFar
and setBytesSoFar
for DownloadManager.Request in ShadowDownloadManager. in https://github.com/robolectric/robolectric/pull/7104
nCreateTextureLayer
to ShadowHardwareRenderer
in https://github.com/robolectric/robolectric/pull/7106
ColorSpace
to ShadowBitmap
in https://github.com/robolectric/robolectric/pull/7134
@Test(expected = ...)
to assertThrows(...)
. in https://github.com/robolectric/robolectric/pull/7143
ShadowCanvas
in https://github.com/robolectric/robolectric/pull/7146
UiController#loopMainThreadUntilIdle
on registered idling resources being idle. in https://github.com/robolectric/robolectric/pull/7148
nCreateTextureLayer
in https://github.com/robolectric/robolectric/pull/7166
targetSdk
from AndroidManifest.xml by @Umesh-01 in https://github.com/robolectric/robolectric/pull/7232
Full Changelog: https://github.com/robolectric/robolectric/compare/robolectric-4.7.3...robolectric-4.8
testCompile "org.robolectric:robolectric:4.8"
*NOTE: Robolectric 4.8-alpha-1 is a outdated preview release; please use 4.8 or later instead.