public void testUpdateConnectionFactoryWithNoInitialConnections() throws Exception
{
try
{
ClientClusteredConnectionFactoryDelegate clusterDelegate = (ClientClusteredConnectionFactoryDelegate)this.cf.getDelegate();
//JBossConnectionFactory cf2 = (JBossConnectionFactory)ic[0].lookup("/ClusteredConnectionFactory");
//ClientClusteredConnectionFactoryDelegate clusterDelegate2 = (ClientClusteredConnectionFactoryDelegate)cf2.getDelegate();
//We kill all the servers - this tests the connection factory's ability to create a first connection
//when its entire cached set of delegates is stale
startDefaultServer(2, currentOverrides, false);
assertEquals(3, clusterDelegate.getDelegates().length);
// assertEquals(3, clusterDelegate2.getDelegates().length);
log.info("#################################### Killing server 1 and 0");
ServerManagement.log(ServerManagement.INFO, "Killing server1", 2);
ServerManagement.kill(1);
// Need some time for Lease
Thread.sleep(11000);
assertEquals("Delegates are different on topology", 2,clusterDelegate.getTopology().getDelegates().length);
assertEquals(2, clusterDelegate.getDelegates().length);
ServerManagement.log(ServerManagement.INFO, "Stopping server0", 2);
ServerManagement.stop(0);
Thread.sleep(1000);
assertEquals(1, clusterDelegate.getDelegates().length);
Connection conn = createConnectionOnServer(cf, 2);
ClientClusteredConnectionFactoryDelegate cfDelegate =
(ClientClusteredConnectionFactoryDelegate)cf.getDelegate();
assertEquals(1, cfDelegate.getDelegates().length);
conn.close();
}
finally
{