Assert.assertEquals(0, queue.getMessageCount());
}
public void testHashMatch() throws AMQException
{
AMQQueue queue = _vhost.createQueue(UUIDGenerator.generateRandomUUID(), "a#", false, null, false, false, false, null);
_exchange.registerQueue(new Binding(null, "a.#",queue, _exchange, null));
routeMessage("a.b.c",0l);
Assert.assertEquals(1, queue.getMessageCount());
Assert.assertEquals("Wrong message received", 0l, queue.getMessagesOnTheQueue().get(0).getMessage().getMessageNumber());
queue.deleteMessageFromTop();
Assert.assertEquals(0, queue.getMessageCount());
routeMessage("a.b",1l);
Assert.assertEquals(1, queue.getMessageCount());
Assert.assertEquals("Wrong message received", 1l, queue.getMessagesOnTheQueue().get(0).getMessage().getMessageNumber());
queue.deleteMessageFromTop();
Assert.assertEquals(0, queue.getMessageCount());
routeMessage("a.c",2l);
Assert.assertEquals(1, queue.getMessageCount());
Assert.assertEquals("Wrong message received", 2l, queue.getMessagesOnTheQueue().get(0).getMessage().getMessageNumber());
queue.deleteMessageFromTop();
Assert.assertEquals(0, queue.getMessageCount());
routeMessage("a",3l);
Assert.assertEquals(1, queue.getMessageCount());
Assert.assertEquals("Wrong message received", 3l, queue.getMessagesOnTheQueue().get(0).getMessage().getMessageNumber());
queue.deleteMessageFromTop();
Assert.assertEquals(0, queue.getMessageCount());
int queueCount = routeMessage("b", 4l);
Assert.assertEquals("Message should not route to any queues", 0, queueCount);
Assert.assertEquals(0, queue.getMessageCount());
}