18561857185818591860186118621863186418651866
closerThread.start(); assertNull(topicConsumer.receive(3000)); // wait for the closing thread to finish latch.acquire(); } /** to be used by testTimeoutReceiveOnClose */ private class ThreadCloser extends Thread {
591592593594595596597598599600601
} } }, "consumer thread 2").start(); latch.acquire(); latch2.acquire(); assertEquals(5, received.size()); for(Iterator i = received.iterator(); i.hasNext(); ) { Message m = (Message)i.next();
127128129130131132133134135136137
} // need extra commit for cases in which the last message index is not a multiple of 10 sess.commit(); latch.acquire(); if (listener.failed) { fail("listener failed: " + listener.getError()); }
292293294295296297298299300301302
Thread.sleep(3000); receiverThread.interrupt(); // wait for the reading thread to conclude latch.acquire(); log.trace("Expected message:" + expectedMessage); assertNull(expectedMessage); }
141142143144145146147148149150151
} } }, "receiver thread"); receiverThread.start(); latch.acquire(); assertNull(expectedMessage); } public void testReceiveTimeoutPreservation() throws Exception {
213214215216217218219220221222223
} }, "sender thread"); senderThread.start(); senderLatch.acquire(); receiverLatch.acquire(); if (testFailed) { fail("Test failed by the sender thread. Watch for exception in logs");
3233343536373839
public void doExecute(WorkerContext work, GeronimoExecutor executor) throws WorkException, InterruptedException { Latch latch = work.provideEndLatch(); executor.execute("A J2EE Connector", work); latch.acquire(); } }
public void doExecute(WorkerContext work, GeronimoExecutor executor) throws WorkException, InterruptedException { Latch latch = work.provideStartLatch(); executor.execute("A J2EE Connector", work); latch.acquire(); } }
625626627628629630631632633634635
3334353637383940
public void doExecute(WorkerContext work, Executor executor) throws WorkException, InterruptedException { Latch latch = work.provideEndLatch(); executor.execute(work); latch.acquire(); } }