Skip to content

Commit 615ed42

Browse files
committed
permit 0 in x-message-ttl, and test for that
1 parent 82ae95f commit 615ed42

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,18 @@ public void testCreateQueueTTLTypes() throws IOException {
6060
}
6161
}
6262

63-
public void testCreateQueueWithInvalidTTL() throws Exception {
63+
public void testTTLAllowZero() throws Exception {
6464
try {
65-
declareQueue(TTL_INVALID_QUEUE_NAME, "foobar");
66-
fail("Should not be able to declare a queue with a non-long value for x-message-ttl");
65+
declareQueue(0);
6766
} catch (IOException e) {
68-
checkShutdownSignal(AMQP.PRECONDITION_FAILED, e);
67+
fail("Should be able to declare a queue with zero for x-message-ttl");
6968
}
7069
}
7170

72-
public void testTTLMustBeGtZero() throws Exception {
71+
public void testCreateQueueWithInvalidTTL() throws Exception {
7372
try {
74-
declareQueue(TTL_INVALID_QUEUE_NAME, 0);
75-
fail("Should not be able to declare a queue with zero for x-message-ttl");
73+
declareQueue(TTL_INVALID_QUEUE_NAME, "foobar");
74+
fail("Should not be able to declare a queue with a non-long value for x-message-ttl");
7675
} catch (IOException e) {
7776
checkShutdownSignal(AMQP.PRECONDITION_FAILED, e);
7877
}
@@ -130,7 +129,6 @@ public void testPublishAndGetWithExpiry() throws Exception {
130129

131130
assertEquals(MSG[1], get());
132131
assertEquals(MSG[2], get());
133-
134132
}
135133

136134
/*

0 commit comments

Comments
 (0)