Exemplo n.º 1
0
 public static void resetStaticState() {
   ShadowWrangler.getInstance().silence();
   Robolectric.application = new Application();
   ShadowBitmapFactory.reset();
   ShadowDrawable.reset();
   ShadowMediaStore.reset();
   ShadowLog.reset();
   ShadowContext.clearFilesAndCache();
   ShadowLooper.resetThreadLoopers();
 }
 public RunnerForTestingThatWillPass(final Class<?> testClass) throws InitializationError {
   super(
       testClass,
       isInstrumented() ? null : ShadowWrangler.getInstance(),
       isInstrumented() ? null : ClassLoaderForTesting.getInstance(),
       new RobolectricConfig(
           resourceFile("TestAndroidManifest.xml"),
           resourceFile("res"),
           resourceFile("assets")));
 }
Exemplo n.º 3
0
 public static void resetStaticState() {
   ShadowWrangler.getInstance().silence();
   Robolectric.application = new Application();
   ShadowBitmapFactory.reset();
   ShadowDrawable.reset();
   ShadowMediaStore.reset();
   ShadowLog.reset();
   ShadowContext.clearFilesAndCache();
   ShadowLooper.resetThreadLoopers();
   ShadowDialog.reset();
   ShadowContentResolver.reset();
   ShadowLocalBroadcastManager.reset();
   ShadowMimeTypeMap.reset();
   ShadowPowerManager.reset();
   ShadowStatFs.reset();
   ShadowTypeface.reset();
 }
Exemplo n.º 4
0
 /**
  * Invoke this utility method in tests to reveal which Android api classes and methods are being
  * invoked for which there are no shadows or shadow methods. This helps expose which methods are
  * being invoked either by a third party library or application code which need new shadow methods
  * to be written. Generates output for the current test only.
  */
 public static void logMissingInvokedShadowMethods() {
   ShadowWrangler.getInstance().logMissingInvokedShadowMethods();
 }
Exemplo n.º 5
0
 @SuppressWarnings({"unchecked"})
 public static <P, R> P shadowOf_(R instance) {
   return (P) ShadowWrangler.getInstance().shadowOf(instance);
 }
 public static ClassLoaderForTesting getInstance() {
   if (instance == null) {
     instance = new ClassLoaderForTesting(ShadowWrangler.getInstance());
   }
   return instance;
 }