Search in sources :

Example 1 with EchoServer

use of org.webpieces.nio.test.EchoServer in project webpieces by deanhiller.

the class ZPerformanceSuper method setUp.

protected void setUp() throws Exception {
    HandlerForTests.setupLogging();
    LoggerFactory.getLogger("").setLevel(Level.INFO);
    //and started back up cleanly.....
    if (chanMgr == null) {
        chanMgr = getClientChanMgr();
    }
    if (echoServer == null) {
        ChannelService svrChanMgr = getServerChanMgr();
        echoServer = new EchoServer(svrChanMgr, getServerFactoryHolder());
    }
    chanMgr.start();
    svrAddr = echoServer.start();
    //this is to test EchoServer on a different machine...
    //		InetAddress tmp = InetAddress.getByName("192.168.1.102");
    //		svrAddr = new InetSocketAddress(tmp, 501);
    log.trace("server port =" + svrAddr);
    //loopBack = InetAddress.getByName("127.0.0.1");	
    //loopBackAnyPort = new InetSocketAddress(loopBack, 0);
    mockHandler = MockObjectFactory.createMock(DataListener.class);
    mockHandler.setDefaultBehavior("incomingData", new CloneByteBuffer());
    mockConnect = MockObjectFactory.createMock(ConnectionCallback.class);
    mockConnectOp = MockObjectFactory.createMock(OperationCallback.class);
}
Also used : OperationCallback(org.webpieces.nio.api.handlers.OperationCallback) ChannelService(org.webpieces.nio.api.deprecated.ChannelService) CloneByteBuffer(org.webpieces.nio.api.testutil.CloneByteBuffer) DataListener(org.webpieces.nio.api.handlers.DataListener) ConnectionCallback(org.webpieces.nio.api.deprecated.ConnectionCallback) EchoServer(org.webpieces.nio.test.EchoServer)

Aggregations

ChannelService (org.webpieces.nio.api.deprecated.ChannelService)1 ConnectionCallback (org.webpieces.nio.api.deprecated.ConnectionCallback)1 DataListener (org.webpieces.nio.api.handlers.DataListener)1 OperationCallback (org.webpieces.nio.api.handlers.OperationCallback)1 CloneByteBuffer (org.webpieces.nio.api.testutil.CloneByteBuffer)1 EchoServer (org.webpieces.nio.test.EchoServer)1