public void testIdentityQueue() throws InterruptedException { ByteBuffer a = ByteBuffer.allocate(1); qi.incubate(a); a.put((byte) 5); qi.hatch(a); ByteBuffer b = (ByteBuffer) qi.getNext(); assertEquals(a, b); a = ByteBuffer.allocate(1); qe.incubate(a); a.put((byte) 5); try { qe.hatch(a); throw new RuntimeException("Hatch fail expected"); } catch (IllegalArgumentException e) { } }
public void testGetNext() throws InterruptedException { qi.incubate(a); assertEquals(a, qi.getNext()); }