VirtualHostRegistry virtualHostRegistry = reg.getVirtualHostRegistry();
assertEquals("Incorrect virtualhost count", 2, virtualHostRegistry.getVirtualHosts().size());
// test topic host
VirtualHost topicVirtualHost = virtualHostRegistry.getVirtualHost("topic");
Exchange topicExchange = topicVirtualHost.getExchangeRegistry().getExchange(new AMQShortString("test.topic"));
assertEquals("Incorrect topic virtualhost name", "topic", topicVirtualHost.getName());
assertEquals("Incorrect topic exchange type", "topic", topicExchange.getType().getName().toString());
// Test fanout host
VirtualHost fanoutVirtualHost = virtualHostRegistry.getVirtualHost("fanout");
Exchange fanoutExchange = fanoutVirtualHost.getExchangeRegistry().getExchange(new AMQShortString("test.fanout"));
assertEquals("Incorrect fanout virtualhost name", "fanout", fanoutVirtualHost.getName());
assertEquals("Incorrect fanout exchange type", "fanout", fanoutExchange.getType().getName().toString());
}