Search in sources :

Example 41 with WatchDogItem

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

the class EventJsonConverterTest method testJsonClassBreakpointAddEventRepresentation.

@Test
public void testJsonClassBreakpointAddEventRepresentation() {
    BreakpointAddEvent event = new BreakpointAddEvent(1, BreakpointType.CLASS, new Date());
    ArrayList<WatchDogItem> events = createSampleEvents(event);
    assertEquals("[{\"bh\":1,\"bt\":\"cp\",\"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 42 with WatchDogItem

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

the class EventJsonConverterTest method testJsonLineBreakpointRemoveEventRepresentation.

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

Example 43 with WatchDogItem

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

the class NetworkUtilsTest method testIntervalTransfer.

@Test
@Ignore
public void testIntervalTransfer() {
    JsonTransferer it = new JsonTransferer();
    IntervalBase interval = new IDEOpenInterval(new Date());
    ArrayList<WatchDogItem> intervals = createSampleIntervals(interval);
    String json = it.toJson(intervals);
    try {
        NetworkUtils.transferJsonAndGetResponse(NetworkUtils.buildIntervalsPostURL(fooBarUser, fooBarProject), json);
    } catch (ServerCommunicationException | ServerReturnCodeException e) {
        fail(e.getMessage());
    }
}
Also used : JsonTransferer(nl.tudelft.watchdog.core.logic.network.JsonTransferer) ServerCommunicationException(nl.tudelft.watchdog.core.logic.network.ServerCommunicationException) IntervalBase(nl.tudelft.watchdog.core.logic.interval.intervaltypes.IntervalBase) ServerReturnCodeException(nl.tudelft.watchdog.core.logic.network.ServerReturnCodeException) IDEOpenInterval(nl.tudelft.watchdog.core.logic.interval.intervaltypes.IDEOpenInterval) Date(java.util.Date) WatchDogItem(nl.tudelft.watchdog.core.logic.storage.WatchDogItem) Ignore(org.junit.Ignore) 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