8000 Fixes rebuild from scratch · panchenko/rabbitmq-java-client@335c161 · GitHub
[go: up one dir, main page]

Skip to content

Commit 335c161

Browse files
Fixes rebuild from scratch
1 parent 992a32d commit 335c161

15 files changed

+36
-23
lines changed

src/com/rabbitmq/client/impl/DefaultExceptionHandler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import java.io.IOException;
2020
import java.net.ConnectException;
21+
import java.util.concurrent.TimeoutException;
2122

2223
import com.rabbitmq.client.AMQP;
2324
import com.rabbitmq.client.AlreadyClosedException;
@@ -106,6 +107,8 @@ protected void handleChannelKiller(Channel channel, Throwable exception, String
106107
channel.close(AMQP.REPLY_SUCCESS, "Closed due to exception from " + what);
107108
} catch (AlreadyClosedException ace) {
108109
// noop
110+
} catch (TimeoutException ace) {
111+
// noop
109112
} catch (IOException ioe) {
110113
// TODO: log the failure
111114
System.err.println("Failure during close of channel " + channel + " after " + exception

src/com/rabbitmq/client/impl/recovery/AutorecoveringChannel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ public Channel getDelegate() {
5757
return delegate;
5858
}
5959

60-
public void close() throws IOException {
60+
public void close() throws IOException, TimeoutException {
6161
try {
6262
delegate.close();
6363
} finally {
6464
this.connection.unregisterChannel(this);
6565
}
6666
}
6767

68-
public void close(int closeCode, String closeMessage) throws IOException {
68+
public void close(int closeCode, String closeMessage) throws IOException, TimeoutException {
6969
try {
7070
delegate.close(closeCode, closeMessage);
7171
} finally {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.rabbitmq.client.test.BrokerTestCase;
66

77
import java.io.IOException;
8+
import java.util.concurrent.TimeoutException;
89

910
public class BasicGet extends BrokerTestCase {
1011
public void testBasicGetWithEnqueuedMessages() throws IOException, InterruptedException {
@@ -28,7 +29,7 @@ public void testBasicGetWithEmptyQueue() throws IOException, InterruptedExceptio
2829
channel.queueDelete(q);
2930
}
3031

31-
public void testBasicGetWithClosedChannel() throws IOException, InterruptedException {
32+
public void testBasicGetWithClosedChannel() throws IOException, InterruptedException, TimeoutException {
3233
assertTrue(channel.isOpen());
3334
String q = channel.queueDeclare().getQueue();
3435

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ private boolean clustered(Connection c1, Connection c2) throws IOException {
9797
}
9898

9999
ch1.queueDelete(q);
100-
ch1.close();
101-
ch2.close();
100+
ch1.abort();
101+
ch2.abort();
102102

103103
return true;
104104
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.util.Map;
3232
import java.util.SortedSet;
3333
import java.util.TreeSet;
34+
import java.util.concurrent.TimeoutException;
3435

3536
public class Confirm extends BrokerTestCase
3637
{
@@ -242,8 +243,7 @@ public void testWaitForConfirmsWithoutConfirmSelected()
242243
}
243244

244245
public void testWaitForConfirmsException()
245-
throws IOException, InterruptedException
246-
{
246+
throws IOException, InterruptedException, TimeoutException {
247247
publishN("", "confirm-test", true, false);
248248
channel.close();
249249
try {

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ public void queueRecovered(String oldName, String newName) {
276276
ch.exchangeDelete(x);
277277
}
278278

279-
public void testDeclarationOfManyAutoDeleteQueuesWithTransientConsumer() throws IOException {
279+
public void testDeclarationOfManyAutoDeleteQueuesWithTransientConsumer() throws IOException, TimeoutException {
280280
Channel ch = connection.createChannel();
281281
assertRecordedQueues(connection, 0);
282282
for(int i = 0; i < 5000; i++) {
@@ -290,7 +290,7 @@ public void testDeclarationOfManyAutoDeleteQueuesWithTransientConsumer() throws
290290
ch.close();
291291
}
292292

293-
public void testDeclarationOfManyAutoDeleteExchangesWithTransientQueuesThatAreUnbound() throws IOException {
293+
public void testDeclarationOfManyAutoDeleteExchangesWithTransientQueuesThatAreUnbound() throws IOException, TimeoutException {
294294
Channel ch = connection.createChannel();
295295
assertRecordedExchanges(connection, 0);
296296
for(int i = 0; i < 5000; i++) {
@@ -306,7 +306,7 @@ public void testDeclarationOfManyAutoDeleteExchangesWithTransientQueuesThatAreUn
306306
ch.close();
307307
}
308308

309-
public void testDeclarationOfManyAutoDeleteExchangesWithTransientQueuesThatAreDeleted() throws IOException {
309+
public void testDeclarationOfManyAutoDeleteExchangesWithTransientQueuesThatAreDeleted() throws IOException, TimeoutException {
310310
Channel ch = connection.createChannel();
311311
assertRecordedExchanges(connection, 0);
312312
for(int i = 0; i < 5000; i++) {
@@ -320,7 +320,7 @@ public void testDeclarationOfManyAutoDeleteExchangesWithTransientQueuesThatAreDe
320320
ch.close();
321321
}
322322

323-
public void testDeclarationOfManyAutoDeleteExchangesWithTransientExchangesThatAreUnbound() throws IOException {
323+
public void testDeclarationOfManyAutoDeleteExchangesWithTransientExchangesThatAreUnbound() throws IOException, TimeoutException {
324324
Channel ch = connection.createChannel();
325325
assertRecordedExchanges(connection, 0);
326326
for(int i = 0; i < 5000; i++) {
@@ -337,7 +337,7 @@ public void testDeclarationOfManyAutoDeleteExchangesWithTransientExchangesThatAr
337337
ch.close();
338338
}
339339

340-
public void testDeclarationOfManyAutoDeleteExchangesWithTransientExchangesThatAreDeleted() throws IOException {
340+
public void testDeclarationOfManyAutoDeleteExchangesWithTransientExchangesThatAreDeleted() throws IOException, TimeoutException {
341341
Channel ch = connection.createChannel();
342342
assertRecordedExchanges(connection, 0);
343343
for(int i = 0; i < 5000; i++) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void testAlreadyClosedExceptionMessageWithCleanClose() throws IOException
2828
String uuid = UUID.randomUUID().toString();
2929

3030
try {
31-
channel.close();
31+
channel.abort();
3232
channel.queueDeclare(uuid, false, false, false, null);
3333
} catch (AlreadyClosedException ace) {
3434
assertTrue(ace.getMessage().startsWith("channel is already closed due to clean channel shutdown"));

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ private void failBind(String queue, HashMap<String, Object> arguments) {
4343
private void succeedBind(String queue, HashMap<String, Object> arguments) throws IOException {
4444
Channel ch = connection.createChannel();
4545
ch.queueBind(queue, "amq.headers", "", arguments);
46-
ch.close();
46+
ch.abort();
4747
}
4848
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ public void testLimitingMultipleChannels()
316316
ackDelivery(ch2, d2.remove(0), true);
317317
drain(c1, 1);
318318
drain(c2, 1);
319-
ch1.close();
320-
ch2.close();
319+
ch1.abort();
320+
ch2.abort();
321321
}
322322

323323
public void testLimitInheritsUnackedCount()

test/src/com/rabbitmq/client/test/server/Bug19219Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public void run() {
112112
//notifications timing out.
113113
boolean success = false;
114114
try {
115-
channel.close();
115+
channel.abort();
116116
success = true;
117117
} catch (ShutdownSignalException e) {
118118
} finally {

test/src/com/rabbitmq/examples/ConsumerMain.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.io.FileOutputStream;
2323
import java.io.IOException;
2424
import java.io.PrintStream;
25+
import java.util.concurrent.TimeoutException;
2526

2627
import com.rabbitmq.client.AMQP;
2728
import com.rabbitmq.client.Channel;
@@ -93,10 +94,14 @@ public void run() {
9394
System.err.println("hit IOException in ConsumerMain: trace follows");
9495
ex.printStackTrace();
9596
throw new RuntimeException(ex);
97+
} catch (TimeoutException ex) {
98+
System.err.println("hit IOException in ConsumerMain: trace follows");
99+
ex.printStackTrace();
100+
throw new RuntimeException(ex);
96101
}
97102
}
98103

99-
private void runIt() throws IOException {
104+
private void runIt() throws IOException, TimeoutException {
100105
Channel channel = _connection.createChannel();
101106

102107
String queueName = "test queue";

test/src/com/rabbitmq/examples/ProducerMain.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.io.ByteArrayOutputStream;
2020
import java.io.DataOutputStream;
2121
import java.io.IOException;
22+
import java.util.concurrent.TimeoutException;
2223

2324
import com.rabbitmq.client.Channel;
2425
import com.rabbitmq.client.Connection;
@@ -128,9 +129,12 @@ public void run() {
128129
} catch (IOException ex) {
129130
throw new RuntimeException(ex); // wrap and re-throw
130131
}
132+
catch (TimeoutException ex) {
133+
throw new RuntimeException(ex);
134+
}
131135
}
132136

133-
private void runIt() throws IOException {
137+
private void runIt() throws IOException, TimeoutException {
134138
_channel = _connection.createChannel();
135139

136140
String queueName = "test queue";

test/src/com/rabbitmq/examples/StressPersister.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public void publishOneInOneOutReceive(int backlogSize, int bodySize, int repeatC
204204
redeclare(q, chan);
205205

206206
trace("Closing connection");
207-
chan.close();
207+
chan.abort();
208208
conn.close();
209209

210210
trace("Sample results (timestamp in milliseconds since epoch; microseconds/roundtrip)");

test/src/com/rabbitmq/examples/TestMain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public void run() throws IOException {
270270
sendLotsOfTrivialMessages(batchSize, queueName);
271271
expect(batchSize, drain(batchSize, queueName, true));
272272

273-
_ch1.close();
273+
_ch1.abort();
274274

275275
log("Closing.");
276276
try {

test/src/com/rabbitmq/examples/perf/MulticastParams.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public String configureQueue(Connection connection, String id) throws IOExceptio
217217
null).getQueue();
218218
}
219219
channel.queueBind(qName, exchangeName, id);
220-
channel.close();
220+
channel.abort();
221221
return qName;
222222
}
223223

@@ -245,7 +245,7 @@ private static boolean exists(Connection connection, Checker checker) throws IOE
245245
try {
246246
Channel ch = connection.createChannel();
247247
checker.check(ch);
248-
ch.close();
248+
ch.abort();
249249
return true;
250250
}
251251
catch (IOException e) {

0 commit comments

Comments
 (0)
0