protected void routeAndTest(Message m, boolean expectReturn, List<TestQueue> expected) throws AMQException { int queueCount = route(m); for (TestQueue q : queues) { if (expected.contains(q)) { assertTrue("Expected " + m + " to be delivered to " + q, q.isInQueue(m)); // assert m.isInQueue(q) : "Expected " + m + " to be delivered to " + q; } else { assertFalse("Did not expect " + m + " to be delivered to " + q, q.isInQueue(m)); // assert !m.isInQueue(q) : "Did not expect " + m + " to be delivered to " + q; } } if (expectReturn) { assertEquals( "Expected " + m + " to be returned due to manadatory flag, and lack of routing", 0, queueCount); } }
protected void unbind(TestQueue queue, String... bindings) throws AMQException { String queueName = queue.getName(); // TODO - check this exchange.onUnbind(new Binding(null, queueName, queue, exchange, getHeadersMap(bindings))); }