ApplicationRegistry.remove();
ApplicationRegistry reg = new ConfigurationFileApplicationRegistry(mainFile);
ApplicationRegistry.initialise(reg);
// Test config
VirtualHostRegistry virtualHostRegistry = reg.getVirtualHostRegistry();
String defaultVirtualHost = reg.getConfiguration().getDefaultVirtualHost();
VirtualHost virtualHost = virtualHostRegistry.getVirtualHost("test");
Exchange exchange = virtualHost.getExchangeRegistry().getExchange(new AMQShortString("test.topic"));
assertEquals("Incorrect default host", "test", defaultVirtualHost);
assertEquals("Incorrect virtualhost count", 1, virtualHostRegistry.getVirtualHosts().size());
assertEquals("Incorrect virtualhost name", "test", virtualHost.getName());
assertEquals("Incorrect exchange type", "topic", exchange.getType().getName().toString());
}