ObjectName cf3 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory3", name3, "/TestConnectionFactory3", "clientid3");
//Last one shares the same connector
ObjectName cf4 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory4", name3, "/TestConnectionFactory4", "clientid4");
JBossConnectionFactory f1 = (JBossConnectionFactory)initialContext.lookup("/TestConnectionFactory1");
ClientConnectionFactoryDelegate del1 = (ClientConnectionFactoryDelegate)f1.getDelegate();
assertTrue(del1.getServerLocatorURI().startsWith("socket://localhost:1234"));
JBossConnectionFactory f2 = (JBossConnectionFactory)initialContext.lookup("/TestConnectionFactory2");
ClientConnectionFactoryDelegate del2 = (ClientConnectionFactoryDelegate)f2.getDelegate();
assertTrue(del2.getServerLocatorURI().startsWith("socket://localhost:1235"));
JBossConnectionFactory f3 = (JBossConnectionFactory)initialContext.lookup("/TestConnectionFactory3");
ClientConnectionFactoryDelegate del3 = (ClientConnectionFactoryDelegate)f3.getDelegate();
assertTrue(del3.getServerLocatorURI().startsWith("socket://localhost:1236"));
JBossConnectionFactory f4 = (JBossConnectionFactory)initialContext.lookup("/TestConnectionFactory4");
ClientConnectionFactoryDelegate del4 = (ClientConnectionFactoryDelegate)f4.getDelegate();
assertTrue(del4.getServerLocatorURI().startsWith("socket://localhost:1236"));
Connection con1 = f1.createConnection();
Connection con2 = f2.createConnection();
Connection con3 = f3.createConnection();
Connection con4 = f4.createConnection();
con1.close();
con2.close();
con3.close();
con4.close();
stopService(cf1);
stopService(cf2);
stopService(cf3);
//Check f4 is still ok
Connection conn5 = f4.createConnection();
conn5.close();
stopService(cf4);
stopService(c1);