}
public void testMatchafterHash() throws AMQException
{
AMQQueue queue = _vhost.createQueue(UUIDGenerator.generateRandomUUID(), "a#", false, null, false, false,
false, null);
_exchange.registerQueue(new Binding(null, "a.*.#.b.c",queue, _exchange, null));
int queueCount = routeMessage("a.c.b.b",0l);
Assert.assertEquals("Message should not route to any queues", 0, queueCount);
Assert.assertEquals(0, queue.getMessageCount());
routeMessage("a.a.b.c",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());
queueCount = routeMessage("a.b.c.b",2l);
Assert.assertEquals("Message should not route to any queues", 0, queueCount);
Assert.assertEquals(0, queue.getMessageCount());
routeMessage("a.b.c.b.c",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());
}