Search in sources :

Example 1 with DebugInterval

use of nl.tudelft.watchdog.core.logic.interval.intervaltypes.DebugInterval in project watchdog by TestRoots.

the class DebugEventVisualizationUtils method getDebugIntervalStrings.

/**
 * @return the string representations of the lastestDebugIntervals.
 */
public static String[] getDebugIntervalStrings(List<DebugInterval> latestDebugIntervals) {
    String[] debugIntervalStrings = new String[latestDebugIntervals.size()];
    SimpleDateFormat dateFormatter = new SimpleDateFormat("EEE MMM d HH:mm:ss");
    for (int i = 0; i < latestDebugIntervals.size(); i++) {
        DebugInterval currentInterval = latestDebugIntervals.get(i);
        debugIntervalStrings[i] = dateFormatter.format(currentInterval.getStart()) + " - " + dateFormatter.format(currentInterval.getEnd());
    }
    return debugIntervalStrings;
}
Also used : DebugInterval(nl.tudelft.watchdog.core.logic.interval.intervaltypes.DebugInterval) SimpleDateFormat(java.text.SimpleDateFormat) Paint(java.awt.Paint)

Example 2 with DebugInterval

use of nl.tudelft.watchdog.core.logic.interval.intervaltypes.DebugInterval in project watchdog by TestRoots.

the class IntervalJsonConverterTest method testJsonDebugIntervalRepresentation.

@Test
public void testJsonDebugIntervalRepresentation() {
    IntervalBase interval = new DebugInterval(new Date());
    ArrayList<WatchDogItem> intervals = createSampleIntervals(interval);
    assertEquals("[{\"it\":\"db\",\"ts\":1,\"te\":2,\"ss\":\"\"," + pasteWDVAndClient() + "}]", transferer.toJson(intervals));
}
Also used : IntervalBase(nl.tudelft.watchdog.core.logic.interval.intervaltypes.IntervalBase) EditorIntervalBase(nl.tudelft.watchdog.core.logic.interval.intervaltypes.EditorIntervalBase) DebugInterval(nl.tudelft.watchdog.core.logic.interval.intervaltypes.DebugInterval) Date(java.util.Date) WatchDogItem(nl.tudelft.watchdog.core.logic.storage.WatchDogItem) Test(org.junit.Test)

Aggregations

DebugInterval (nl.tudelft.watchdog.core.logic.interval.intervaltypes.DebugInterval)2 Paint (java.awt.Paint)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1 EditorIntervalBase (nl.tudelft.watchdog.core.logic.interval.intervaltypes.EditorIntervalBase)1 IntervalBase (nl.tudelft.watchdog.core.logic.interval.intervaltypes.IntervalBase)1 WatchDogItem (nl.tudelft.watchdog.core.logic.storage.WatchDogItem)1 Test (org.junit.Test)1