Search in sources :

Example 1 with DummyContactSyncEngine

use of com.vodafone360.people.tests.engine.contactsync.DummyContactSyncEngine in project 360-Engine-for-Android by 360.

the class DownloadServerContactsTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mApplication = (MainApplication) Instrumentation.newApplication(MainApplication.class, getInstrumentation().getTargetContext());
    mApplication.onCreate();
    mDb = mApplication.getDatabase();
    mDb.removeUserData();
    mEngineTester = new EngineTestFramework(this);
    mEng = new DummyContactSyncEngine(mEngineTester);
    mProcessor = new DownloadServerContactProcessorTest(mEng, mApplication.getDatabase());
    mEng.setProcessor(mProcessor);
    mEngineTester.setEngine(mEng);
    mState = State.IDLE;
    NetworkAgent.setAgentState(NetworkAgent.AgentState.CONNECTED);
}
Also used : EngineTestFramework(com.vodafone360.people.tests.engine.EngineTestFramework)

Example 2 with DummyContactSyncEngine

use of com.vodafone360.people.tests.engine.contactsync.DummyContactSyncEngine in project 360-Engine-for-Android by 360.

the class UploadServerContactsTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mApplication = (MainApplication) Instrumentation.newApplication(MainApplication.class, getInstrumentation().getTargetContext());
    mApplication.onCreate();
    mDb = mApplication.getDatabase();
    mDb.removeUserData();
    mEngineTester = new EngineTestFramework(this);
    mEng = new DummyContactSyncEngine(mEngineTester);
    mProcessor = new UploadServerContactProcessorTest(mEng, mApplication.getDatabase());
    mEng.setProcessor(mProcessor);
    mEngineTester.setEngine(mEng);
    mState = State.IDLE;
    NetworkAgent.setAgentState(NetworkAgent.AgentState.CONNECTED);
    mBulkContactTest = false;
}
Also used : EngineTestFramework(com.vodafone360.people.tests.engine.EngineTestFramework)

Example 3 with DummyContactSyncEngine

use of com.vodafone360.people.tests.engine.contactsync.DummyContactSyncEngine in project 360-Engine-for-Android by 360.

the class FetchNativeContactsTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mApplication = (MainApplication) Instrumentation.newApplication(MainApplication.class, getInstrumentation().getTargetContext());
    mApplication.onCreate();
    mDb = mApplication.getDatabase();
    mDb.removeUserData();
    mCr = mApplication.getContentResolver();
    mEngineTester = new EngineTestFramework(this);
    mEng = new DummyContactSyncEngine(mEngineTester);
    mProcessor = new FetchNativeContactsProcessorTest(mEng, mApplication.getDatabase(), mApplication, mCr);
    mEng.setProcessor(mProcessor);
    mEngineTester.setEngine(mEng);
    try {
        mCr.delete(People.CONTENT_URI, null, null);
    } catch (IllegalArgumentException e) {
        Cursor c = mCr.query(People.CONTENT_URI, new String[] { People._ID }, null, null, null);
        while (c.moveToNext()) {
            Uri uri = ContentUris.withAppendedId(Contacts.People.CONTENT_URI, c.getInt(0));
            mCr.delete(uri, null, null);
        }
        c.close();
    }
}
Also used : EngineTestFramework(com.vodafone360.people.tests.engine.EngineTestFramework) DummyContactSyncEngine(com.vodafone360.people.tests.engine.contactsync.DummyContactSyncEngine) Cursor(android.database.Cursor) Uri(android.net.Uri)

Aggregations

EngineTestFramework (com.vodafone360.people.tests.engine.EngineTestFramework)3 Cursor (android.database.Cursor)1 Uri (android.net.Uri)1 DummyContactSyncEngine (com.vodafone360.people.tests.engine.contactsync.DummyContactSyncEngine)1