Skip to content

Commit dedc3f9

Browse files
committed
Catch also shutdown exception
(cherry picked from commit 251c8c5)
1 parent c9761b2 commit dedc3f9

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved.
1+
// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved.
22
//
33
// This software, the RabbitMQ Java client library, is triple-licensed under the
44
// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved.
1+
// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved.
22
//
33
// This software, the RabbitMQ Java client library, is triple-licensed under the
44
// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2
@@ -71,7 +71,6 @@ protected AMQP.Queue.DeclareOk declareQueue(String name, Object ttlValue) throws
7171
.builder()
7272
.expiration(expiryDelay)
7373
.build(), new byte[]{});
74-
long expiryStartTime = System.currentTimeMillis();
7574
restart();
7675
Thread.sleep(Integer.parseInt(expiryDelay));
7776
try {

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import static org.junit.Assert.assertNull;
2121
import static org.junit.Assert.fail;
2222

23+
import com.rabbitmq.client.ShutdownSignalException;
2324
import java.io.IOException;
2425

2526
import org.junit.Test;
@@ -67,6 +68,8 @@ protected void releaseResources() throws IOException {
6768
fail("Should not be able to set TTL using non-numeric values");
6869
} catch (IOException e) {
6970
checkShutdownSignal(AMQP.PRECONDITION_FAILED, e);
71+
} catch (ShutdownSignalException e) {
72+
checkShutdownSignal(AMQP.PRECONDITION_FAILED, e);
7073
}
7174
}
7275

@@ -77,16 +80,20 @@ protected void releaseResources() throws IOException {
7780
fail("Should not be able to set TTL using non-numeric values");
7881
} catch (IOException e) {
7982
checkShutdownSignal(AMQP.PRECONDITION_FAILED, e);
83+
} catch (ShutdownSignalException e) {
84+
checkShutdownSignal(AMQP.PRECONDITION_FAILED, e);
8085
}
8186
}
8287

83-
@Test public void tTLMustBePositive() throws Exception {
88+
@Test public void tTLMustBePositive() {
8489
try {
8590
declareAndBindQueue(-10);
8691
publishAndSync(MSG[0]);
8792
fail("Should not be able to set TTL using negative values");
8893
} catch (IOException e) {
8994
checkShutdownSignal(AMQP.PRECONDITION_FAILED, e);
95+
} catch (ShutdownSignalException e) {
96+
checkShutdownSignal(AMQP.PRECONDITION_FAILED, e);
9097
}
9198
}
9299

0 commit comments

Comments
 (0)