Search in sources :

Example 21 with Flag

use of com.vodafone360.people.datatypes.ActivityItem.Flag in project 360-Engine-for-Android by 360.

the class NowPlusStateTableTest method testMeProfileChangeFlag.

/*
     * modify and fetch Me profile change flag
     */
public void testMeProfileChangeFlag() {
    final String fnName = "testMeProfileChangeFlag";
    mTestStep = 1;
    Log.i(LOG_TAG, "***** EXECUTING " + fnName + "*****");
    Log.i(LOG_TAG, "modify and fetching change flag");
    SQLiteDatabase writableDb = mTestDatabase.getWritableDatabase();
    SQLiteDatabase readableDb = mTestDatabase.getReadableDatabase();
    boolean myContactChanged = TestModule.generateRandomBoolean();
    ServiceStatus status = StateTable.modifyMeProfileChangedFlag(myContactChanged, writableDb);
    assertEquals(ServiceStatus.ERROR_DATABASE_CORRUPT, status);
    boolean fetchMeProfileChangedFlag = StateTable.fetchMeProfileChangedFlag(readableDb);
    assertFalse(fetchMeProfileChangedFlag);
    createTable();
    fetchMeProfileChangedFlag = StateTable.fetchMeProfileChangedFlag(readableDb);
    assertFalse(fetchMeProfileChangedFlag);
    status = StateTable.modifyMeProfileChangedFlag(myContactChanged, writableDb);
    assertEquals(ServiceStatus.SUCCESS, status);
    fetchMeProfileChangedFlag = StateTable.fetchMeProfileChangedFlag(readableDb);
    assertEquals(myContactChanged, fetchMeProfileChangedFlag);
    Log.i(LOG_TAG, "*************************************");
    Log.i(LOG_TAG, "modify and fetching MeProfile change flag  has completed successfully");
    Log.i(LOG_TAG, "**************************************");
}
Also used : SQLiteDatabase(android.database.sqlite.SQLiteDatabase) ServiceStatus(com.vodafone360.people.service.ServiceStatus)

Aggregations

ServiceStatus (com.vodafone360.people.service.ServiceStatus)9 ArrayList (java.util.ArrayList)6 PersistSettings (com.vodafone360.people.service.PersistSettings)5 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)4 ActivityItem (com.vodafone360.people.datatypes.ActivityItem)3 ContactDetail (com.vodafone360.people.datatypes.ContactDetail)3 ContactChange (com.vodafone360.people.engine.contactsync.ContactChange)3 SQLiteStatement (android.database.sqlite.SQLiteStatement)2 ContactIdInfo (com.vodafone360.people.database.tables.ContactsTable.ContactIdInfo)2 Flag (com.vodafone360.people.datatypes.ActivityItem.Flag)2 Visibility (com.vodafone360.people.datatypes.ActivityItem.Visibility)2 PeopleContactsApi (com.vodafone360.people.engine.contactsync.PeopleContactsApi)2 SQLException (android.database.SQLException)1 ServerIdInfo (com.vodafone360.people.database.DatabaseHelper.ServerIdInfo)1 NativeContactsApi (com.vodafone360.people.engine.contactsync.NativeContactsApi)1 DecoderThread (com.vodafone360.people.service.transport.DecoderThread)1 HttpConnectionThread (com.vodafone360.people.service.transport.http.HttpConnectionThread)1