Skip to content

Commit 585aac2

Browse files
author
Matthias Radestock
committed
slightly more helpful test failure messages for permission tests
1 parent 83ce0b4 commit 585aac2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,18 +243,20 @@ protected void runTest(boolean expC, boolean expW, boolean expR,
243243
protected void runTest(boolean exp, String name, WithName test)
244244
throws IOException
245245
{
246+
String msg = "'" + name + "' -> " + exp;
246247
try {
247248
test.with(name);
248-
assertTrue(exp);
249+
assertTrue(msg, exp);
249250
} catch (IOException e) {
250-
assertFalse(exp);
251+
assertFalse(msg, exp);
251252
Throwable t = e.getCause();
252-
assertTrue(t instanceof ShutdownSignalException);
253+
assertTrue(msg, t instanceof ShutdownSignalException);
253254
Object r = ((ShutdownSignalException)t).getReason();
254-
assertTrue(r instanceof Command);
255+
assertTrue(msg, r instanceof Command);
255256
Method m = ((Command)r).getMethod();
256-
assertTrue(m instanceof AMQP.Channel.Close);
257-
assertEquals(AMQP.ACCESS_REFUSED,
257+
assertTrue(msg, m instanceof AMQP.Channel.Close);
258+
assertEquals(msg,
259+
AMQP.ACCESS_REFUSED,
258260
((AMQP.Channel.Close)m).getReplyCode());
259261
//This fails due to bug 20296
260262
//openChannel();

0 commit comments

Comments
 (0)