s.close();
tester.setupServer(callbackLocator);
assertTrue(InvokerRegistry.isServerInvokerRegistered(callbackLocator));
ServerInvoker[] serverInvokers = InvokerRegistry.getServerInvokers();
MultiplexServerInvoker multiplexServerInvoker = null;
for(int i = 0; i < serverInvokers.length; i++)
{
if(serverInvokers[i].getLocator().equals(callbackLocator))
{
if(serverInvokers[i] instanceof MultiplexServerInvoker)
{
multiplexServerInvoker = (MultiplexServerInvoker) serverInvokers[i];
}
}
}
assertTrue(multiplexServerInvoker != null);
assertTrue(multiplexServerInvoker.getLocator().equals(callbackLocator));
assertTrue(multiplexServerInvoker.getBacklog() == 2);
assertTrue(multiplexServerInvoker.getNumAcceptThreads() == 5);
assertTrue(multiplexServerInvoker.getTimeout() == 300000);
ServerSocket serverSocket = multiplexServerInvoker.getServerSocket();
assertTrue(serverSocket instanceof MasterServerSocket);
InvokerLocator serverLocator = new InvokerLocator(transport + "://" + serverHost +
":" + serverPort +
"/?timeout=60000");
InetSocketAddress connectAddress = new InetSocketAddress(serverHost, serverPort);
for(int i = 0; i < 5; i++)
{
if(MultiplexingManager.checkForShareableManager(connectAddress))
{
break;
}
try
{
Thread.sleep(2000);
}
catch(InterruptedException ignored)
{
}
}
Thread.sleep(10000);
tester.createRemotingClient(serverLocator.getLocatorURI());
assertTrue(InvokerRegistry.isClientInvokerRegistered(serverLocator));
ClientInvoker[] clientInvokers = InvokerRegistry.getClientInvokers();
MultiplexClientInvoker multiplexClientInvoker = null;
for(int i = 0; i < clientInvokers.length; i++)
{
if(clientInvokers[i].getLocator().equals(serverLocator))
{
if(clientInvokers[i] instanceof MultiplexClientInvoker)
{
multiplexClientInvoker = (MultiplexClientInvoker) clientInvokers[i];
}
}
}
assertTrue(multiplexClientInvoker != null);
assertTrue(multiplexClientInvoker.getLocator().equals(serverLocator));
assertTrue(multiplexClientInvoker.getTimeout() == 60000);
assertTrue(tester.makeInvocation().equals(new Integer(1)));
assertTrue(tester.makeInvocation().equals(new Integer(0)));
// Check on virtual MultiplexServerInvoker before it's destroyed by runPushCallbackTest().
InetSocketAddress address = new InetSocketAddress(serverHost, serverPort);
MultiplexServerInvoker virtualServerInvoker = multiplexServerInvoker.getServerInvoker(address);
assertTrue(virtualServerInvoker.getServerSocket() instanceof VirtualServerSocket);
// test pull callbacks
assertTrue(tester.runPullCallbackTest());
// test push callbacks