use of com.canoo.dp.impl.client.legacy.communication.CommandAndHandler in project dolphin-platform by canoo.
the class StandardCommandBatcherTest method testOne.
@Test
public void testOne() {
CommandAndHandler cah = new CommandAndHandler(null);
batcher.batch(cah);
try {
Assert.assertEquals(Collections.singletonList(cah), batcher.getWaitingBatches().getVal());
} catch (InterruptedException e) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
}
use of com.canoo.dp.impl.client.legacy.communication.CommandAndHandler in project dolphin-platform by canoo.
the class StandardCommandBatcherTest method testMultipleDoesNotBatch.
@Test
public void testMultipleDoesNotBatch() {
List<CommandAndHandler> list = Arrays.asList(new CommandAndHandler(null), new CommandAndHandler(null), new CommandAndHandler(null));
for (CommandAndHandler cwh : list) {
batcher.batch(cwh);
}
try {
Assert.assertEquals(Collections.singletonList(list.get(0)), batcher.getWaitingBatches().getVal());
Assert.assertEquals(Collections.singletonList(list.get(1)), batcher.getWaitingBatches().getVal());
Assert.assertEquals(Collections.singletonList(list.get(2)), batcher.getWaitingBatches().getVal());
} catch (InterruptedException e) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
}
use of com.canoo.dp.impl.client.legacy.communication.CommandAndHandler in project dolphin-platform by canoo.
the class DolphinTestClientConnector method send.
@Override
public void send(Command command, OnFinishedHandler callback) {
List<Command> answer = transmit(new ArrayList<>(Arrays.asList(command)));
CommandAndHandler handler = new CommandAndHandler(command, callback);
processResults(answer, new ArrayList<>(Arrays.asList(handler)));
}
Aggregations