assertEquals(testCommand, getter.getResult());
assertNull(queue.peek());
}
public void testCanPutAndGetResultsFromDifferentThreads() throws Throwable {
final TrackableThread firstGetter;
final TrackableThread secondGetter;
new TrackableThread(new AsyncCommandSender(testCommand), "launching sender").start();
firstGetter = new TrackableThread(new AsyncCommandGetter(), "launching firstGetter");
firstGetter.start();
assertEquals(testCommand, firstGetter.getResult());
assertTrue(queue.putContent(completeCommand));
secondGetter = new TrackableThread(new AsyncCommandGetter(), "launching firstGetter");
secondGetter.start();
assertEquals(completeCommand, secondGetter.getResult());
}