Sha256: 1202ae1b8d7a81ad4dd987a26ae746bb8f685f4275ff148ffce586471a531a6e
Contents?: true
Size: 1.85 KB
Versions: 21
Compression:
Stored size: 1.85 KB
Contents
package sh.calaba.instrumentationbackend; import sh.calaba.instrumentationbackend.actions.Actions; import sh.calaba.instrumentationbackend.actions.HttpServer; import android.app.Instrumentation; import android.test.ActivityInstrumentationTestCase2; import android.util.Log; import com.jayway.android.robotium.solo.SoloEnhanced; public class InstrumentationBackend extends ActivityInstrumentationTestCase2 { public static String testPackage; public static Class mainActivity; private static final String TAG = "InstrumentationBackend"; public static Instrumentation instrumentation; public static SoloEnhanced solo; public static Actions actions; public InstrumentationBackend() { super(testPackage, mainActivity); } @Override protected void setUp() throws Exception { super.setUp(); solo = new SoloEnhanced(getInstrumentation(), this.getActivity()); actions = new Actions(getInstrumentation(), this); instrumentation = getInstrumentation(); } /** * Here to have JUnit3 start the instrumentationBackend */ public void testHook() throws Exception { HttpServer httpServer = HttpServer.getInstance(); httpServer.setReady(); httpServer.waitUntilShutdown(); solo.finishOpenedActivities(); } @Override public void tearDown() throws Exception { HttpServer httpServer = HttpServer.getInstance(); httpServer.stop(); System.out.println("Finishing"); try { solo.finalize(); } catch (Throwable e) { e.printStackTrace(); } this.getActivity().finish(); super.tearDown(); } public static void log(String message) { Log.i(TAG, message); } public static void logError(String message) { Log.e(TAG, message); } }
Version data entries
21 entries across 21 versions & 1 rubygems