Search in sources :

Example 36 with WatchDogItem

use of nl.tudelft.watchdog.core.logic.storage.WatchDogItem in project watchdog by TestRoots.

the class EventJsonConverterTest method testJsonLineBreakpointChangeEventUnknownChange.

@Test
public void testJsonLineBreakpointChangeEventUnknownChange() {
    List<BreakpointChangeType> changes = new ArrayList<>();
    changes.add(BreakpointChangeType.UNKNOWN);
    BreakpointChangeEvent event = new BreakpointChangeEvent(1, BreakpointType.LINE, changes, new Date());
    ArrayList<WatchDogItem> events = createSampleEvents(event);
    assertEquals("[{\"ch\":[\"un\"],\"bh\":1,\"bt\":\"li\",\"et\":\"bc\",\"ts\":1,\"ss\":\"\"," + pasteWDVAndClient() + "}]", transferer.toJson(events));
}
Also used : BreakpointChangeType(nl.tudelft.watchdog.core.logic.breakpoint.BreakpointChangeType) ArrayList(java.util.ArrayList) Date(java.util.Date) BreakpointChangeEvent(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointChangeEvent) WatchDogItem(nl.tudelft.watchdog.core.logic.storage.WatchDogItem) Test(org.junit.Test)

Example 37 with WatchDogItem

use of nl.tudelft.watchdog.core.logic.storage.WatchDogItem in project watchdog by TestRoots.

the class EventJsonConverterTest method testJsonFieldBreakpointAddEventRepresentation.

@Test
public void testJsonFieldBreakpointAddEventRepresentation() {
    BreakpointAddEvent event = new BreakpointAddEvent(1, BreakpointType.FIELD, new Date());
    ArrayList<WatchDogItem> events = createSampleEvents(event);
    assertEquals("[{\"bh\":1,\"bt\":\"fi\",\"et\":\"ba\",\"ts\":1,\"ss\":\"\"," + pasteWDVAndClient() + "}]", transferer.toJson(events));
}
Also used : BreakpointAddEvent(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointAddEvent) Date(java.util.Date) WatchDogItem(nl.tudelft.watchdog.core.logic.storage.WatchDogItem) Test(org.junit.Test)

Example 38 with WatchDogItem

use of nl.tudelft.watchdog.core.logic.storage.WatchDogItem in project watchdog by TestRoots.

the class EventJsonConverterTest method testJsonLineBreakpointChangeEventThreeChanges.

@Test
public void testJsonLineBreakpointChangeEventThreeChanges() {
    List<BreakpointChangeType> changes = new ArrayList<>();
    changes.add(BreakpointChangeType.DISABLED);
    changes.add(BreakpointChangeType.COND_DISABLED);
    changes.add(BreakpointChangeType.COND_CHANGED);
    BreakpointChangeEvent event = new BreakpointChangeEvent(1, BreakpointType.LINE, changes, new Date());
    ArrayList<WatchDogItem> events = createSampleEvents(event);
    assertEquals("[{\"ch\":[\"ds\",\"cd\",\"cc\"],\"bh\":1,\"bt\":\"li\",\"et\":\"bc\",\"ts\":1,\"ss\":\"\"," + pasteWDVAndClient() + "}]", transferer.toJson(events));
}
Also used : BreakpointChangeType(nl.tudelft.watchdog.core.logic.breakpoint.BreakpointChangeType) ArrayList(java.util.ArrayList) Date(java.util.Date) BreakpointChangeEvent(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointChangeEvent) WatchDogItem(nl.tudelft.watchdog.core.logic.storage.WatchDogItem) Test(org.junit.Test)

Example 39 with WatchDogItem

use of nl.tudelft.watchdog.core.logic.storage.WatchDogItem in project watchdog by TestRoots.

the class EventJsonConverterTest method testJsonSuspendClientEvent.

@Test
public void testJsonSuspendClientEvent() {
    DebugEventBase event = new DebugEventBase(TrackingEventType.SUSPEND_CLIENT, new Date());
    ArrayList<WatchDogItem> events = createSampleEvents(event);
    assertEquals("[{\"et\":\"sc\",\"ts\":1,\"ss\":\"\"," + pasteWDVAndClient() + "}]", transferer.toJson(events));
}
Also used : Date(java.util.Date) DebugEventBase(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.DebugEventBase) WatchDogItem(nl.tudelft.watchdog.core.logic.storage.WatchDogItem) Test(org.junit.Test)

Example 40 with WatchDogItem

use of nl.tudelft.watchdog.core.logic.storage.WatchDogItem in project watchdog by TestRoots.

the class EventJsonConverterTest method testJsonUndefinedBreakpointAddEventRepresentation.

@Test
public void testJsonUndefinedBreakpointAddEventRepresentation() {
    BreakpointAddEvent event = new BreakpointAddEvent(1, BreakpointType.UNDEFINED, new Date());
    ArrayList<WatchDogItem> events = createSampleEvents(event);
    assertEquals("[{\"bh\":1,\"bt\":\"un\",\"et\":\"ba\",\"ts\":1,\"ss\":\"\"," + pasteWDVAndClient() + "}]", transferer.toJson(events));
}
Also used : BreakpointAddEvent(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointAddEvent) Date(java.util.Date) WatchDogItem(nl.tudelft.watchdog.core.logic.storage.WatchDogItem) Test(org.junit.Test)

Aggregations

WatchDogItem (nl.tudelft.watchdog.core.logic.storage.WatchDogItem)43 Test (org.junit.Test)35 Date (java.util.Date)32 ArrayList (java.util.ArrayList)14 IntervalBase (nl.tudelft.watchdog.core.logic.interval.intervaltypes.IntervalBase)10 Document (nl.tudelft.watchdog.core.logic.document.Document)6 BreakpointAddEvent (nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointAddEvent)6 DebugEventBase (nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.DebugEventBase)6 TypingInterval (nl.tudelft.watchdog.core.logic.interval.intervaltypes.TypingInterval)6 EditorWrapper (nl.tudelft.watchdog.eclipse.logic.document.EditorWrapper)6 ITextEditor (org.eclipse.ui.texteditor.ITextEditor)6 BreakpointChangeEvent (nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointChangeEvent)5 EditorIntervalBase (nl.tudelft.watchdog.core.logic.interval.intervaltypes.EditorIntervalBase)5 BreakpointChangeType (nl.tudelft.watchdog.core.logic.breakpoint.BreakpointChangeType)4 EventBase (nl.tudelft.watchdog.core.logic.event.eventtypes.EventBase)4 IDEOpenInterval (nl.tudelft.watchdog.core.logic.interval.intervaltypes.IDEOpenInterval)3 BreakpointRemoveEvent (nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointRemoveEvent)1 DebugInterval (nl.tudelft.watchdog.core.logic.interval.intervaltypes.DebugInterval)1 ReadingInterval (nl.tudelft.watchdog.core.logic.interval.intervaltypes.ReadingInterval)1 JsonTransferer (nl.tudelft.watchdog.core.logic.network.JsonTransferer)1