SyncStorageEngineTest.javaAPI DocAndroid 1.5 API2246Wed May 06 22:42:02 BST 2009android.content


public class SyncStorageEngineTest extends android.test.AndroidTestCase

Fields Summary
Constructors Summary
Methods Summary
public voidtestPurgeActiveSync()
Test that we handle the case of a history row being old enough to purge before the correcponding sync is finished. This can happen if the clock changes while we are syncing.

        final String account = "";
        final String authority = "testprovider";

        MockContentResolver mockResolver = new MockContentResolver();

        SyncStorageEngine engine = SyncStorageEngine.newTestInstance(
                new TestContext(mockResolver, getContext()));

        long time0 = 1000;
        long historyId = engine.insertStartSyncEvent(
                account, authority, time0, Sync.History.SOURCE_LOCAL);
        long time1 = time0 + SyncStorageEngine.MILLIS_IN_4WEEKS * 2;
        engine.stopSyncEvent(historyId, time1 - time0, "yay", 0, 0);