use of android.test.RenamingDelegatingContext in project k-9 by k9mail.
the class ReconstructMessageFromDatabaseTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
RenamingDelegatingContext context = new RenamingDelegatingContext(getContext(), "db-test-");
setContext(context);
BinaryTempFileBody.setTempDirectory(context.getCacheDir());
createApplication();
createDummyAccount(context);
}
use of android.test.RenamingDelegatingContext in project standup-timer by jwood.
the class TeamTest method setUp.
@Override
protected void setUp() {
daoFactory.setGlobalContext(new RenamingDelegatingContext(mContext, "test_"));
daoFactory.setCacheDAOInstances(true);
dao = daoFactory.getTeamDAO(mContext);
}
use of android.test.RenamingDelegatingContext in project Etar-Calendar by Etar-Group.
the class AsyncQueryServiceTest method buildTestContext.
private Context buildTestContext(final OperationInfo[] work) {
MockContext context = new MockContext() {
MockContentResolver mResolver;
@Override
public ContentResolver getContentResolver() {
if (mResolver == null) {
mResolver = new MockContentResolver();
final String filenamePrefix = "test.";
RenamingDelegatingContext targetContextWrapper = new RenamingDelegatingContext(new MockContext2(), getContext(), filenamePrefix);
IsolatedContext providerContext = new IsolatedContext(mResolver, targetContextWrapper);
ContentProvider provider = new TestProvider(work);
provider.attachInfo(providerContext, null);
mResolver.addProvider(AUTHORITY, provider);
}
return mResolver;
}
@Override
public String getPackageName() {
return AsyncQueryServiceTest.class.getPackage().getName();
}
@Override
public ComponentName startService(Intent service) {
AsyncQueryServiceTest.this.startService(service);
return service.getComponent();
}
};
return context;
}
use of android.test.RenamingDelegatingContext in project android_frameworks_base by DirtyUnicorns.
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());
}
use of android.test.RenamingDelegatingContext in project android_frameworks_base by ResurrectionRemix.
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