use of nl.tudelft.watchdog.core.logic.storage.WatchDogItem in project watchdog by TestRoots.
the class IntervalPersisterTestSingleInterval method test1WriteInterval.
@Test
public void test1WriteInterval() {
interval = IntervalPersisterTest.createRandomInterval();
interval.close();
persister.save(interval);
WatchDogItem savedItem = new ArrayList<>(persister.readItems()).get(0);
assertTrue(savedItem instanceof IntervalBase);
IntervalBase savedInterval = (IntervalBase) savedItem;
assertEquals(interval.getType(), savedInterval.getType());
assertEquals(interval.getStart(), savedInterval.getStart());
assertEquals(interval.getEnd(), savedInterval.getEnd());
assertEquals(interval.getDuration(), savedInterval.getDuration());
assertEquals(interval.isClosed(), savedInterval.isClosed());
}
use of nl.tudelft.watchdog.core.logic.storage.WatchDogItem in project watchdog by TestRoots.
the class IntervalPersisterTestSingleInterval method test2CompareIntervalAfterWrite.
@Test
public void test2CompareIntervalAfterWrite() {
WatchDogItem savedItem = new ArrayList<>(persister.readItems()).get(0);
assertTrue(savedItem instanceof IntervalBase);
IntervalBase savedInterval = (IntervalBase) savedItem;
assertEquals(interval.getType(), savedInterval.getType());
assertEquals(interval.getStart(), savedInterval.getStart());
assertEquals(interval.getEnd(), savedInterval.getEnd());
}
use of nl.tudelft.watchdog.core.logic.storage.WatchDogItem in project watchdog by TestRoots.
the class EventJsonConverterTest method testJsonMethodBreakpointAddEventRepresentation.
@Test
public void testJsonMethodBreakpointAddEventRepresentation() {
BreakpointAddEvent event = new BreakpointAddEvent(1, BreakpointType.METHOD, new Date());
ArrayList<WatchDogItem> events = createSampleEvents(event);
assertEquals("[{\"bh\":1,\"bt\":\"me\",\"et\":\"ba\",\"ts\":1,\"ss\":\"\"," + pasteWDVAndClient() + "}]", transferer.toJson(events));
}
use of nl.tudelft.watchdog.core.logic.storage.WatchDogItem in project watchdog by TestRoots.
the class EventJsonConverterTest method testJsonSuspendBreakpointEvent.
@Test
public void testJsonSuspendBreakpointEvent() {
DebugEventBase event = new DebugEventBase(TrackingEventType.SUSPEND_BREAKPOINT, new Date());
ArrayList<WatchDogItem> events = createSampleEvents(event);
assertEquals("[{\"et\":\"sb\",\"ts\":1,\"ss\":\"\"," + pasteWDVAndClient() + "}]", transferer.toJson(events));
}
use of nl.tudelft.watchdog.core.logic.storage.WatchDogItem in project watchdog by TestRoots.
the class EventJsonConverterTest method testJsonExceptionBreakpointAddEventRepresentation.
@Test
public void testJsonExceptionBreakpointAddEventRepresentation() {
BreakpointAddEvent event = new BreakpointAddEvent(1, BreakpointType.EXCEPTION, new Date());
ArrayList<WatchDogItem> events = createSampleEvents(event);
assertEquals("[{\"bh\":1,\"bt\":\"ex\",\"et\":\"ba\",\"ts\":1,\"ss\":\"\"," + pasteWDVAndClient() + "}]", transferer.toJson(events));
}
Aggregations