public void testUpdateMixedConnectionFactory() throws Exception
{
Connection conn = cf.createConnection();
JBossConnectionFactory jbcf = (JBossConnectionFactory)cf;
ClientClusteredConnectionFactoryDelegate cfDelegate =
(ClientClusteredConnectionFactoryDelegate)jbcf.getDelegate();
assertEquals(3, cfDelegate.getDelegates().length);
ConnectionFactory httpCF = (ConnectionFactory)ic[0].lookup("/HTTPConnectionFactory");
JBossConnectionFactory jbhttpCF = (JBossConnectionFactory) httpCF;
Connection httpConn = httpCF.createConnection();
ClientClusteredConnectionFactoryDelegate httpcfDelegate =
(ClientClusteredConnectionFactoryDelegate)jbhttpCF.getDelegate();
assertEquals(3, httpcfDelegate.getDelegates().length);
validateCFs(cfDelegate, httpcfDelegate);
Connection conn1 = cf.createConnection();
Connection httpConn1 = httpCF.createConnection();
assertEquals(1, getServerId(conn1));
assertEquals(1, getServerId(httpConn1));
ServerManagement.killAndWait(1);
log.info("sleeping 5 secs ...");
Thread.sleep(5000);
// first part of the test, verifies if the CF was updated
assertEquals(2, cfDelegate.getDelegates().length);
assertEquals(2, httpcfDelegate.getDelegates().length);
validateCFs(cfDelegate, httpcfDelegate);
conn.close();
httpConn.close();