Search in sources :

Example 6 with Breakpoint

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

the class BreakpointChangeClassifierTest method testClassifyBPDisabled.

@Test
public void testClassifyBPDisabled() {
    Breakpoint old = createBreakpoint();
    Breakpoint bp = createBreakpoint();
    old.setEnabled(true);
    bp.setEnabled(false);
    List<BreakpointChangeType> result = BreakpointChangeClassifier.classify(old, bp);
    assertEquals(1, result.size());
    assertEquals(BreakpointChangeType.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 7 with Breakpoint

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

the class BreakpointChangeClassifierTest method testClassifyConditionRemoved.

@Test
public void testClassifyConditionRemoved() {
    Breakpoint old = createBreakpoint();
    Breakpoint bp = createBreakpoint();
    old.setCondition("cond");
    bp.setCondition(null);
    List<BreakpointChangeType> result = BreakpointChangeClassifier.classify(old, bp);
    assertEquals(1, result.size());
    assertEquals(BreakpointChangeType.COND_CHANGED, 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 8 with Breakpoint

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

the class BreakpointChangeClassifierTest method testClassifyConditionEnabled.

@Test
public void testClassifyConditionEnabled() {
    Breakpoint old = createBreakpoint();
    Breakpoint bp = createBreakpoint();
    old.setConditionEnabled(false);
    bp.setConditionEnabled(true);
    List<BreakpointChangeType> result = BreakpointChangeClassifier.classify(old, bp);
    assertEquals(1, result.size());
    assertEquals(BreakpointChangeType.COND_ENABLED, 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 9 with Breakpoint

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

the class BreakpointChangeClassifierTest method testClassifyOldBPIsNull.

@Test
public void testClassifyOldBPIsNull() {
    Breakpoint bp = createBreakpoint();
    List<BreakpointChangeType> result = BreakpointChangeClassifier.classify(null, bp);
    assertEquals(1, result.size());
    assertEquals(BreakpointChangeType.UNKNOWN, 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 10 with Breakpoint

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

the class BreakpointChangeClassifierTest method testClassifyHCAdded.

@Test
public void testClassifyHCAdded() {
    Breakpoint old = createBreakpoint();
    Breakpoint bp = createBreakpoint();
    old.setHitCount(-1);
    bp.setHitCount(1);
    List<BreakpointChangeType> result = BreakpointChangeClassifier.classify(old, bp);
    assertEquals(1, result.size());
    assertEquals(BreakpointChangeType.HC_ADDED, 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)

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