|
|
|
@ -35,6 +35,7 @@ public class GtasksSyncOnSaveTest extends DatabaseTestCase {
|
|
|
|
|
|
|
|
|
|
private GtasksService gtasksService;
|
|
|
|
|
private boolean initialized = false;
|
|
|
|
|
private boolean bypassTests = false;
|
|
|
|
|
private static final String TEST_ACCOUNT = "sync_tester2@astrid.com";
|
|
|
|
|
private static String DEFAULT_LIST = "@default";
|
|
|
|
|
|
|
|
|
@ -73,6 +74,7 @@ public class GtasksSyncOnSaveTest extends DatabaseTestCase {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void testSyncOnTitleUpdate() throws IOException {
|
|
|
|
|
if(bypassTests) return;
|
|
|
|
|
Task localTask = performBasicCreation("-title will change");
|
|
|
|
|
|
|
|
|
|
String newTitle = "Title has changed!";
|
|
|
|
@ -86,6 +88,7 @@ public class GtasksSyncOnSaveTest extends DatabaseTestCase {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void testSyncOnDueDateUpdate() throws IOException {
|
|
|
|
|
if(bypassTests) return;
|
|
|
|
|
Task localTask = performBasicCreation("-due date will change");
|
|
|
|
|
|
|
|
|
|
long dueDate = new Date(115, 2, 14).getTime();
|
|
|
|
@ -99,6 +102,7 @@ public class GtasksSyncOnSaveTest extends DatabaseTestCase {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void testSyncOnNotesUpdate() throws IOException {
|
|
|
|
|
if(bypassTests) return;
|
|
|
|
|
Task localTask = performBasicCreation("-notes will change");
|
|
|
|
|
|
|
|
|
|
String notes = "Noted!";
|
|
|
|
@ -112,6 +116,7 @@ public class GtasksSyncOnSaveTest extends DatabaseTestCase {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void testSyncOnCompleted() throws IOException {
|
|
|
|
|
if(bypassTests) return;
|
|
|
|
|
Task localTask = performBasicCreation("-will be completed");
|
|
|
|
|
|
|
|
|
|
long completionDate = DateUtilities.now();
|
|
|
|
@ -126,6 +131,7 @@ public class GtasksSyncOnSaveTest extends DatabaseTestCase {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void testSyncOnDeleted() throws IOException {
|
|
|
|
|
if(bypassTests) return;
|
|
|
|
|
Task localTask = performBasicCreation("-will be deleted");
|
|
|
|
|
|
|
|
|
|
long deletionDate = DateUtilities.now();
|
|
|
|
@ -176,6 +182,10 @@ public class GtasksSyncOnSaveTest extends DatabaseTestCase {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (toUse == null) {
|
|
|
|
|
if(accounts.length == 0) {
|
|
|
|
|
bypassTests = true;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
toUse = accounts[0];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|