Package org.joda.time

Examples of org.joda.time.Interval


        assertEquals(123L, m.getEndMillis());
        assertEquals(CopticChronology.getInstance(), m.getChronology());
    }

    public void testSetIntoInterval_Object2() throws Exception {
        Interval i = new Interval(0L, 123L, CopticChronology.getInstance());
        MutableInterval m = new MutableInterval(-1000L, 1000L, BuddhistChronology.getInstance());
        ReadableIntervalConverter.INSTANCE.setInto(m, i, GJChronology.getInstance());
        assertEquals(0L, m.getStartMillis());
        assertEquals(123L, m.getEndMillis());
        assertEquals(GJChronology.getInstance(), m.getChronology());
View Full Code Here


    }
  }

  @Override
  protected FileEvent createEvent() {
    return new FileEvent(new Interval(0, 1),
        Path.fromPortableString("/p/f/a.txt"));
  }
View Full Code Here

    detector.setRunning(false);
  }

  @Override
  protected SessionEvent createEvent() {
    return new SessionEvent(new Interval(10, 2000));
  }
View Full Code Here

    return new PerspectiveEventConverter();
  }

  @Override
  public void testConvert() throws Exception {
    PerspectiveEvent event = new PerspectiveEvent(new Interval(0, 1),
        getPerspective());
    PerspectiveEventType type = converter.convert(event);
    assertEquals(event.getInterval().toDurationMillis(), type.getDuration());
    assertEquals(event.getPerspective().getId(), type.getPerspectiveId());
  }
View Full Code Here

    given(launch.getLaunchMode()).willReturn("run1");
   
    Set<IPath> fileIds = new HashSet<IPath>();
    fileIds.add(new Path("/ab1c"));
    fileIds.add(new Path("/d1ef"));
    return new LaunchEvent(new Interval(dateTime, dateTime.plus(duration)),
        launch, config, type, fileIds);
  }
View Full Code Here

    ILaunch launch = mock(ILaunch.class);
    given(launch.getLaunchMode()).willReturn("run2");
   
    Set<IPath> fileIds = new HashSet<IPath>();
    fileIds.add(new Path("/1ab1c"));
    return new LaunchEvent(new Interval(dateTime, dateTime.plus(duration)),
        launch, config, type, fileIds);
  }
View Full Code Here

    return new SessionEventConverter();
  }

  @Override
  public void testConvert() throws Exception {
    SessionEvent event = new SessionEvent(new Interval(0, 1));
    SessionEventType type = converter.convert(event);
    assertEquals(event.getInterval().toDurationMillis(), type.getDuration());
   
    event = new SessionEvent(new Interval(0, 1));
    type = converter.convert(event);
    assertEquals(event.getInterval().toDurationMillis(), type.getDuration());
  }
View Full Code Here

  @Override
  protected PartEvent createEvent(DateTime dateTime) throws Exception {
    try {
      IViewPart view = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
          .getActivePage().showView("org.eclipse.ui.views.TaskList");
      return new PartEvent(new Interval(dateTime, dateTime.plus(1)), view);

    } catch (PartInitException e) {
      e.printStackTrace();
      return null;
    }
View Full Code Here

  @Override
  protected PartEvent createEventDiff(final DateTime time) throws Exception {
    try {
      IViewPart view = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
          .getActivePage().showView("org.eclipse.ui.navigator.ProjectExplorer");
      return new PartEvent(new Interval(time, time.plus(2)), view);

    } catch (PartInitException e) {
      e.printStackTrace();
      return null;
    }
View Full Code Here

    Set<IPath> filePaths = new HashSet<IPath>();
    filePaths.add(new Path("/abc"));
    filePaths.add(new Path("/def"));

    LaunchEvent event = new LaunchEvent(new Interval(time.getMillis(),
        time.getMillis() + duration), launch, config, configType, filePaths);
    LaunchEventType converted = converter.convert(event);

    assertThat(converted.getCount(), is(1));
    assertThat(converted.getTotalDuration(), equalTo(duration));
View Full Code Here

TOP

Related Classes of org.joda.time.Interval

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.