use of nl.tudelft.watchdog.core.logic.storage.WatchDogItem in project watchdog by TestRoots.
the class EventJsonConverterTest method testJsonStepOverEvent.
@Test
public void testJsonStepOverEvent() {
DebugEventBase event = new DebugEventBase(TrackingEventType.STEP_OVER, new Date());
ArrayList<WatchDogItem> events = createSampleEvents(event);
assertEquals("[{\"et\":\"so\",\"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 testJsonLineBreakpointChangeEventTwoChanges.
@Test
public void testJsonLineBreakpointChangeEventTwoChanges() {
List<BreakpointChangeType> changes = new ArrayList<>();
changes.add(BreakpointChangeType.ENABLED);
changes.add(BreakpointChangeType.HC_ADDED);
BreakpointChangeEvent event = new BreakpointChangeEvent(1, BreakpointType.LINE, changes, new Date());
ArrayList<WatchDogItem> events = createSampleEvents(event);
assertEquals("[{\"ch\":[\"en\",\"ha\"],\"bh\":1,\"bt\":\"li\",\"et\":\"bc\",\"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 testJsonResumeClientEvent.
@Test
public void testJsonResumeClientEvent() {
DebugEventBase event = new DebugEventBase(TrackingEventType.RESUME_CLIENT, new Date());
ArrayList<WatchDogItem> events = createSampleEvents(event);
assertEquals("[{\"et\":\"rc\",\"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 createSampleEvents.
private ArrayList<WatchDogItem> createSampleEvents(EventBase event) {
ArrayList<WatchDogItem> events = new ArrayList<WatchDogItem>();
event.setTimestamp(new Date(1));
event.setSessionSeed("");
events.add(event);
return events;
}
use of nl.tudelft.watchdog.core.logic.storage.WatchDogItem in project watchdog by TestRoots.
the class EventPersisterTest method testInteraction.
private void testInteraction(int items) {
List<EventBase> generatedEvents = generateEventList(items);
// Shuffle the generated events to test for
// correct ordering of returned values
Collections.shuffle(generatedEvents);
Collections.sort(generatedEvents);
for (EventBase event : generatedEvents) {
persister.save(event);
}
List<WatchDogItem> readEvents = new ArrayList<WatchDogItem>(persister.readItems());
assertEquals(readEvents.size(), items);
// Test order of returned results
assertEquals(readEvents, generatedEvents);
}
Aggregations