Skip to content

Commit 8b8af63

Browse files
author
Simon MacMullen
committed
Further adventures in 1.5 compatibility - remove more interface @OVERRIDES and TimeUnit only knows about seconds and their subdivisions.
1 parent c008d50 commit 8b8af63

File tree

3 files changed

+3
-16
lines changed

3 files changed

+3
-16
lines changed

test/src/com/rabbitmq/client/test/AMQConnectionTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,10 @@ public void flush() throws IOException {
207207
// no need to implement this: don't bother writing the frame
208208
}
209209

210-
@Override
211210
public InetAddress getLocalAddress() {
212211
return null;
213212
}
214213

215-
@Override
216214
public int getLocalPort() {
217215
return -1;
218216
}
@@ -259,7 +257,6 @@ public void handleChannelRecoveryException(Channel ch, Throwable ex) {
259257
_handledExceptions.add(ex);
260258
}
261259

262-
@Override
263260
public void handleTopologyRecoveryException(Connection conn, Channel ch, TopologyRecoveryException ex) {
264261
_handledExceptions.add(ex);
265262
}

test/src/com/rabbitmq/client/test/BrokenFramesTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,10 @@ public void flush() throws IOException {
158158
// no need to implement this: don't bother writing the frame
159159
}
160160

161-
@Override
162161
public InetAddress getLocalAddress() {
163162
return null;
164163
}
165164

166-
@Override
167165
public int getLocalPort() {
168166
return -1;
169167
}

test/src/com/rabbitmq/client/test/functional/ConnectionRecovery.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)