Package org.eclipse.orion.server.core.tasks

Examples of org.eclipse.orion.server.core.tasks.TaskInfo.done()


  /**
   * Helper method for creating a sample task for testing purposes.
   */
  public static TaskInfo createTestTask(String userId) {
    TaskInfo info = new TaskInfo(userId, "mytask", true);
    info.done(new Status(IStatus.ERROR, "pluginid", "status message"));
    return info;
  }

  public static void assertEqualTasks(TaskInfo expected, TaskInfo actual) {
    assertEquals(expected.getUserId(), actual.getUserId());
View Full Code Here


  }

  @Test
  public void testDeleteTask() {
    TaskInfo task = AllTaskTests.createTestTask("test");
    task.done(Status.OK_STATUS);
    TaskStore store = new TaskStore(tempDir);
    store.writeTask(new TaskDescription(task.getUserId(), task.getId(), true), task.toJSON().toString());
    assertNotNull(store.readTask(new TaskDescription(task.getUserId(), task.getId(), true)));
    assertTrue(store.removeTask(new TaskDescription(task.getUserId(), task.getId(), true)));
    assertNull(store.readTask(new TaskDescription(task.getUserId(), task.getId(), true)));
View Full Code Here

  }

  @Test
  public void readAllTasksTest() {
    TaskInfo task1 = new TaskInfo("test", "taskid1", true);
    task1.done(Status.OK_STATUS);
    TaskInfo task2 = new TaskInfo("test", "taskid2", true);
    task2.done(Status.OK_STATUS);
    TaskStore store = new TaskStore(tempDir);
    store.writeTask(new TaskDescription("test", task1.getId(), true), task1.toJSON().toString());
    assertEquals(1, store.readAllTasks("test"));
View Full Code Here

  @Test
  public void readAllTasksTest() {
    TaskInfo task1 = new TaskInfo("test", "taskid1", true);
    task1.done(Status.OK_STATUS);
    TaskInfo task2 = new TaskInfo("test", "taskid2", true);
    task2.done(Status.OK_STATUS);
    TaskStore store = new TaskStore(tempDir);
    store.writeTask(new TaskDescription("test", task1.getId(), true), task1.toJSON().toString());
    assertEquals(1, store.readAllTasks("test"));
    store.writeTask(new TaskDescription("test", task2.getId(), true), task2.toJSON().toString());
    assertEquals(2, store.readAllTasks("test"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.