@Override protected void setUp() throws Exception { super.setUp(); mMainActivity = getActivity(); mOriginalData = new ArrayList<>(); // Save the original data and wipe out the storage StoreRetrieveData dataStorage = getDataStorage(); try { ArrayList<ToDoItem> items = dataStorage.loadFromFile(); if (items.size() > 0) { mOriginalData.clear(); mOriginalData.addAll(items); items.clear(); dataStorage.saveToFile(items); } } catch (Exception e) { fail("Couldn't store data: " + e.getMessage()); } }
@Override public void setUp() throws Exception { super.setUp(); }
@Override public void setUp() throws Exception { super.setUp(); }
@Override public void setUp() throws Exception { super.setUp(); }
@Override protected void setUp() throws Exception { super.setUp(); // In setUp, you can create any shared test data, or set up mock components to inject // into your Activity. But do not call startActivity() until the actual test methods. mStartIntent = new Intent(Intent.ACTION_MAIN); }
@Override protected void setUp() throws Exception { super.setUp(); // In setUp, you can create any shared test data, or set up mock components to inject // into your Activity. But do not call startActivity() until the actual test methods. mStartIntent = new Intent(Intent.ACTION_MAIN); }
@Override protected void setUp() throws Exception { super.setUp(); CalculonAssertions.register(this); ActivityLauncher.setTestCase(this); launchConfig = new LaunchConfiguration(); }
protected void setUp() throws Exception { super.setUp(); this.texts = new Texts(); } @SmallTest
protected void setUp() throws Exception { super.setUp(); app = new ZulipApp(); }
@Override public void setUp() throws Exception { super.setUp(); context = getInstrumentation().getTargetContext(); signal = new CountDownLatch(1); }
@Override public void setUp() throws Exception { super.setUp(); signal = new CountDownLatch(1); this.context = getInstrumentation().getTargetContext(); }
@Override public void setUp() throws Exception { super.setUp(); this.context = getInstrumentation().getTargetContext(); }
@Override protected void setUp() throws Exception { super.setUp(); final Intent launchIntent = new Intent(getInstrumentation() .getTargetContext(), DocumentCentricActivity.class); mDocumentCentricActivity = startActivity(launchIntent, null, null); }
@Override public void setUp() throws Exception { super.setUp(); this.context = getInstrumentation().getTargetContext(); try { runTestOnUiThread(new Runnable() { @Override public void run() { signal = TestUtils.cleanBucket(context, SampleBean.class, bucketId); } }); } catch (Throwable throwable) { // TODO: check this // an error happened throw new Exception(throwable); } signal.await(2, TimeUnit.SECONDS); signal = new CountDownLatch(1); }
@SuppressLint("CommitPrefEdits") @Override protected void setUp() throws Exception { super.setUp(); prefs = mock(SharedPreferences.class); editor = mock(SharedPreferences.Editor.class); when(prefs.edit()).thenReturn(editor); setActivityContext(new InjectedContext(getInstrumentation(), prefs)); startActivity( new Intent( getInstrumentation().getTargetContext(), TestActivity.class), null, null); }
@SuppressLint("CommitPrefEdits") @Override protected void setUp() throws Exception { super.setUp(); prefs = mock(SharedPreferences.class); editor = mock(SharedPreferences.Editor.class); when(prefs.edit()).thenReturn(editor); setActivityContext(new InjectedContext(getInstrumentation(), prefs)); startActivity( new Intent( getInstrumentation().getTargetContext(), TestActivity.class), null, null); uut = StoreBox.create(getActivity(), ForwardingMethodsInterface.class); }
@Override protected void setUp() throws Exception { super.setUp(); startActivity(new Intent(getInstrumentation().getTargetContext(), TestPreferencesActivity.class), null, null); testPreferencesActivity = getActivity(); resources = testPreferencesActivity.getResources(); }