public void testAttributes() throws Exception
{
TransportConfiguration connectorConfiguration = new TransportConfiguration(NettyConnectorFactory.class.getName());
List<String> connectorInfos = new ArrayList<String>();
connectorInfos.add(connectorConfiguration.getName());
BroadcastGroupConfiguration broadcastGroupConfig = BroadcastGroupControlTest.randomBroadcastGroupConfiguration(connectorInfos);
Configuration conf = createBasicConfig();
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.setClustered(true);
conf.getConnectorConfigurations().put(connectorConfiguration.getName(), connectorConfiguration);
conf.getBroadcastGroupConfigurations().add(broadcastGroupConfig);
conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
service = HornetQServers.newHornetQServer(conf, mbeanServer, false);
service.start();
BroadcastGroupControl broadcastGroupControl = createManagementControl(broadcastGroupConfig.getName());
Assert.assertEquals(broadcastGroupConfig.getName(), broadcastGroupControl.getName());
Assert.assertEquals(broadcastGroupConfig.getGroupAddress(), broadcastGroupControl.getGroupAddress());
Assert.assertEquals(broadcastGroupConfig.getGroupPort(), broadcastGroupControl.getGroupPort());
Assert.assertEquals(broadcastGroupConfig.getLocalBindPort(), broadcastGroupControl.getLocalBindPort());
Assert.assertEquals(broadcastGroupConfig.getBroadcastPeriod(), broadcastGroupControl.getBroadcastPeriod());
Object[] connectorPairs = broadcastGroupControl.getConnectorPairs();
Assert.assertEquals(1, connectorPairs.length);
System.out.println(connectorPairs);
String connectorPairData = (String)connectorPairs[0];
Assert.assertEquals(broadcastGroupConfig.getConnectorInfos().get(0), connectorPairData);
String jsonString = broadcastGroupControl.getConnectorPairsAsJSON();
Assert.assertNotNull(jsonString);
JSONArray array = new JSONArray(jsonString);
Assert.assertEquals(1, array.length());
Assert.assertEquals(broadcastGroupConfig.getConnectorInfos().get(0), array.getString(0));
Assert.assertTrue(broadcastGroupControl.isStarted());
}