Search in sources :

Example 11 with Breakpoint

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

the class BreakpointChangeClassifierTest method testClassifyConditionDisabled.

@Test
public void testClassifyConditionDisabled() {
    Breakpoint old = createBreakpoint();
    Breakpoint bp = createBreakpoint();
    old.setConditionEnabled(true);
    bp.setConditionEnabled(false);
    List<BreakpointChangeType> result = BreakpointChangeClassifier.classify(old, bp);
    assertEquals(1, result.size());
    assertEquals(BreakpointChangeType.COND_DISABLED, result.get(0));
}
Also used : Breakpoint(nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint) BreakpointChangeType(nl.tudelft.watchdog.core.logic.breakpoint.BreakpointChangeType) Test(org.junit.Test)

Example 12 with Breakpoint

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

the class BreakpointCreatorTest method testCreateBreakpointHash.

@Test
public void testCreateBreakpointHash() {
    IBreakpoint bp = mock(IBreakpoint.class);
    Breakpoint result = BreakpointCreator.createBreakpoint(bp);
    assertEquals(bp.hashCode(), result.getHash());
}
Also used : 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) IBreakpoint(org.eclipse.debug.core.model.IBreakpoint) Test(org.junit.Test)

Example 13 with Breakpoint

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

the class BreakpointCreatorTest method testCreateJavaLineBreakpointNoCondition.

@Test
public void testCreateJavaLineBreakpointNoCondition() throws CoreException {
    IJavaLineBreakpoint bp = mock(IJavaLineBreakpoint.class);
    when(bp.getCondition()).thenReturn(null);
    Breakpoint result = BreakpointCreator.createBreakpoint(bp);
    assertNull(result.getCondition());
}
Also used : 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) IJavaLineBreakpoint(org.eclipse.jdt.debug.core.IJavaLineBreakpoint) Test(org.junit.Test)

Example 14 with Breakpoint

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

the class BreakpointCreatorTest method testCreateBreakpointEnabled.

@Test
public void testCreateBreakpointEnabled() throws CoreException {
    IBreakpoint bp = mock(IBreakpoint.class);
    when(bp.isEnabled()).thenReturn(true);
    Breakpoint result = BreakpointCreator.createBreakpoint(bp);
    assertTrue(result.isEnabled());
}
Also used : 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) IBreakpoint(org.eclipse.debug.core.model.IBreakpoint) Test(org.junit.Test)

Example 15 with Breakpoint

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

the class BreakpointCreatorTest method testCreateBreakpointType.

@Test
public void testCreateBreakpointType() {
    IBreakpoint bp = mock(IBreakpoint.class);
    Breakpoint result = BreakpointCreator.createBreakpoint(bp);
    assertEquals(BreakpointType.UNDEFINED, result.getBreakpointType());
}
Also used : 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) IBreakpoint(org.eclipse.debug.core.model.IBreakpoint) Test(org.junit.Test)

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