Search in sources :

Example 1 with BreakpointAddEvent

use of nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointAddEvent in project watchdog by TestRoots.

the class EventPersisterDuplicatesTest method createEvent.

private static EventBase createEvent() {
    EventBase event = new BreakpointAddEvent(1, BreakpointType.LINE, new Date(1));
    event.setSessionSeed("444");
    return event;
}
Also used : EventBase(nl.tudelft.watchdog.core.logic.event.eventtypes.EventBase) BreakpointAddEvent(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointAddEvent) Date(java.util.Date)

Example 2 with BreakpointAddEvent

use of nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointAddEvent in project watchdog by TestRoots.

the class TrackingEventManagerTest method testAddBreakpointAddEvent.

@Test
public void testAddBreakpointAddEvent() {
    BreakpointAddEvent eventReal = new BreakpointAddEvent(1, BreakpointType.LINE, new Date());
    BreakpointAddEvent event = Mockito.spy(eventReal);
    trackingEventManager.addEvent(event);
    Mockito.verify(event).setSessionSeed(sessionSeed);
    Mockito.verify(eventsToTransferPersister).save(Mockito.isA(BreakpointAddEvent.class));
    Mockito.verify(eventsStatisticsPersister).save(Mockito.isA(BreakpointAddEvent.class));
}
Also used : BreakpointAddEvent(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointAddEvent) Date(java.util.Date) Test(org.junit.Test)

Example 3 with BreakpointAddEvent

use of nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointAddEvent in project watchdog by TestRoots.

the class EventJsonConverterTest method testJsonLineBreakpointAddEventRepresentation.

@Test
public void testJsonLineBreakpointAddEventRepresentation() {
    BreakpointAddEvent event = new BreakpointAddEvent(1, BreakpointType.LINE, new Date());
    ArrayList<WatchDogItem> events = createSampleEvents(event);
    assertEquals("[{\"bh\":1,\"bt\":\"li\",\"et\":\"ba\",\"ts\":1,\"ss\":\"\"," + pasteWDVAndClient() + "}]", transferer.toJson(events));
}
Also used : BreakpointAddEvent(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointAddEvent) Date(java.util.Date) WatchDogItem(nl.tudelft.watchdog.core.logic.storage.WatchDogItem) Test(org.junit.Test)

Example 4 with BreakpointAddEvent

use of nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointAddEvent in project watchdog by TestRoots.

the class EventPersisterTest method createRandomEvent.

public static EventBase createRandomEvent() {
    EventBase event = new BreakpointAddEvent(new Random().nextInt(100000), BreakpointType.LINE, new Date());
    event.setSessionSeed("444");
    event.setTimestamp(new Date(event.getTimestamp().getTime() + (new Random()).nextInt(100000)));
    return event;
}
Also used : EventBase(nl.tudelft.watchdog.core.logic.event.eventtypes.EventBase) Random(java.util.Random) BreakpointAddEvent(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointAddEvent) Date(java.util.Date)

Example 5 with BreakpointAddEvent

use of nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointAddEvent in project watchdog by TestRoots.

the class BreakpointListener method breakpointAdded.

@Override
public void breakpointAdded(IBreakpoint breakpoint) {
    Date timestamp = new Date();
    Breakpoint bp = BreakpointCreator.createBreakpoint(breakpoint);
    breakpoints.put(bp.getHash(), bp);
    BreakpointAddEvent event = new BreakpointAddEvent(bp.getHash(), bp.getBreakpointType(), timestamp);
    TrackingEventManager.addEvent(event);
}
Also used : Breakpoint(nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint) IBreakpoint(org.eclipse.debug.core.model.IBreakpoint) BreakpointAddEvent(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointAddEvent) Date(java.util.Date)

Aggregations

Date (java.util.Date)11 BreakpointAddEvent (nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointAddEvent)11 Test (org.junit.Test)7 WatchDogItem (nl.tudelft.watchdog.core.logic.storage.WatchDogItem)6 Breakpoint (nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint)2 EventBase (nl.tudelft.watchdog.core.logic.event.eventtypes.EventBase)2 XBreakpoint (com.intellij.xdebugger.breakpoints.XBreakpoint)1 Random (java.util.Random)1 IBreakpoint (org.eclipse.debug.core.model.IBreakpoint)1