@@ -85,22 +85,22 @@ public void close() throws Exception {
8585
8686 @ Test
8787 public void smallSendReceiveSerial () throws Exception {
88- simpleSendReceive (100 , 50 );
88+ simpleSendReceive (100 , 50 , TIMEOUT_MS );
8989 }
9090
9191 @ Test
9292 public void mediumSendReceiveSerial () throws Exception {
93- simpleSendReceive (2000 ,1 );
93+ simpleSendReceive (2000 ,1 , TIMEOUT_MS );
9494 }
9595
9696 @ Test
9797 public void testMultipleReadersOnSingleLogSerial () throws Exception {
98- sendReceive (4 , 2000 , 5 , true );
98+ sendReceive (4 , 2000 , 5 , true , TIMEOUT_MS );
9999 }
100100
101101 @ Test
102102 public void testMultipleReadersOnSingleLog () throws Exception {
103- sendReceive (4 , 2000 , 5 , false );
103+ sendReceive (4 , 2000 , 5 , false , TIMEOUT_MS );
104104 }
105105
106106 @ Test
@@ -252,11 +252,11 @@ public void testUnregisterReaderSerial() throws Exception {
252252 assertEquals (3 , reader2 .totalValue .get ());
253253 }
254254
255- private void simpleSendReceive (int numMessages , int delayMS ) throws Exception {
256- sendReceive (1 , numMessages , delayMS , true );
255+ protected void simpleSendReceive (int numMessages , int delayMS , long timeoutMS ) throws Exception {
256+ sendReceive (1 , numMessages , delayMS , true , timeoutMS );
257257 }
258258
259- public void sendReceive (int readers , int numMessages , int delayMS , boolean expectMessageOrder ) throws Exception {
259+ public void sendReceive (int readers , int numMessages , int delayMS , boolean expectMessageOrder , long timeoutMS ) throws Exception {
260260 Preconditions .checkState (0 < readers );
261261 Log log1 = manager .openLog ("test1" );
262262 assertEquals ("test1" ,log1 .getName ());
@@ -272,7 +272,7 @@ public void sendReceive(int readers, int numMessages, int delayMS, boolean expec
272272 }
273273 for (int i = 0 ; i < counts .length ; i ++) {
274274 CountingReader count = counts [i ];
275- count .await (TIMEOUT_MS );
275+ count .await (timeoutMS );
276276 assertEquals ("counter index " + i + " message count mismatch" , numMessages , count .totalMsg .get ());
277277 assertEquals ("counter index " + i + " value mismatch" , numMessages *(numMessages +1 )/2 ,count .totalValue .get ());
278278 assertTrue (log1 .unregisterReader (count ));
@@ -285,7 +285,7 @@ public void sendReceive(int readers, int numMessages, int delayMS, boolean expec
285285 * Test MessageReader implementation. Allows waiting until an expected number of messages have
286286 * been read.
287287 */
288- private static class LatchMessageReader implements MessageReader {
288+ protected static class LatchMessageReader implements MessageReader {
289289 private final CountDownLatch latch ;
290290
291291 LatchMessageReader (int expectedMessageCount ) {
@@ -326,7 +326,7 @@ public void await(long timeoutMillis) throws InterruptedException {
326326 }
327327 }
328328
329- private static class CountingReader extends LatchMessageReader {
329+ protected static class CountingReader extends LatchMessageReader {
330330
331331 private static final Logger log =
332332 LoggerFactory .getLogger (CountingReader .class );
@@ -357,9 +357,9 @@ public void processMessage(Message message) {
357357 }
358358 }
359359
360- private static class StoringReader extends LatchMessageReader {
360+ protected static class StoringReader extends LatchMessageReader {
361361
362- private List <StaticBuffer > msgs = new ArrayList <StaticBuffer >(64 );
362+ private List <StaticBuffer > msgs = new ArrayList <>(64 );
363363 private volatile int msgCount = 0 ;
364364
365365 StoringReader (int expectedMessageCount ) {
0 commit comments