Skip to content

Commit fa08487

Browse files
author
Matthew Sackman
committed
Add checks for shutdown signals in appropriate places
1 parent 3846de0 commit fa08487

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import java.util.HashMap;
3636
import java.util.Map;
3737

38+
import com.rabbitmq.client.AMQP;
3839
import com.rabbitmq.client.test.BrokerTestCase;
3940

4041
public class QueueLease extends BrokerTestCase {
@@ -78,6 +79,7 @@ public void testExpireMustBeLong() throws IOException {
7879
args);
7980
fail("server accepted x-expires not of type long");
8081
} catch (IOException e) {
82+
checkShutdownSignal(AMQP.PRECONDITION_FAILED, e);
8183
}
8284
}
8385

@@ -90,6 +92,7 @@ public void testExpireMustBeGtZero() throws IOException {
9092
args);
9193
fail("server accepted x-expires of zero ms.");
9294
} catch (IOException e) {
95+
checkShutdownSignal(AMQP.PRECONDITION_FAILED, e);
9396
}
9497
}
9598

@@ -102,6 +105,7 @@ public void testExpireMustBePositive() throws IOException {
102105
args);
103106
fail("server accepted negative x-expires.");
104107
} catch (IOException e) {
108+
checkShutdownSignal(AMQP.PRECONDITION_FAILED, e);
105109
}
106110
}
107111

@@ -123,6 +127,7 @@ public void testQueueRedeclareEquivalence() throws IOException {
123127
false, args2);
124128
fail("Able to redeclare queue with mismatching expire flags.");
125129
} catch (IOException e) {
130+
checkShutdownSignal(AMQP.NOT_ALLOWED, e);
126131
}
127132
}
128133

@@ -151,7 +156,9 @@ void verifyQueueExpires(String name, boolean expire) throws IOException,
151156
fail("Queue should have been expired by now.");
152157
}
153158
} catch (IOException e) {
154-
if (!expire) {
159+
if (expire) {
160+
checkShutdownSignal(AMQP.NOT_FOUND, e);
161+
} else {
155162
fail("Queue without expire flag deleted.");
156163
}
157164
}

0 commit comments

Comments
 (0)