Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
  2. at org.robolectric.bytecode.RobolectricInternals.newInstanceOf(RobolectricInternals.java:33)
  3. at org.robolectric.Robolectric.newInstanceOf(Robolectric.java:345)
  4. at org.robolectric.shadows.ShadowBitmapFactory.create(ShadowBitmapFactory.java:120)
  5. at org.robolectric.shadows.ShadowBitmapFactory.decodeFile(ShadowBitmapFactory.java:72)
  6. at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java)
  7.  
  8. @Implements(Bitmap.class)
  9. class MyShadowBitmap extends org.robolectric.shadows.ShadowBitmap {
  10.  
  11. public MyShadowBitmap() {
  12. // can also be some other config value
  13. setConfig(Bitmap.Config.ARGB_8888);
  14. }
  15.  
  16. }
  17.  
  18. public class CustomTestRunner extends RobolectricTestRunner {
  19. public CustomTestRunner(Class<?> testClass) throws InitializationError {
  20. super(testClass);
  21. }
  22. @Override
  23. public Setup createSetup() {
  24. return new MySetup();
  25. }
  26. @Override
  27. protected ShadowMap createShadowMap() {
  28. return super.createShadowMap()
  29. .newBuilder()
  30. .addShadowClass(MyShadowBitmap.class)
  31.  
  32. .build();
  33. }
  34. }
  35. }
  36.  
  37. @Test
  38. @Config(shadows = {
  39. MyShadowBitmap.class
  40. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement