Search in sources :

Example 6 with BreakpointAddEvent

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

the class EventJsonConverterTest method testJsonMethodBreakpointAddEventRepresentation.

@Test
public void testJsonMethodBreakpointAddEventRepresentation() {
    BreakpointAddEvent event = new BreakpointAddEvent(1, BreakpointType.METHOD, new Date());
    ArrayList<WatchDogItem> events = createSampleEvents(event);
    assertEquals("[{\"bh\":1,\"bt\":\"me\",\"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 7 with BreakpointAddEvent

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

the class EventJsonConverterTest method testJsonExceptionBreakpointAddEventRepresentation.

@Test
public void testJsonExceptionBreakpointAddEventRepresentation() {
    BreakpointAddEvent event = new BreakpointAddEvent(1, BreakpointType.EXCEPTION, new Date());
    ArrayList<WatchDogItem> events = createSampleEvents(event);
    assertEquals("[{\"bh\":1,\"bt\":\"ex\",\"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 8 with BreakpointAddEvent

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

the class EventJsonConverterTest method testJsonFieldBreakpointAddEventRepresentation.

@Test
public void testJsonFieldBreakpointAddEventRepresentation() {
    BreakpointAddEvent event = new BreakpointAddEvent(1, BreakpointType.FIELD, new Date());
    ArrayList<WatchDogItem> events = createSampleEvents(event);
    assertEquals("[{\"bh\":1,\"bt\":\"fi\",\"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 9 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(@NotNull XBreakpoint xBreakpoint) {
    Date timestamp = new Date();
    Breakpoint breakpoint = BreakpointCreator.createBreakpoint(xBreakpoint);
    breakpoints.put(breakpoint.getHash(), breakpoint);
    BreakpointAddEvent event = new BreakpointAddEvent(breakpoint.getHash(), breakpoint.getBreakpointType(), timestamp);
    trackingEventManager.addEvent(event);
}
Also used : Breakpoint(nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint) XBreakpoint(com.intellij.xdebugger.breakpoints.XBreakpoint) BreakpointAddEvent(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointAddEvent) Date(java.util.Date)

Example 10 with BreakpointAddEvent

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

the class EventJsonConverterTest method testJsonUndefinedBreakpointAddEventRepresentation.

@Test
public void testJsonUndefinedBreakpointAddEventRepresentation() {
    BreakpointAddEvent event = new BreakpointAddEvent(1, BreakpointType.UNDEFINED, new Date());
    ArrayList<WatchDogItem> events = createSampleEvents(event);
    assertEquals("[{\"bh\":1,\"bt\":\"un\",\"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)

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