Skip to content

Commit aa34beb

Browse files
author
Simon MacMullen
committed
Add more uses of checkShutdownSignal().
1 parent c26df22 commit aa34beb

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

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

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -193,17 +193,7 @@ public void testExchangePassiveDeclare() throws IOException {
193193
fail("Passive declare of an unknown exchange should fail");
194194
}
195195
catch (IOException ioe) {
196-
Throwable t = ioe.getCause();
197-
String msg = "Passive declare of an unknown exchange should send a 404";
198-
assertTrue(msg, t instanceof ShutdownSignalException);
199-
Object r = ((ShutdownSignalException)t).getReason();
200-
assertTrue(msg, r instanceof Command);
201-
Method m = ((Command)r).getMethod();
202-
assertTrue(msg, m instanceof AMQP.Channel.Close);
203-
assertEquals(msg,
204-
AMQP.NOT_FOUND,
205-
((AMQP.Channel.Close)m).getReplyCode());
206-
return;
196+
checkShutdownSignal(AMQP.NOT_FOUND, ioe);
207197
}
208198
}
209199

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import java.io.IOException;
3535
import java.util.HashMap;
3636

37+
import com.rabbitmq.client.AMQP;
3738
import com.rabbitmq.client.Channel;
3839
import com.rabbitmq.client.Connection;
3940
import com.rabbitmq.client.ConnectionFactory;
@@ -55,7 +56,7 @@ void verifyQueueMissing(Channel channel, String queueName)
5556
try {
5657
channel.queueDeclare(queueName, false, false, false, null);
5758
} catch (IOException ioe) {
58-
// FIXME check that it's specifically resource locked
59+
checkShutdownSignal(AMQP.RESOURCE_LOCKED, ioe);
5960
fail("Declaring the queue resulted in a channel exception, probably meaning that it already exists");
6061
}
6162
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ public void testAuth()
148148
unAuthFactory.newConnection();
149149
fail("Exception expected if password is wrong");
150150
} catch (IOException e) {
151-
String msg = e.getMessage();
152-
assertTrue("Exception message should contain auth", msg.toLowerCase().contains("auth"));
151+
checkShutdownSignal(AMQP.NOT_ALLOWED, e);
153152
}
154153
}
155154

0 commit comments

Comments
 (0)