Client client = new Client(clientLocator, configuration);
client.connect();
log.info("Created client");
// should NOT get same client invoker as the one for client above since config passed is not the same
MultiplexClientInvoker clientInvoker1 = (MultiplexClientInvoker) InvokerRegistry.createClientInvoker(clientLocator);
assertEquals(MultiplexClientInvoker.SO_TIMEOUT_DEFAULT, clientInvoker1.getTimeout());
assertNotSame(client.getInvoker(), clientInvoker1);
// should get the same client invoker as the one for client above since config passed *is* the same
MultiplexClientInvoker clientInvoker2 = (MultiplexClientInvoker) InvokerRegistry.createClientInvoker(clientLocator, configuration);
assertEquals(123456, clientInvoker2.getTimeout());
assertSame(client.getInvoker(), clientInvoker2);
Map configuration2 = new HashMap();
configuration2.put(SocketClientInvoker.SO_TIMEOUT_FLAG, "123456");
// should *not* get the same client invoker as the one for client above since config passed is not the same
MultiplexClientInvoker clientInvoker3 = (MultiplexClientInvoker) InvokerRegistry.createClientInvoker(clientLocator, configuration2);
assertEquals(123456, clientInvoker3.getTimeout());
assertNotSame(client.getInvoker(), clientInvoker3);
// now to test ref counting in invoker registry
ClientInvoker originalInvoker = client.getInvoker();
// this should remove one of the reference counts to original invoker