Search in sources :

Example 1 with ServerReturnCodeException

use of nl.tudelft.watchdog.core.logic.network.ServerReturnCodeException 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

Date (java.util.Date)1 IDEOpenInterval (nl.tudelft.watchdog.core.logic.interval.intervaltypes.IDEOpenInterval)1 IntervalBase (nl.tudelft.watchdog.core.logic.interval.intervaltypes.IntervalBase)1 JsonTransferer (nl.tudelft.watchdog.core.logic.network.JsonTransferer)1 ServerCommunicationException (nl.tudelft.watchdog.core.logic.network.ServerCommunicationException)1 ServerReturnCodeException (nl.tudelft.watchdog.core.logic.network.ServerReturnCodeException)1 WatchDogItem (nl.tudelft.watchdog.core.logic.storage.WatchDogItem)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1