use of android.test.RenamingDelegatingContext in project standup-timer by jwood.
the class TeamListTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
a = getActivity();
daoFactory.setCacheDAOInstances(true);
daoFactory.setGlobalContext(new RenamingDelegatingContext(a, "test_"));
dao = daoFactory.getTeamDAO(a);
}
use of android.test.RenamingDelegatingContext in project standup-timer by jwood.
the class MeetingDetailsTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
daoFactory.setCacheDAOInstances(true);
createTestData();
Intent intent = new Intent();
intent.putExtra("teamName", meetingToDelete.getTeam().getName());
intent.putExtra("meetingTime", meetingToDelete.getDescription());
setActivityIntent(intent);
a = getActivity();
daoFactory.setGlobalContext(new RenamingDelegatingContext(a, "test_"));
meetingDao = daoFactory.getMeetingDAO(a);
teamDao = daoFactory.getTeamDAO(a);
}
use of android.test.RenamingDelegatingContext in project standup-timer by jwood.
the class MeetingDetailsTest method createTestData.
private void createTestData() {
Context context = new RenamingDelegatingContext(getInstrumentation().getTargetContext(), "test_");
TeamDAO teamFixturesDao = daoFactory.getTeamDAO(context);
MeetingDAO meetingFixturesDao = daoFactory.getMeetingDAO(context);
Team team = teamFixturesDao.save(new Team("Test Team"));
meetingFixturesDao.save(new Meeting(team, new GregorianCalendar(2010, 0, 5, 10, 15, 0).getTime(), 5, 301, 343, 30, 65));
meetingFixturesDao.save(new Meeting(team, new GregorianCalendar(2010, 0, 6, 10, 17, 0).getTime(), 8, 534, 550, 32, 120));
meetingToDelete = meetingFixturesDao.save(new Meeting(team, new GregorianCalendar(2010, 0, 7, 10, 16, 0).getTime(), 2, 234, 300, 23, 122));
meetingFixturesDao.save(new Meeting(team, new GregorianCalendar(2010, 0, 8, 10, 14, 0).getTime(), 3, 765, 765, 15, 78));
meetingFixturesDao.save(new Meeting(team, new GregorianCalendar(2010, 0, 9, 10, 12, 0).getTime(), 9, 444, 445, 10, 93));
}
use of android.test.RenamingDelegatingContext in project android_frameworks_base by ParanoidAndroid.
the class AccountManagerServiceTest method setUp.
@Override
protected void setUp() throws Exception {
final String filenamePrefix = "test.";
MockContentResolver resolver = new MockContentResolver();
RenamingDelegatingContext targetContextWrapper = new RenamingDelegatingContext(// The context that most methods are delegated to
new MyMockContext(), // The context that file methods are delegated to
getContext(), filenamePrefix);
Context context = new IsolatedContext(resolver, targetContextWrapper);
setContext(context);
mAms = new MyAccountManagerService(getContext(), new MyMockPackageManager(), new MockAccountAuthenticatorCache());
}
use of android.test.RenamingDelegatingContext in project platform_frameworks_base by android.
the class JobStoreTest method setUp.
@Override
public void setUp() throws Exception {
mTestContext = new RenamingDelegatingContext(getContext(), TEST_PREFIX);
Log.d(TAG, "Saving tasks to '" + mTestContext.getFilesDir() + "'");
mTaskStoreUnderTest = JobStore.initAndGetForTesting(mTestContext, mTestContext.getFilesDir());
mComponent = new ComponentName(getContext().getPackageName(), StubClass.class.getName());
}
Aggregations