Search in sources :

Example 1 with EngineTestFramework

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

the class LoginEngineTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mApplication = (MainApplication) Instrumentation.newApplication(MainApplication.class, getInstrumentation().getTargetContext());
    mApplication.onCreate();
    mEngineTester = new EngineTestFramework(this);
    mEng = new LoginEngine(getInstrumentation().getTargetContext(), mEngineTester, mApplication.getDatabase());
    mEngineTester.setEngine(mEng);
    mState = LoginTestState.IDLE;
    mEng.addListener(this);
}
Also used : LoginEngine(com.vodafone360.people.engine.login.LoginEngine)

Example 2 with EngineTestFramework

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

the class ContactSyncEngineTest method setUpContactSyncEngineTestFramework.

/**
 * Sets up the test framework.
 *
 * @param factory the factory used by the ContactSyncEngine
 * @param observer the test framework observer
 */
private void setUpContactSyncEngineTestFramework(IEngineTestFrameworkObserver observer, ProcessorFactory factory) {
    mEngineTester = new EngineTestFramework(observer);
    mContactSyncEngine = new ContactSyncEngine(mApplication.getApplicationContext(), mEngineTester, mApplication.getDatabase(), factory);
    mContactSyncEngine.onCreate();
    mEngineTester.setEngine(mContactSyncEngine);
}
Also used : EngineTestFramework(com.vodafone360.people.tests.engine.EngineTestFramework) ContactSyncEngine(com.vodafone360.people.engine.contactsync.ContactSyncEngine)

Example 3 with EngineTestFramework

use of com.vodafone360.people.tests.engine.EngineTestFramework 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 4 with EngineTestFramework

use of com.vodafone360.people.tests.engine.EngineTestFramework 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)

Example 5 with EngineTestFramework

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

the class PresenceEngineTest method setUp.

// private MainApplication mApplication = null;
// private PresenceTestState mState = PresenceTestState.IDLE;
@Override
protected void setUp() throws Exception {
    super.setUp();
    mEngineTester = new EngineTestFramework(this);
    mEng = new PresenceEngine(mEngineTester, null);
    // mApplication = (MainApplication)Instrumentation.newApplication(MainApplication.class, getInstrumentation().getTargetContext());
    mEngineTester.setEngine(mEng);
// mState = PresenceTestState.IDLE;
}
Also used : EngineTestFramework(com.vodafone360.people.tests.engine.EngineTestFramework) PresenceEngine(com.vodafone360.people.engine.presence.PresenceEngine)

Aggregations

EngineTestFramework (com.vodafone360.people.tests.engine.EngineTestFramework)5 Cursor (android.database.Cursor)1 Uri (android.net.Uri)1 ActivitiesEngine (com.vodafone360.people.engine.activities.ActivitiesEngine)1 ContactSyncEngine (com.vodafone360.people.engine.contactsync.ContactSyncEngine)1 IdentityEngine (com.vodafone360.people.engine.identities.IdentityEngine)1 LoginEngine (com.vodafone360.people.engine.login.LoginEngine)1 SyncMeEngine (com.vodafone360.people.engine.meprofile.SyncMeEngine)1 PresenceEngine (com.vodafone360.people.engine.presence.PresenceEngine)1 ServiceStatus (com.vodafone360.people.service.ServiceStatus)1 DummyContactSyncEngine (com.vodafone360.people.tests.engine.contactsync.DummyContactSyncEngine)1