Package org.joda.time

Examples of org.joda.time.Duration


  }

  @Override
  protected ITaskData createDataNode(LocalDate date, WorkspaceStorage ws,
      TaskFileEventType t) throws Exception {
    Duration duration = new Duration(t.getDuration());
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IFile file = root.getFile(new Path(t.getFilePath()));

    String handleId = t.getTaskId().getHandleId();
    Calendar createDate = t.getTaskId().getCreationDate().toGregorianCalendar();
View Full Code Here


  }

  @Override
  protected IPerspectiveData createDataNode(LocalDate date,
      WorkspaceStorage ws, PerspectiveEventType t) throws Exception {
    Duration duration = new Duration(t.getDuration());
    return new PerspectiveData(date, ws, duration, t.getPerspectiveId());
  }
View Full Code Here

  }

  @Override
  protected ISessionData createDataNode(LocalDate cal, WorkspaceStorage ws,
      SessionEventType type) throws Exception {
    return new SessionData(cal, ws, new Duration(type.getDuration()));
  }
View Full Code Here

  }

  @Override
  protected ILaunchData createDataNode(LocalDate date, WorkspaceStorage ws,
      LaunchEventType type) throws Exception {
    Duration duration = new Duration(type.getTotalDuration());
    LaunchConfigurationDescriptor config = new LaunchConfigurationDescriptor(
        type.getName(), type.getLaunchModeId(), type.getLaunchTypeId());
    Set<IFile> files = newHashSet();
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    for (String str : type.getFilePath()) {
View Full Code Here

    validTask = TasksUi.getRepositoryModel().createTask(repo, "testing");
    validTask.setCreationDate(new Date());

    root = ResourcesPlugin.getWorkspace().getRoot();
    fileHasParentFolder = root.getFile(new Path("/project/folder/file.txt"));
    duration = new Duration(100);
    date = new LocalDate().minusDays(1);
    ws = new WorkspaceStorage(new Path(".a"), new Path("/a"));

    data = mock(ITaskData.class);
    given(data.get(ITaskData.DATE)).willReturn(date);
View Full Code Here

  @Override
  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 = {
View Full Code Here

  IJavaData data;

  @Before
  public void setup() {
    duration = new Duration(1024);
    date = new LocalDate().minusDays(1);
    ws = new WorkspaceStorage(new Path(".a"), new Path("/a"));
    method = (IMethod) JavaCore.create(methodId);

    data = mock(IJavaData.class);
View Full Code Here

  public void shouldCorrectlyBuildMultiplePaths() {
    WorkspaceStorage ws2 = new WorkspaceStorage(new Path(".b"), null);
    LocalDate date2 = date.minusDays(2);
    IMethod method2 = (IMethod) JavaCore
        .create("=Proj2/src2<com.example2{My.java[My~getDefault");
    Duration duration2 = duration.minus(100);

    ICategory[] categories = {Category.WORKSPACE, Category.JAVA_TYPE_ROOT};
    List<TreePath> expected = asList(
        newPath(ws, method.getTypeRoot(), duration),
        newPath(ws2, method2.getTypeRoot(), duration2));
View Full Code Here

  @Test
  public void shouldReturnTheDate() {
    LocalDate date = new LocalDate();
    WorkspaceStorage ws = new WorkspaceStorage(new Path(""), new Path(""));
    Duration duration = new Duration(10);
    assertThat(create(date, ws, duration).get(ISessionData.DATE), is(date));
  }
View Full Code Here

 
  @Test
  public void shouldReturnTheDuration() {
    LocalDate date = new LocalDate();
    WorkspaceStorage ws = new WorkspaceStorage(new Path(""), new Path(""));
    Duration dur = new Duration(10);
    assertThat(create(date, ws, dur).get(ISessionData.DURATION), is(dur));
  }
View Full Code Here

TOP

Related Classes of org.joda.time.Duration

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.