use of nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.DebugEventBase in project watchdog by TestRoots.
the class DebugEventListener method changeEvent.
@Override
public void changeEvent(@NotNull DebuggerContextImpl debuggerContext, DebuggerSession.Event event) {
switch(event) {
case ATTACHED:
firstPauseAfterStartOrResume = true;
break;
case PAUSE:
if (firstPauseAfterStartOrResume) {
trackingEventManager.addEvent(new DebugEventBase(TrackingEventType.SUSPEND_BREAKPOINT, new Date()));
firstPauseAfterStartOrResume = false;
}
break;
case RESUME:
trackingEventManager.addEvent(new DebugEventBase(TrackingEventType.RESUME_CLIENT, new Date()));
firstPauseAfterStartOrResume = true;
break;
}
}
use of nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.DebugEventBase in project watchdog by TestRoots.
the class TrackingEventManagerTest method testAddSuspendBreakpointEvent.
@Test
public void testAddSuspendBreakpointEvent() {
DebugEventBase eventReal = new DebugEventBase(TrackingEventType.SUSPEND_BREAKPOINT, new Date());
DebugEventBase event = Mockito.spy(eventReal);
trackingEventManager.addEvent(event);
Mockito.verify(event).setSessionSeed(sessionSeed);
Mockito.verify(eventsToTransferPersister).save(Mockito.isA(DebugEventBase.class));
Mockito.verify(eventsStatisticsPersister).save(Mockito.isA(DebugEventBase.class));
}
use of nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.DebugEventBase in project watchdog by TestRoots.
the class DebugEventListener method handleWatchExpressionEvent.
/**
* Handles all watch expression events. Makes sure that only one 'Define
* Watch' event is generated for each expression.
*/
private void handleWatchExpressionEvent(DebugEvent event) {
if (!watchExpressionHashes.contains(event.getSource().hashCode())) {
TrackingEventManager.addEvent(new DebugEventBase(TrackingEventType.DEFINE_WATCH, new Date()));
watchExpressionHashes.add(event.getSource().hashCode());
}
}
use of nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.DebugEventBase 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.event.eventtypes.debugging.DebugEventBase in project watchdog by TestRoots.
the class EventJsonConverterTest method testJsonSuspendClientEvent.
@Test
public void testJsonSuspendClientEvent() {
DebugEventBase event = new DebugEventBase(TrackingEventType.SUSPEND_CLIENT, new Date());
ArrayList<WatchDogItem> events = createSampleEvents(event);
assertEquals("[{\"et\":\"sc\",\"ts\":1,\"ss\":\"\"," + pasteWDVAndClient() + "}]", transferer.toJson(events));
}
Aggregations