Search in sources :

Example 6 with RenamingDelegatingContext

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

the class WordPressDBTest method setUp.

@Override
protected void setUp() {
    // Run tests in an isolated context
    targetContext = new RenamingDelegatingContext(getInstrumentation().getTargetContext(), "test_");
    testContext = getInstrumentation().getContext();
}
Also used : RenamingDelegatingContext(android.test.RenamingDelegatingContext)

Example 7 with RenamingDelegatingContext

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

the class JigsawActivityTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    RenamingDelegatingContext context = new RenamingDelegatingContext(this.getInstrumentation().getTargetContext().getApplicationContext(), "test_");
    setActivityIntent(new Intent(context, JigsawActivity.class).putExtra("originalId", new LongParcelable(1L)));
    activity = getActivity();
}
Also used : RenamingDelegatingContext(android.test.RenamingDelegatingContext) LongParcelable(com.jigdraw.draw.model.LongParcelable) Intent(android.content.Intent)

Example 8 with RenamingDelegatingContext

use of android.test.RenamingDelegatingContext in project standup-timer by jwood.

the class MeetingTest method setUp.

@Override
protected void setUp() {
    daoFactory.setGlobalContext(new RenamingDelegatingContext(mContext, "test_"));
    daoFactory.setCacheDAOInstances(true);
    dao = daoFactory.getMeetingDAO(mContext);
}
Also used : RenamingDelegatingContext(android.test.RenamingDelegatingContext)

Example 9 with RenamingDelegatingContext

use of android.test.RenamingDelegatingContext in project standup-timer by jwood.

the class TeamDetailsTest method setUpWithoutTestData.

private void setUpWithoutTestData() {
    Intent intent = new Intent();
    intent.putExtra("teamName", "Test Team");
    setActivityIntent(intent);
    a = getActivity();
    daoFactory.setGlobalContext(new RenamingDelegatingContext(a, "test_"));
    teamDao = daoFactory.getTeamDAO(a);
    meetingDao = daoFactory.getMeetingDAO(a);
}
Also used : RenamingDelegatingContext(android.test.RenamingDelegatingContext) Intent(android.content.Intent)

Example 10 with RenamingDelegatingContext

use of android.test.RenamingDelegatingContext in project standup-timer by jwood.

the class TeamDetailsTest 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, 1, 5, 10, 15, 0).getTime(), 5, 301, 343, 30, 65));
    meetingFixturesDao.save(new Meeting(team, new GregorianCalendar(2010, 1, 6, 10, 17, 0).getTime(), 8, 534, 550, 32, 120));
    meetingFixturesDao.save(new Meeting(team, new GregorianCalendar(2010, 1, 7, 10, 16, 0).getTime(), 2, 234, 300, 23, 122));
    meetingFixturesDao.save(new Meeting(team, new GregorianCalendar(2010, 1, 8, 10, 14, 0).getTime(), 3, 765, 765, 15, 78));
    meetingFixturesDao.save(new Meeting(team, new GregorianCalendar(2010, 1, 9, 10, 12, 0).getTime(), 9, 444, 445, 10, 93));
}
Also used : Context(android.content.Context) RenamingDelegatingContext(android.test.RenamingDelegatingContext) RenamingDelegatingContext(android.test.RenamingDelegatingContext) Meeting(net.johnpwood.android.standuptimer.model.Meeting) GregorianCalendar(java.util.GregorianCalendar) Team(net.johnpwood.android.standuptimer.model.Team) TeamDAO(net.johnpwood.android.standuptimer.dao.TeamDAO) MeetingDAO(net.johnpwood.android.standuptimer.dao.MeetingDAO)

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