Package rabbit.data.common

Examples of rabbit.data.common.TaskId


    new TaskId(null, new Date());
  }

  @Test(expected = IllegalArgumentException.class)
  public void testConstructor_whiteSpaceId() {
    new TaskId(" \t", new Date());
  }
View Full Code Here


  @Test
  public void testEquals() {
    String handleId = "n2u38fhcbcddf";
    Date creationDate = new Date();

    TaskId taskId1 = new TaskId(handleId, creationDate);
    TaskId taskId2 = new TaskId("rnvnh389fhvn", new Date());
    assertFalse(taskId1.equals(taskId2));

    taskId2 = new TaskId(handleId, new GregorianCalendar(1999, 1, 1).getTime());
    assertFalse(taskId1.equals(taskId2));

    taskId2 = new TaskId("nhe2834uhdfkj2938f", creationDate);
    assertFalse(taskId1.equals(taskId2));

    taskId2 = new TaskId(handleId, creationDate);
    assertTrue(taskId1.equals(taskId2));
  }
View Full Code Here

  }

  @Test
  public void testGetCreationDate() {
    Date creationDate = new Date();
    TaskId taskId = new TaskId("anId", creationDate);
    assertEquals(creationDate, taskId.getCreationDate());
  }
View Full Code Here

  }

  @Test
  public void testGetHandleIdentifier() {
    String handleId = "helloWorld";
    TaskId taskId = new TaskId(handleId, new Date());
    assertEquals(handleId, taskId.getHandleIdentifier());
  }
View Full Code Here

  }

  @Test
  public void testHashCode() {
    String handleId = "ncikuhiuhfcs.sfghjowe";
    TaskId taskId = new TaskId(handleId, new Date());
    assertEquals(handleId.hashCode(), taskId.hashCode());
  }
View Full Code Here

    given(data.get(ITaskData.DURATION)).willReturn(duration);
    given(data.get(ITaskData.FILE)).willReturn(fileHasParentFolder);
    given(data.get(ITaskData.WORKSPACE)).willReturn(ws);
    given(data.get(ITaskData.TASK_ID))
        .willReturn(
            new TaskId(validTask.getHandleIdentifier(), validTask
                .getCreationDate()));
  }
View Full Code Here

    /*
     * And data returns the earliest date, which means the original task has no
     * creation date:
     */
    given(data.get(ITaskData.TASK_ID)).willReturn(
        new TaskId(
                validTask.getHandleIdentifier(),
                TasksContract.getEarliestDate())); // <--

    final ICategory[] categories = {Category.TASK};
    final List<TreePath> expected = asList(newPath(validTask,
View Full Code Here

  public void shouldCorrectlyBuildMultiplePaths() {
    WorkspaceStorage ws2 = new WorkspaceStorage(new Path(".b"), null);
    LocalDate date2 = date.minusDays(2);
    Duration duration2 = duration.withMillis(10000);
    IFile fileHasNoParentFolder = root.getFile(new Path("/project/file.txt"));
    TaskId taskIdForInvalid = new TaskId(
        validTask.getHandleIdentifier(), new Date());

    ICategory[] categories = {
        Category.PROJECT,
        Category.FILE,
View Full Code Here

    assertThat(provider.getText(task), equalTo(task.getSummary()));
  }

  @Test
  public void getForegroundShouldReturnDarkGrayForAnUndefinedTask() {
    TaskId id = new TaskId("id", new Date());
    ITask task = new UnrecognizedTask(id);
    assertThat(provider.getForeground(task), equalTo(PlatformUI.getWorkbench()
        .getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY)));
  }
View Full Code Here

  private Duration duration;
  private WorkspaceStorage workspace;

  @Before
  public void prepare() {
    taskId = new TaskId("id", new Date());
    file = mock(IFile.class);
    date = new LocalDate();
    duration = new Duration(10);
    workspace = new WorkspaceStorage(new Path(""), new Path(""));
  }
View Full Code Here

TOP

Related Classes of rabbit.data.common.TaskId

Copyright © 2018 www.massapicom. 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.