use of nl.tudelft.watchdog.core.logic.breakpoint.BreakpointChangeType 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));
}
use of nl.tudelft.watchdog.core.logic.breakpoint.BreakpointChangeType in project watchdog by TestRoots.
the class EventJsonConverterTest method testJsonLineBreakpointChangeEventSingleChange.
@Test
public void testJsonLineBreakpointChangeEventSingleChange() {
List<BreakpointChangeType> changes = new ArrayList<>();
changes.add(BreakpointChangeType.ENABLED);
BreakpointChangeEvent event = new BreakpointChangeEvent(1, BreakpointType.LINE, changes, new Date());
ArrayList<WatchDogItem> events = createSampleEvents(event);
assertEquals("[{\"ch\":[\"en\"],\"bh\":1,\"bt\":\"li\",\"et\":\"bc\",\"ts\":1,\"ss\":\"\"," + pasteWDVAndClient() + "}]", transferer.toJson(events));
}
use of nl.tudelft.watchdog.core.logic.breakpoint.BreakpointChangeType in project watchdog by TestRoots.
the class EventJsonConverterTest method testJsonLineBreakpointChangeEventTwoChanges.
@Test
public void testJsonLineBreakpointChangeEventTwoChanges() {
List<BreakpointChangeType> changes = new ArrayList<>();
changes.add(BreakpointChangeType.ENABLED);
changes.add(BreakpointChangeType.HC_ADDED);
BreakpointChangeEvent event = new BreakpointChangeEvent(1, BreakpointType.LINE, changes, new Date());
ArrayList<WatchDogItem> events = createSampleEvents(event);
assertEquals("[{\"ch\":[\"en\",\"ha\"],\"bh\":1,\"bt\":\"li\",\"et\":\"bc\",\"ts\":1,\"ss\":\"\"," + pasteWDVAndClient() + "}]", transferer.toJson(events));
}
use of nl.tudelft.watchdog.core.logic.breakpoint.BreakpointChangeType in project watchdog by TestRoots.
the class BreakpointListener method breakpointChanged.
@Override
public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
Date timestamp = new Date();
Breakpoint bp = BreakpointCreator.createBreakpoint(breakpoint);
// Replace entry if present, otherwise create new entry.
Breakpoint old = breakpoints.put(bp.getHash(), bp);
List<BreakpointChangeType> changes = BreakpointChangeClassifier.classify(old, bp);
BreakpointChangeEvent event = new BreakpointChangeEvent(bp.getHash(), bp.getBreakpointType(), changes, timestamp);
TrackingEventManager.addEvent(event);
}
use of nl.tudelft.watchdog.core.logic.breakpoint.BreakpointChangeType in project watchdog by TestRoots.
the class BreakpointChangeClassifierTest method testClassifySPChanged.
@Test
public void testClassifySPChanged() {
Breakpoint old = createBreakpoint();
Breakpoint bp = createBreakpoint();
old.setSuspendPolicy(0);
bp.setSuspendPolicy(1);
List<BreakpointChangeType> result = BreakpointChangeClassifier.classify(old, bp);
assertEquals(1, result.size());
assertEquals(BreakpointChangeType.SP_CHANGED, result.get(0));
}
Aggregations