Search in sources :

Example 16 with RenamingDelegatingContext

use of android.test.RenamingDelegatingContext in project WordPress-Android by wordpress-mobile.

the class GCMIntentServiceTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    FactoryUtils.initWithTestFactories();
    mTargetContext = new RenamingDelegatingContext(getContext(), "test_");
    TestUtils.clearApplicationState(mTargetContext);
    setupService();
}
Also used : RenamingDelegatingContext(android.test.RenamingDelegatingContext)

Example 17 with RenamingDelegatingContext

use of android.test.RenamingDelegatingContext in project WordPress-Android by wordpress-mobile.

the class DefaultMocksInstrumentationTestCase method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    FactoryUtils.initWithTestFactories();
    mTargetContext = new RenamingDelegatingContext(getInstrumentation().getTargetContext(), "test_");
    TestUtils.clearApplicationState(mTargetContext);
    // Init contexts
    RestClientFactoryTest.sContext = getInstrumentation().getContext();
    AppLog.v(AppLog.T.TESTS, "Contexts set");
    // Set mode to Customizable
    RestClientFactoryTest.sMode = RestClientFactoryTest.Mode.CUSTOMIZABLE;
    AppLog.v(AppLog.T.TESTS, "Modes set to customizable");
    // Set default variant
    RestClientFactoryTest.setPrefixAllInstances("default");
}
Also used : RenamingDelegatingContext(android.test.RenamingDelegatingContext)

Example 18 with RenamingDelegatingContext

use of android.test.RenamingDelegatingContext in project WordPress-Android by wordpress-mobile.

the class FluxCMigrationTest method setUp.

@Override
protected void setUp() throws Exception {
    // Needed for Mockito
    System.setProperty("dexmaker.dexcache", getInstrumentation().getTargetContext().getCacheDir().getPath());
    mRenamingTargetAppContext = new RenamingDelegatingContext(getInstrumentation().getTargetContext().getApplicationContext(), "test_");
    mTestContext = getInstrumentation().getContext();
    mSiteStore = new SiteStore(new Dispatcher(), Mockito.mock(SiteRestClient.class), Mockito.mock(SiteXMLRPCClient.class));
    WellSqlConfig config = new TestWellSqlConfig(mRenamingTargetAppContext);
    WellSql.init(config);
    config.reset();
    super.setUp();
}
Also used : RenamingDelegatingContext(android.test.RenamingDelegatingContext) SiteStore(org.wordpress.android.fluxc.store.SiteStore) TestWellSqlConfig(org.wordpress.android.TestWellSqlConfig) Dispatcher(org.wordpress.android.fluxc.Dispatcher) TestWellSqlConfig(org.wordpress.android.TestWellSqlConfig) WellSqlConfig(org.wordpress.android.fluxc.persistence.WellSqlConfig)

Example 19 with RenamingDelegatingContext

use of android.test.RenamingDelegatingContext in project android_frameworks_base by crdroidandroid.

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());
}
Also used : RenamingDelegatingContext(android.test.RenamingDelegatingContext) ComponentName(android.content.ComponentName)

Example 20 with RenamingDelegatingContext

use of android.test.RenamingDelegatingContext in project android-jigsaw-puzzle by julesbond007.

the class JigsawDBTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    RenamingDelegatingContext context = new RenamingDelegatingContext(getContext(), "test_");
    db = new JigsawDB(context);
}
Also used : RenamingDelegatingContext(android.test.RenamingDelegatingContext)

Aggregations

RenamingDelegatingContext (android.test.RenamingDelegatingContext)22 ComponentName (android.content.ComponentName)4 Intent (android.content.Intent)4 Context (android.content.Context)3 IsolatedContext (android.test.IsolatedContext)2 MockContentResolver (android.test.mock.MockContentResolver)2 MockContext (android.test.mock.MockContext)2 GregorianCalendar (java.util.GregorianCalendar)2 MeetingDAO (net.johnpwood.android.standuptimer.dao.MeetingDAO)2 TeamDAO (net.johnpwood.android.standuptimer.dao.TeamDAO)2 Meeting (net.johnpwood.android.standuptimer.model.Meeting)2 Team (net.johnpwood.android.standuptimer.model.Team)2 ContentProvider (android.content.ContentProvider)1 ImageDaoImpl (com.jigdraw.draw.dao.impl.ImageDaoImpl)1 LongParcelable (com.jigdraw.draw.model.LongParcelable)1 JigsawServiceImpl (com.jigdraw.draw.service.impl.JigsawServiceImpl)1 TestWellSqlConfig (org.wordpress.android.TestWellSqlConfig)1 Dispatcher (org.wordpress.android.fluxc.Dispatcher)1 WellSqlConfig (org.wordpress.android.fluxc.persistence.WellSqlConfig)1 SiteStore (org.wordpress.android.fluxc.store.SiteStore)1