Skip to content

Commit 7769e36

Browse files
author
Alexandru Scvortov
committed
test checks for sse code instead of exception text
1 parent d93dcbe commit 7769e36

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
import com.rabbitmq.client.ShutdownSignalException;
3737
import com.rabbitmq.client.test.BrokerTestCase;
3838

39+
/* Declare an exchange, bind a queue to it, then try to delete it,
40+
* setting if-unused to true. This should throw an exception. */
3941
public class ExchangeDeleteIfUnused extends BrokerTestCase {
4042
private final static String EXCHANGE_NAME = "xchg1";
4143
private final static String ROUTING_KEY = "something";
@@ -56,17 +58,14 @@ protected void releaseResources()
5658
super.releaseResources();
5759
}
5860

61+
/* Attempt to Exchange.Delete(ifUnused = true) a used exchange.
62+
* Should throw an exception. */
5963
public void testExchangeDelete() {
6064
try {
61-
// exchange.delete(ifUnused = true)
62-
// should throw a channel exception if the exchange is being used
6365
channel.exchangeDelete(EXCHANGE_NAME, true);
6466
fail("Exception expected if exchange in use");
6567
} catch (IOException e) {
66-
Throwable t = e.getCause();
67-
assertTrue("Exception should be a ShutdownSignalException",
68-
t instanceof ShutdownSignalException);
69-
assertTrue("Exception should contain ``in use''", t.getMessage().toLowerCase().contains("in use"));
68+
checkShutdownSignal(406, e);
7069
}
7170
}
7271
}

0 commit comments

Comments
 (0)