use of nl.tudelft.watchdog.core.logic.interval.intervaltypes.UserActiveInterval in project watchdog by TestRoots.
the class IntervalComparisonTest method testComparisonEqualIntervalsDifferentObjectsDifferentType.
@Test
public void testComparisonEqualIntervalsDifferentObjectsDifferentType() {
Date start = new Date();
UserActiveInterval interval1 = new UserActiveInterval(start);
IDEOpenInterval interval2 = new IDEOpenInterval(start);
interval1.close();
interval2.close();
interval2.setEndTime(interval1.getEnd());
assertEquals(1, interval1.compareTo(interval2));
assertEquals(-1, interval2.compareTo(interval1));
}
use of nl.tudelft.watchdog.core.logic.interval.intervaltypes.UserActiveInterval in project watchdog by TestRoots.
the class IntervalComparisonTest method testComparisonTwoDifferentIntervalsDifferentType.
@Test
public void testComparisonTwoDifferentIntervalsDifferentType() {
UserActiveInterval interval1 = new UserActiveInterval(new Date(1));
IDEOpenInterval interval2 = new IDEOpenInterval(new Date(2));
interval1.close();
interval1.setEndTime(new Date(2));
interval2.close();
interval2.setEndTime(new Date(3));
assertEquals(-1, interval1.compareTo(interval2));
assertEquals(1, interval2.compareTo(interval1));
}
use of nl.tudelft.watchdog.core.logic.interval.intervaltypes.UserActiveInterval in project watchdog by TestRoots.
the class IntervalComparisonTest method testComparisonEqualIntervalsDifferentObjectsSameType.
@Test
public void testComparisonEqualIntervalsDifferentObjectsSameType() {
Date start = new Date();
UserActiveInterval interval1 = new UserActiveInterval(start);
UserActiveInterval interval2 = new UserActiveInterval(start);
Date end = new Date();
interval1.close();
interval1.setEndTime(end);
interval2.close();
interval2.setEndTime(end);
assertEquals(0, interval1.compareTo(interval2));
}
use of nl.tudelft.watchdog.core.logic.interval.intervaltypes.UserActiveInterval in project watchdog by TestRoots.
the class IntervalComparisonTest method testComparisonTwoDifferentIntervalsSameType.
@Test
public void testComparisonTwoDifferentIntervalsSameType() {
UserActiveInterval interval1 = new UserActiveInterval(new Date(1));
UserActiveInterval interval2 = new UserActiveInterval(new Date(2));
interval1.close();
interval1.setEndTime(new Date(2));
interval2.close();
interval2.setEndTime(new Date(3));
assertEquals(-1, interval1.compareTo(interval2));
assertEquals(1, interval2.compareTo(interval1));
}
use of nl.tudelft.watchdog.core.logic.interval.intervaltypes.UserActiveInterval in project watchdog by TestRoots.
the class IntervalComparisonTest method testComparisonEqualIntervalsDifferentObjectsDifferentStart.
@Test
public void testComparisonEqualIntervalsDifferentObjectsDifferentStart() {
UserActiveInterval interval1 = new UserActiveInterval(new Date(1));
UserActiveInterval interval2 = new UserActiveInterval(new Date(2));
interval1.close();
interval2.close();
interval2.setEndTime(interval1.getEnd());
assertEquals(-1, interval1.compareTo(interval2));
assertEquals(1, interval2.compareTo(interval1));
}
Aggregations