Search in sources :

Example 21 with MainApplication

use of com.vodafone360.people.MainApplication 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 22 with MainApplication

use of com.vodafone360.people.MainApplication in project 360-Engine-for-Android by 360.

the class SyncMeEngineTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    // delete the database
    getInstrumentation().getTargetContext().deleteDatabase(HelperClasses.getDatabaseName());
    // create an application instance
    mApplication = (MainApplication) Instrumentation.newApplication(MainApplication.class, getInstrumentation().getTargetContext());
    mApplication.onCreate();
    mEngineTester = new EngineTestFramework(this);
    mEngine = new SyncMeEngine(getInstrumentation().getTargetContext(), mEngineTester, mApplication.getDatabase());
    mEngineTester.setEngine(mEngine);
    Log.i(LOG_TAG, "**** setUp() end ****");
}
Also used : SyncMeEngine(com.vodafone360.people.engine.meprofile.SyncMeEngine)

Example 23 with MainApplication

use of com.vodafone360.people.MainApplication in project 360-Engine-for-Android by 360.

the class ActivitiesEngineTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mApplication = (MainApplication) Instrumentation.newApplication(MainApplication.class, getInstrumentation().getTargetContext());
    mApplication.onCreate();
    // EngineManager.createEngineManager(getInstrumentation().getTargetContext(),
    // null);
    mEngineTester = new EngineTestFramework(this);
    mEng = new ActivitiesEngine(getInstrumentation().getTargetContext(), mEngineTester, mApplication.getDatabase());
    mEngineTester.setEngine(mEng);
    mState = ActivityTestState.IDLE;
}
Also used : ActivitiesEngine(com.vodafone360.people.engine.activities.ActivitiesEngine)

Example 24 with MainApplication

use of com.vodafone360.people.MainApplication in project 360-Engine-for-Android by 360.

the class IdentityEngineTest 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 IdentityEngine(mEngineTester, mApplication.getDatabase());
    mEngineTester.setEngine(mEng);
    mState = IdentityTestState.IDLE;
}
Also used : IdentityEngine(com.vodafone360.people.engine.identities.IdentityEngine)

Aggregations

MainApplication (com.vodafone360.people.MainApplication)12 EngineTestFramework (com.vodafone360.people.tests.engine.EngineTestFramework)4 Intent (android.content.Intent)2 ActivitiesEngine (com.vodafone360.people.engine.activities.ActivitiesEngine)2 IdentityEngine (com.vodafone360.people.engine.identities.IdentityEngine)2 LoginEngine (com.vodafone360.people.engine.login.LoginEngine)2 SyncMeEngine (com.vodafone360.people.engine.meprofile.SyncMeEngine)2 PresenceEngine (com.vodafone360.people.engine.presence.PresenceEngine)2 NetworkErrorException (android.accounts.NetworkErrorException)1 Instrumentation (android.app.Instrumentation)1 Cursor (android.database.Cursor)1 Uri (android.net.Uri)1 Bundle (android.os.Bundle)1 SmallTest (android.test.suitebuilder.annotation.SmallTest)1 Suppress (android.test.suitebuilder.annotation.Suppress)1 ContactSyncEngine (com.vodafone360.people.engine.contactsync.ContactSyncEngine)1 ContentEngine (com.vodafone360.people.engine.content.ContentEngine)1 GroupsEngine (com.vodafone360.people.engine.groups.GroupsEngine)1 Authenticator (com.vodafone360.people.service.Authenticator)1 RemoteService (com.vodafone360.people.service.RemoteService)1