@@ -69,7 +69,6 @@ public void testConnectionRecoveryWithDisabledTopologyRecovery() throws IOExcept
6969 public void testShutdownHooksRecovery () throws IOException , InterruptedException {
7070 final CountDownLatch latch = new CountDownLatch (2 );
7171 connection .addShutdownListener (new ShutdownListener () {
72- @ Override
7372 public void shutdownCompleted (ShutdownSignalException cause ) {
7473 latch .countDown ();
7574 }
@@ -84,12 +83,10 @@ public void shutdownCompleted(ShutdownSignalException cause) {
8483 public void testBlockedListenerRecovery () throws IOException , InterruptedException {
8584 final CountDownLatch latch = new CountDownLatch (2 );
8685 connection .addBlockedListener (new BlockedListener () {
87- @ Override
8886 public void handleBlocked (String reason ) throws IOException {
8987 latch .countDown ();
9088 }
9189
92- @ Override
9390 public void handleUnblocked () throws IOException {
9491 latch .countDown ();
9592 }
@@ -115,7 +112,6 @@ public void testChannelRecovery() throws IOException, InterruptedException {
115112 public void testReturnListenerRecovery () throws IOException , InterruptedException {
116113 final CountDownLatch latch = new CountDownLatch (1 );
117114 channel .addReturnListener (new ReturnListener () {
118- @ Override
119115 public void handleReturn (int replyCode , String replyText , String exchange ,
120116 String routingKey , AMQP .BasicProperties properties ,
121117 byte [] body ) throws IOException {
@@ -132,12 +128,10 @@ public void testConfirmListenerRecovery() throws IOException, InterruptedExcepti
132128 int n = 3 ;
133129 final CountDownLatch latch = new CountDownLatch (n );
134130 channel .addConfirmListener (new ConfirmListener () {
135- @ Override
136131 public void handleAck (long deliveryTag , boolean multiple ) throws IOException {
137132 latch .countDown ();
138133 }
139134
140- @ Override
141135 public void handleNack (long deliveryTag , boolean multiple ) throws IOException {
142136 latch .countDown ();
143137 }
@@ -312,7 +306,7 @@ public void handleDelivery(String consumerTag,
312306 if (consumed .intValue () > 0 && consumed .intValue () % 4 == 0 ) {
313307 CountDownLatch recoveryLatch = prepareForRecovery (connection );
314308 Host .closeConnection ((AutorecoveringConnection )connection );
315- recoveryLatch . await ( 30 , TimeUnit . MINUTES );
309+ ConnectionRecovery . wait ( recoveryLatch );
316310 }
317311 channel .basicAck (envelope .getDeliveryTag (), false );
318312 } catch (InterruptedException e ) {
@@ -353,7 +347,6 @@ private void expectQueueRecovery(Channel ch, String q) throws IOException, Inter
353347 private CountDownLatch prepareForRecovery (Connection conn ) {
354348 final CountDownLatch latch = new CountDownLatch (1 );
355349 ((AutorecoveringConnection )conn ).addRecoveryListener (new RecoveryListener () {
356- @ Override
357350 public void handleRecovery (Recoverable recoverable ) {
358351 latch .countDown ();
359352 }
@@ -364,7 +357,6 @@ public void handleRecovery(Recoverable recoverable) {
364357 private CountDownLatch prepareForShutdown (Connection conn ) throws InterruptedException {
365358 final CountDownLatch latch = new CountDownLatch (1 );
366359 conn .addShutdownListener (new ShutdownListener () {
367- @ Override
368360 public void shutdownCompleted (ShutdownSignalException cause ) {
369361 latch .countDown ();
370362 }
@@ -427,10 +419,10 @@ private ConnectionFactory buildConnectionFactoryWithRecoveryEnabled(boolean disa
427419 return cf ;
428420 }
429421
430- private void wait (CountDownLatch latch ) throws InterruptedException {
422+ private static void wait (CountDownLatch latch ) throws InterruptedException {
431423 // Very very generous amount of time to wait, just make sure we never
432424 // hang forever
433- assertTrue (latch .await (30 , TimeUnit .MINUTES ));
425+ assertTrue (latch .await (1800 , TimeUnit .SECONDS ));
434426 }
435427
436428 private void waitForConfirms (Channel ch ) throws InterruptedException , TimeoutException {
0 commit comments