Skip to content

Commit fb4881f

Browse files
author
Alexandru Scvortov
committed
improved failure messages
1 parent 7579dfc commit fb4881f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,10 @@ public void testExchangeDelete() {
6565
channel.exchangeDelete(ExchangeName, true);
6666
fail("Exception expected if exchange in use");
6767
} catch (IOException e) {
68-
assertTrue("Should be com.rabbitmq.client.ShutdownSignalException",
69-
e.getCause() instanceof ShutdownSignalException);
70-
String msg = e.getCause().getMessage();
71-
assertTrue("Exception should contain ``in use''", msg.toLowerCase().contains("in use"));
72-
// ok
68+
Throwable t = e.getCause();
69+
assertTrue("Exception should be a ShutdownSignalException",
70+
t instanceof ShutdownSignalException);
71+
assertTrue("Exception should contain ``in use''", t.getMessage().toLowerCase().contains("in use"));
7372
}
7473
}
7574
}

0 commit comments

Comments
 (0)