Search in sources :

Example 6 with BreakpointChangeType

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

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

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

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

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

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