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;
}
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));
}
Aggregations