コード例 #1
0
 private Task searchTask(String taskListId, String title) throws GoogleSyncException {
   List<Task> listOftask = apiManager.getTasks(taskListId);
   for (Task task : listOftask) {
     if (task.getTitle().equals(title)) {
       return task;
     }
   }
   return null;
 }
コード例 #2
0
 private TaskList searchTaskList(String title) throws GoogleSyncException {
   List<TaskList> listOftaskList = apiManager.getTaskLists();
   for (TaskList taskList : listOftaskList) {
     if (taskList.getTitle().equals(title)) {
       return taskList;
     }
   }
   return null;
 }
コード例 #3
0
 public void test_101_AddTasklistForSync()
     throws InterruptedException, ExecutionException, TimeoutException {
   try {
     TaskList taskList = apiManager.insertTaskList(NEW_TASKLIST_NAME);
     syncManager.execute();
     syncManager.get(1000, TimeUnit.DAYS);
     LocalTaskList localTaskList = dbHandler.getTaskListByGoogleId(taskList.getId());
     assertNotNull(localTaskList);
   } catch (GoogleSyncException e) {
     fail("No remote connection.");
   }
 }
コード例 #4
0
 public void test_991_DeleteTaskList()
     throws InterruptedException, ExecutionException, TimeoutException {
   try {
     TaskList taskList = searchTaskList(UPD_TASKLIST_NAME);
     assertNotNull(taskList);
     LocalTaskList localTaskList = dbHandler.getTaskListByGoogleId(taskList.getId());
     dbHandler.deleteTaskListFinal(localTaskList.getInternalId());
     apiManager.deleteTaskList(taskList.getId());
   } catch (GoogleSyncException e) {
     fail("No remote connection.");
   }
 }
コード例 #5
0
 public void test_102_UpdateTaskListForSync()
     throws InterruptedException, ExecutionException, TimeoutException {
   try {
     TaskList taskList = searchTaskList(NEW_TASKLIST_NAME);
     assertNotNull(taskList);
     taskList.setTitle(UPD_TASKLIST_NAME);
     taskList = apiManager.updateTaskList(taskList.getId(), taskList);
     syncManager.execute();
     syncManager.get(1000, TimeUnit.DAYS);
     LocalTaskList localTaskList = dbHandler.getTaskListByGoogleId(taskList.getId());
     assertEquals(localTaskList.getTitle(), taskList.getTitle());
   } catch (GoogleSyncException e) {
     fail("No remote connection.");
   }
 }
コード例 #6
0
 public void test_201_AddTaskForSync()
     throws InterruptedException, ExecutionException, TimeoutException {
   try {
     TaskList taskList = searchTaskList(UPD_TASKLIST_NAME);
     assertNotNull(taskList);
     Task task = new Task();
     task.setTitle(NEW_TASK_NAME);
     task = apiManager.insertTask(taskList.getId(), task);
     syncManager.execute();
     syncManager.get(1000, TimeUnit.DAYS);
     LocalTask localTask = dbHandler.getTaskByGoogleId(task.getId());
     assertNotNull(localTask);
   } catch (GoogleSyncException e) {
     fail("No remote connection.");
   }
 }