Example usage for android.test RenamingDelegatingContext RenamingDelegatingContext

List of usage examples for android.test RenamingDelegatingContext RenamingDelegatingContext

Introduction

In this page you can find the example usage for android.test RenamingDelegatingContext RenamingDelegatingContext.

Prototype

public RenamingDelegatingContext(Context context, String filePrefix) 

Source Link

Usage

From source file:com.cuddlesoft.nori.test.database.APISettingsDatabaseTest.java

@Override
protected void setUp() throws Exception {
    context = new RenamingDelegatingContext(getInstrumentation().getTargetContext(), "_test");
}

From source file:org.ado.minesync.MineSyncDbOpenHelperTest.java

public void setUp() throws Exception {
    context = new RenamingDelegatingContext(getContext(), "test_");
    database = SQLiteDatabase.openOrCreateDatabase(getDatabasePath().getPath(), null);
    unitUnderTest = MineSyncDbOpenHelper.getInstance(context);
}

From source file:org.jboss.aerogear.android.store.test.sql.SQLStoreTest.java

@Override
public void setUp() throws Exception {
    super.setUp();
    this.context = new RenamingDelegatingContext(getActivity(), UUID.randomUUID().toString());

    this.store = (SQLStore) DataManager.config("store", SQLStoreConfiguration.class).forClass(Data.class)
            .withContext(context).store();

    this.nestedStore = (SQLStore) DataManager.config("trivialNestedClass", SQLStoreConfiguration.class)
            .forClass(TrivialNestedClass.class).withContext(context).store();

    this.nestedWithCollectionStore = (SQLStore) DataManager
            .config("trivialNestedClassWithCollection", SQLStoreConfiguration.class)
            .forClass(TrivialNestedClassWithCollection.class).withContext(context).store();
}

From source file:com.google.android.apps.authenticator.testability.DependencyInjector.java

/**
 * Clears any state and configures this injector to provide objects that are suitable for
 * integration testing./* w  w  w  .j  a v a2s  . co m*/
 */
// @VisibleForTesting
public static synchronized void resetForIntegrationTesting(Context context) {
    if (context == null) {
        throw new NullPointerException("context == null");
    }

    close();

    sMode = Mode.INTEGRATION_TEST;
    RenamingDelegatingContext renamingContext = new RenamingDelegatingContext(context, "test_");
    renamingContext.makeExistingFilesAndDbsAccessible();
    sContext = new SharedPreferencesRenamingDelegatingContext(renamingContext, "test_");
    PreferenceManager.getDefaultSharedPreferences(sContext).edit().clear().commit();
}