Code example for IsolatedContext

0
    @Override 
    protected void setUp() throws Exception { 
        super.setUp(); 
        final String filenamePrefix = "test.";
        RenamingDelegatingContext targetContextWrapper = new RenamingDelegatingContext(new MockContext2(), getContext(), filenamePrefix);
        _openHelperContext = new IsolatedContext(new MockContentResolver(), targetContextWrapper);
        _openHelper = createSQLiteOpenHelper(_openHelperContext);
    } 
 
    @Override 
    protected void tearDown() throws Exception { 
        _openHelper.close();
        super.tearDown(); 
    } 
 
    /** 
     * @return Returns the actual SQLiteOpenHelper under test. 
     */ 
    public T getSQLiteOpenHelper() { 
        return _openHelper;
    }