Package org.eclipse.mylyn.tasks.core

Examples of org.eclipse.mylyn.tasks.core.ITask


        case DATE:
          segments.add(data.get(ITaskData.DATE));
          break;
        case TASK:
          TaskId id = data.get(ITaskData.TASK_ID);
          ITask task = repository.getTask(id.getHandleIdentifier());
          if (task == null
              || !Objects.equal(id.getCreationDate(), TasksContract.getCreationDate(task))) {
            task = new UnrecognizedTask(id);
          }
          segments.add(task);
View Full Code Here


    return DataHandler.getStorer(TaskFileEvent.class);
  }

  @Override
  protected TaskFileEvent tryCreateEvent(long start, long end, IWorkbenchPart part) {
    ITask task = TasksUi.getTaskActivityManager().getActiveTask();
    if (task == null) {
      return null;
    }
    if (part instanceof IEditorPart) {
      IEditorInput input = ((IEditorPart) part).getEditorInput();
View Full Code Here

    return new TaskFileEventConverter();
  }

  @Override
  public void testConvert() throws Exception {
    final ITask task = mock(ITask.class);
    given(task.getCreationDate()).willReturn(new Date());
    final TaskFileEvent event = new TaskFileEvent(
        new Interval(0, 1), new Path("/a/b"), task);
    final TaskFileEventType type = converter.convert(event);
   
    assertEquals(
        task.getHandleIdentifier(),
        type.getTaskId().getHandleId());
    assertEquals(
        task.getCreationDate(),
        type.getTaskId().getCreationDate().toGregorianCalendar().getTime());
    assertEquals(
        event.getInterval().toDurationMillis(),
        type.getDuration());
    assertEquals(
View Full Code Here

   */
  @Test
  public void aTaskWithoutCreationDateShouldBeAssignedWithNonNullDateFromTasksContract()
      throws Exception {
   
    final ITask task = mock(ITask.class);
    given(task.getCreationDate()).willReturn(null);
   
    final Date creationDate = TasksContract.getCreationDate(task);
    assertTrue(creationDate != null);
   
    final GregorianCalendar calendar = new GregorianCalendar();
View Full Code Here

public final class TasksContractTest {

  @Test
  public void getCreationDateReturnsDateCopies() throws Exception {
    final ITask task = mock(ITask.class);
    final Date date1 = TasksContract.getCreationDate(task);
    final Date date2 = TasksContract.getCreationDate(task);

    assertTrue(date1 != date2);
  }
View Full Code Here

  @Test
  public void getCreationDateShouldReturnTheEarliestDateIfTashHasNoCreationDate()
      throws Exception {

    final Date expectedDate = new Date(0);
    final ITask task = mock(ITask.class);
    given(task.getCreationDate()).willReturn(null);

    assertThat(TasksContract.getCreationDate(task), is(expectedDate));
  }
View Full Code Here

  @Test
  public void getCreationDateShouldReturnTheTaskCreationDateIfThereIsOne()
      throws Exception {

    final Date expectedDate = new Date();
    final ITask task = mock(ITask.class);
    given(task.getCreationDate()).willReturn(expectedDate);

    assertThat(TasksContract.getCreationDate(task), is(expectedDate));
  }
View Full Code Here

@SuppressWarnings("restriction")
public class TaskLabelProviderTest extends NullLabelProviderTest {
 
  @Test
  public void getImageShouldReturnAnImageForATask() {
    ITask task = mock(ITask.class);
    assertThat(provider.getImage(task), notNullValue());
  }
View Full Code Here

    assertThat(provider.getImage(task), notNullValue());
  }
 
  @Test
  public void getTextShouldReturnTheSummaryOfATask() {
    ITask task = mock(ITask.class);
    given(task.getSummary()).willReturn("a summary");
    assertThat(provider.getText(task), equalTo(task.getSummary()));
  }
View Full Code Here

  }

  @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

TOP

Related Classes of org.eclipse.mylyn.tasks.core.ITask

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.