protected void prepareEnvironmentForTest() throws IOException { // FIXME Trying to reset the device environment is crashing tests somehow deleteRosFiles(); if (BaseRealm.applicationContext != null) { // Realm was already initialized. Reset all internal state // in order to be able fully re-initialize. // This will set the 'm_metadata_manager' in 'sync_manager.cpp' to be 'null' // causing the SyncUser to remain in memory. // They're actually not persisted into disk. // move this call to 'tearDown' to clean in-memory & on-disk users // once https://github.com/realm/realm-object-store/issues/207 is resolved SyncManager.reset(); BaseRealm.applicationContext = null; // Required for Realm.init() to work } Realm.init(InstrumentationRegistry.getContext()); originalLogLevel = RealmLog.getLevel(); RealmLog.setLevel(LogLevel.DEBUG); }
@Test public void testNullToken() throws Exception { Log.d(TAG, "uploadNullToken"); final String token = null; final String filePath = getPath(); final CountDownLatch signal = new CountDownLatch(1); FileUploader.upload(InstrumentationRegistry.getTargetContext(), token, filePath, null, new FileUploaderListener() { @Override public void onFailure(OperationMessage operationMessage) { Log.d(TAG, "onFailure: " + operationMessage.getMessage()); signal.countDown(); Assert.assertTrue(operationMessage.getMessage().contains("token invalidate")); } @Override public void onSuccess(int status, JSONObject responseJson) { Log.d(TAG, "onSuccess: " + responseJson); signal.countDown(); Assert.assertNull(responseJson); } }); signal.await(WAIT_TIME, TimeUnit.MILLISECONDS); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.fengshihao.webpager", appContext.getPackageName()); }
@Before public void setUp() { // Creates a Realm with the following objects: // 0: (5, "Adam") // 1: (4, "Brian") // 2: (4, "Adam") // 3: (5, "Adam") // Injecting the Instrumentation instance is required // for your test to run with AndroidJUnitRunner. context = InstrumentationRegistry.getInstrumentation().getContext(); realmConfig = configFactory.createConfiguration(); realm = Realm.getInstance(realmConfig); populateRealm(realm); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.rednineteen.android.adn", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("wanjian.renderingperformance.test", appContext.getPackageName()); }
@Test public void updateAvailable_Basic_XML() throws Throwable { final CountDownLatch signal = new CountDownLatch(1); uiThreadTestRule.runOnUiThread(new Runnable() { @Override public void run() { new AppUpdaterUtils(InstrumentationRegistry.getTargetContext()) .setUpdateFrom(UpdateFrom.XML) .setUpdateJSON("https://raw.githubusercontent.com/javiersantos/AppUpdater/master/app/src/androidTest/java/com/github/javiersantos/appupdater/files/update-available-basic.xml") .withListener(new AppUpdaterUtils.UpdateListener() { @Override public void onSuccess(Update update, Boolean isUpdateAvailable) { assertTrue(isUpdateAvailable); signal.countDown(); } @Override public void onFailed(AppUpdaterError error) { assertNotNull(error); signal.countDown(); } }) .start(); } }); signal.await(30, TimeUnit.SECONDS); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.highbryds.tracker", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.zhangyf.reward", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.ajaykumar.drawer", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.harpz.androidvalidator.test", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.kila.apprater_dialog.lars.test", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("de.lucasscheuvens.qtk", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("moe.shizuku.bridge", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.suyashsrijan.autoscrollr", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.akexorcist.cameraapi", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.discover", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.a.vinpal", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.github.thunder413.datetimeutilssample", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.totcy.animationtextview.test", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("mn.pomodoro", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("scut.carson_ho.view_testdemo", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.bignerdranch.android.typesetter", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.tubb.afrouter.test", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.databindingdemo", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.hoanganhtuan95ptit.gifemoji.test", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.ahmed.walkgraph", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.devmasterteam.festafimdeano", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("test.fadai.com.test", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.ekanugrahapratama.aardvark_project", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.junnanhao.samanthaviews.test", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.jjuiddong.myapplication", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.hss01248.safemedia", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("ch.modeso.profilemenuanimation", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.android.courtcounter", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.daquexian.flexiblerichtextview.test", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("herry.architec", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.shenhua.zhidaodaily", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("forgettery.wiseass.com.recyclerviewprebuilt", appContext.getPackageName()); }
@Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.hss01248.tensorflowdynamic.test", appContext.getPackageName()); }