use of nl.tudelft.watchdog.core.logic.interval.intervaltypes.IntervalBase in project watchdog by TestRoots.
the class IntervalPersisterTestSingleInterval method test2CompareIntervalAfterWrite.
@Test
public void test2CompareIntervalAfterWrite() {
WatchDogItem savedItem = new ArrayList<>(persister.readItems()).get(0);
assertTrue(savedItem instanceof IntervalBase);
IntervalBase savedInterval = (IntervalBase) savedItem;
assertEquals(interval.getType(), savedInterval.getType());
assertEquals(interval.getStart(), savedInterval.getStart());
assertEquals(interval.getEnd(), savedInterval.getEnd());
}
use of nl.tudelft.watchdog.core.logic.interval.intervaltypes.IntervalBase 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());
}
}
Aggregations