public void testCreateConnectionFactoryMultipleConnectorsOverrideAndParams()
{
HornetQResourceAdapter ra = new HornetQResourceAdapter();
ra.setConnectorClassName(NETTY_CONNECTOR_FACTORY + "," + INVM_CONNECTOR_FACTORY + "," + NETTY_CONNECTOR_FACTORY);
ra.setConnectionParameters("host=host1;port=5445, serverid=0, host=host2;port=5446");
ConnectionFactoryProperties overrideProperties = new ConnectionFactoryProperties();
ArrayList<String> value = new ArrayList<String>();
value.add(INVM_CONNECTOR_FACTORY);
value.add(NETTY_CONNECTOR_FACTORY);
value.add(INVM_CONNECTOR_FACTORY);
overrideProperties.setParsedConnectorClassNames(value);
ArrayList<Map<String, Object>> connectionParameters = new ArrayList<Map<String, Object>>();
Map<String, Object> map1 = new HashMap<String, Object>();
map1.put("serverid", "0");
connectionParameters.add(map1);
Map<String, Object> map2 = new HashMap<String, Object>();
map2.put("host", "myhost");
map2.put("port", "5445");
connectionParameters.add(map2);
Map<String, Object> map3 = new HashMap<String, Object>();
map3.put("serverid", "1");
connectionParameters.add(map3);
overrideProperties.setParsedConnectionParameters(connectionParameters);
HornetQConnectionFactory factory = ra.createHornetQConnectionFactory(overrideProperties);
TransportConfiguration[] configurations = factory.getServerLocator().getStaticTransportConfigurations();
assertNotNull(configurations);
assertEquals(3, configurations.length);
assertEquals(INVM_CONNECTOR_FACTORY, configurations[0].getFactoryClassName());