public void testHeadersExchangeMBean() throws Exception
{
HeadersExchange exchange = new HeadersExchange();
exchange.initialise(_virtualHost,ExchangeDefaults.HEADERS_EXCHANGE_NAME, false, 0, true);
ManagedObject managedObj = exchange.getManagedObject();
ManagedExchange mbean = (ManagedExchange)managedObj;
mbean.createNewBinding(_queue.getNameShortString().toString(), "key1=binding1,key2=binding2");
mbean.createNewBinding(_queue.getNameShortString().toString(), "key3=binding3");
TabularData data = mbean.bindings();
ArrayList<Object> list = new ArrayList<Object>(data.values());
assertTrue(list.size() == 2);
// test general exchange properties
assertEquals(mbean.getName(), "amq.match");
assertEquals(mbean.getExchangeType(), "headers");
assertTrue(mbean.getTicketNo() == 0);
assertTrue(!mbean.isDurable());
assertTrue(mbean.isAutoDelete());
}