Search in sources :

Example 36 with Breakpoint

use of nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint in project watchdog by TestRoots.

the class BreakpointCreatorTest method testCreateJavaBreakpointSuspendPolicy.

@Test
public void testCreateJavaBreakpointSuspendPolicy() throws CoreException {
    IJavaBreakpoint bp = mock(IJavaBreakpoint.class);
    when(bp.getSuspendPolicy()).thenReturn(1);
    Breakpoint result = BreakpointCreator.createBreakpoint(bp);
    assertEquals(1, result.getSuspendPolicy());
}
Also used : IJavaBreakpoint(org.eclipse.jdt.debug.core.IJavaBreakpoint) Breakpoint(nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint) IBreakpoint(org.eclipse.debug.core.model.IBreakpoint) IJavaLineBreakpoint(org.eclipse.jdt.debug.core.IJavaLineBreakpoint) IJavaBreakpoint(org.eclipse.jdt.debug.core.IJavaBreakpoint) Test(org.junit.Test)

Example 37 with Breakpoint

use of nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint 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 38 with Breakpoint

use of nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint in project watchdog by TestRoots.

the class BreakpointListener method breakpointChanged.

@Override
public void breakpointChanged(@NotNull XBreakpoint xBreakpoint) {
    Date timestamp = new Date();
    Breakpoint breakpoint = BreakpointCreator.createBreakpoint(xBreakpoint);
    // Replace entry if present, otherwise create new entry.
    Breakpoint oldBreakpoint = breakpoints.put(breakpoint.getHash(), breakpoint);
    List<BreakpointChangeType> changes = BreakpointChangeClassifier.classify(oldBreakpoint, breakpoint);
    BreakpointChangeEvent event = new BreakpointChangeEvent(breakpoint.getHash(), breakpoint.getBreakpointType(), changes, timestamp);
    trackingEventManager.addEvent(event);
}
Also used : Breakpoint(nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint) XBreakpoint(com.intellij.xdebugger.breakpoints.XBreakpoint) BreakpointChangeType(nl.tudelft.watchdog.core.logic.breakpoint.BreakpointChangeType) Date(java.util.Date) BreakpointChangeEvent(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointChangeEvent)

Aggregations

Breakpoint (nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint)38 Test (org.junit.Test)30 BreakpointChangeType (nl.tudelft.watchdog.core.logic.breakpoint.BreakpointChangeType)20 IBreakpoint (org.eclipse.debug.core.model.IBreakpoint)16 IJavaBreakpoint (org.eclipse.jdt.debug.core.IJavaBreakpoint)13 IJavaLineBreakpoint (org.eclipse.jdt.debug.core.IJavaLineBreakpoint)13 Date (java.util.Date)6 XBreakpoint (com.intellij.xdebugger.breakpoints.XBreakpoint)4 BreakpointAddEvent (nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointAddEvent)2 BreakpointChangeEvent (nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointChangeEvent)2 BreakpointRemoveEvent (nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointRemoveEvent)2 XExpression (com.intellij.xdebugger.XExpression)1 CoreException (org.eclipse.core.runtime.CoreException)1 JavaBreakpointProperties (org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties)1