Search in sources :

Example 6 with DebugEventBase

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;
    }
}
Also used : Date(java.util.Date) DebugEventBase(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.DebugEventBase)

Example 7 with DebugEventBase

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));
}
Also used : Date(java.util.Date) DebugEventBase(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.DebugEventBase) Test(org.junit.Test)

Example 8 with DebugEventBase

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());
    }
}
Also used : Date(java.util.Date) DebugEventBase(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.DebugEventBase)

Example 9 with DebugEventBase

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));
}
Also used : Date(java.util.Date) DebugEventBase(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.DebugEventBase) WatchDogItem(nl.tudelft.watchdog.core.logic.storage.WatchDogItem) Test(org.junit.Test)

Example 10 with DebugEventBase

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));
}
Also used : Date(java.util.Date) DebugEventBase(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.DebugEventBase) WatchDogItem(nl.tudelft.watchdog.core.logic.storage.WatchDogItem) Test(org.junit.Test)

Aggregations

Date (java.util.Date)10 DebugEventBase (nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.DebugEventBase)10 Test (org.junit.Test)8 WatchDogItem (nl.tudelft.watchdog.core.logic.storage.WatchDogItem)6