Search in sources :

Example 16 with BreakpointChangeType

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

the class BreakpointChangeClassifierTest method testClassifyBPEnabled.

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

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

the class BreakpointChangeClassifierTest method testClassifyConditionChanged.

@Test
public void testClassifyConditionChanged() {
    Breakpoint old = createBreakpoint();
    Breakpoint bp = createBreakpoint();
    old.setCondition("cond_old");
    bp.setCondition("cond");
    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 18 with BreakpointChangeType

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

the class BreakpointChangeClassifierTest method testClassifyThreeChangesWithCondition.

@Test
public void testClassifyThreeChangesWithCondition() {
    Breakpoint old = createBreakpoint();
    Breakpoint bp = createBreakpoint();
    old.setEnabled(true);
    bp.setEnabled(false);
    old.setConditionEnabled(true);
    bp.setConditionEnabled(false);
    old.setCondition("cond");
    bp.setCondition("cond_old");
    List<BreakpointChangeType> results = BreakpointChangeClassifier.classify(old, bp);
    assertEquals(3, results.size());
    assertTrue(results.contains(BreakpointChangeType.DISABLED));
    assertTrue(results.contains(BreakpointChangeType.COND_DISABLED));
    assertTrue(results.contains(BreakpointChangeType.COND_CHANGED));
}
Also used : Breakpoint(nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint) BreakpointChangeType(nl.tudelft.watchdog.core.logic.breakpoint.BreakpointChangeType) Test(org.junit.Test)

Example 19 with BreakpointChangeType

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

the class BreakpointChangeClassifierTest method testClassifyConditionNoChanges.

@Test
public void testClassifyConditionNoChanges() {
    Breakpoint old = createBreakpoint();
    Breakpoint bp = createBreakpoint();
    old.setCondition("cond");
    bp.setCondition("cond");
    List<BreakpointChangeType> result = BreakpointChangeClassifier.classify(old, 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 20 with BreakpointChangeType

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

the class BreakpointChangeClassifierTest method testClassifyHCRemoved.

@Test
public void testClassifyHCRemoved() {
    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_REMOVED, 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

BreakpointChangeType (nl.tudelft.watchdog.core.logic.breakpoint.BreakpointChangeType)24 Test (org.junit.Test)22 Breakpoint (nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint)20 Date (java.util.Date)6 BreakpointChangeEvent (nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointChangeEvent)6 ArrayList (java.util.ArrayList)4 WatchDogItem (nl.tudelft.watchdog.core.logic.storage.WatchDogItem)4 XBreakpoint (com.intellij.xdebugger.breakpoints.XBreakpoint)1 IBreakpoint (org.eclipse.debug.core.model.IBreakpoint)1