Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
- at org.robolectric.bytecode.RobolectricInternals.newInstanceOf(RobolectricInternals.java:33)
- at org.robolectric.Robolectric.newInstanceOf(Robolectric.java:345)
- at org.robolectric.shadows.ShadowBitmapFactory.create(ShadowBitmapFactory.java:120)
- at org.robolectric.shadows.ShadowBitmapFactory.decodeFile(ShadowBitmapFactory.java:72)
- at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java)
- @Implements(Bitmap.class)
- class MyShadowBitmap extends org.robolectric.shadows.ShadowBitmap {
- public MyShadowBitmap() {
- // can also be some other config value
- setConfig(Bitmap.Config.ARGB_8888);
- }
- }
- public class CustomTestRunner extends RobolectricTestRunner {
- public CustomTestRunner(Class<?> testClass) throws InitializationError {
- super(testClass);
- }
- @Override
- public Setup createSetup() {
- return new MySetup();
- }
- @Override
- protected ShadowMap createShadowMap() {
- return super.createShadowMap()
- .newBuilder()
- .addShadowClass(MyShadowBitmap.class)
- .build();
- }
- }
- }
- @Test
- @Config(shadows = {
- MyShadowBitmap.class
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement