Search in sources :

Example 1 with BreakpointRemoveEvent

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

the class EventPersisterDuplicatesTest method test5AddSimilarEventDifferentTypeTestPersisted.

@Test
public void test5AddSimilarEventDifferentTypeTestPersisted() {
    event = new BreakpointRemoveEvent(1, BreakpointType.LINE, new Date(1));
    event.setSessionSeed("444");
    persister.save(event);
    assertEquals(3, persister.getSize());
}
Also used : BreakpointRemoveEvent(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointRemoveEvent) Date(java.util.Date) Test(org.junit.Test)

Example 2 with BreakpointRemoveEvent

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

the class TrackingEventManagerTest method testAddBreakpointRemoveEvent.

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

Example 3 with BreakpointRemoveEvent

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

the class BreakpointListener method breakpointRemoved.

@Override
public void breakpointRemoved(@NotNull XBreakpoint xBreakpoint) {
    Date timestamp = new Date();
    Breakpoint breakpoint = BreakpointCreator.createBreakpoint(xBreakpoint);
    breakpoints.remove(breakpoint.getHash());
    BreakpointRemoveEvent event = new BreakpointRemoveEvent(breakpoint.getHash(), breakpoint.getBreakpointType(), timestamp);
    trackingEventManager.addEvent(event);
}
Also used : Breakpoint(nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint) XBreakpoint(com.intellij.xdebugger.breakpoints.XBreakpoint) BreakpointRemoveEvent(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointRemoveEvent) Date(java.util.Date)

Example 4 with BreakpointRemoveEvent

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

the class BreakpointListener method breakpointRemoved.

@Override
public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
    Date timestamp = new Date();
    Breakpoint bp = BreakpointCreator.createBreakpoint(breakpoint);
    breakpoints.remove(bp.getHash());
    BreakpointRemoveEvent event = new BreakpointRemoveEvent(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) BreakpointRemoveEvent(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointRemoveEvent) Date(java.util.Date)

Example 5 with BreakpointRemoveEvent

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

the class EventJsonConverterTest method testJsonLineBreakpointRemoveEventRepresentation.

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

Aggregations

Date (java.util.Date)5 BreakpointRemoveEvent (nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointRemoveEvent)5 Test (org.junit.Test)3 Breakpoint (nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint)2 XBreakpoint (com.intellij.xdebugger.breakpoints.XBreakpoint)1 WatchDogItem (nl.tudelft.watchdog.core.logic.storage.WatchDogItem)1 IBreakpoint (org.eclipse.debug.core.model.IBreakpoint)1