use of org.webpieces.nio.api.deprecated.ChannelService in project webpieces by deanhiller.
the class TestMoreSecureChanMgr method setUp.
protected void setUp() throws Exception {
SSLEngineFactory sslEngineFactory = new MockSSLEngineFactory();
Settings clientFactoryHolder = new Settings(sslEngineFactory, null);
//use this engine to feed data back from server...
SSLEngine wrappedSvr = sslEngineFactory.createEngineForServerSocket();
sslEngine = creator.createSSLEngine("[serverAsynch] ", wrappedSvr, null);
sslEngine.setListener((SSLListener) mockSSLListener);
//and started back up cleanly.....
if (chanMgr == null) {
chanMgr = getClientChanMgr();
}
if (mockServer == null) {
ChannelService svcChanMgr = getServerChanMgr();
mockServer = new MockNIOServer(svcChanMgr, null);
}
chanMgr.start();
svrAddr = mockServer.start();
log.trace("server port =" + svrAddr);
loopBack = InetAddress.getByName("127.0.0.1");
loopBackAnyPort = new InetSocketAddress(loopBack, 0);
mockHandler.setDefaultBehavior("incomingData", new CloneByteBuffer());
mockSSLListener.setDefaultBehavior("packetEncrypted", new CloneByteBuffer());
client1 = chanMgr.createTCPChannel("ClientChannel", clientFactoryHolder);
}
use of org.webpieces.nio.api.deprecated.ChannelService in project webpieces by deanhiller.
the class TestMoreSecureChanMgr method getClientChanMgr.
protected ChannelService getClientChanMgr() throws Exception {
Map<String, Object> factoryName = new HashMap<String, Object>();
factoryName.put(ChannelServiceFactory.KEY_IMPLEMENTATION_CLASS, ChannelServiceFactory.VAL_SECURE_CHANNEL_MGR);
factoryName.put(ChannelServiceFactory.KEY_CHILD_CHANNELMGR_FACTORY, basicFactory);
ChannelServiceFactory secureFactory = ChannelServiceFactory.createFactory(factoryName);
Map<String, Object> p = new HashMap<String, Object>();
p.put(ChannelManagerOld.KEY_ID, "client");
p.put(ChannelManagerOld.KEY_BUFFER_FACTORY, bufFactory);
ChannelService chanMgr = secureFactory.createChannelManager(p);
return chanMgr;
}
use of org.webpieces.nio.api.deprecated.ChannelService in project webpieces by deanhiller.
the class TestZNioSecureCM method getClientChanMgr.
@Override
protected ChannelService getClientChanMgr() {
Map<String, Object> p = new HashMap<String, Object>();
p.put(ChannelManagerOld.KEY_ID, "client");
p.put(ChannelManagerOld.KEY_BUFFER_FACTORY, getBufFactory());
ChannelService chanMgr = secureFactory.createChannelManager(p);
return chanMgr;
}
use of org.webpieces.nio.api.deprecated.ChannelService in project webpieces by deanhiller.
the class ZNioFailureSuperclass method setUpImpl.
protected void setUpImpl() throws Exception {
HandlerForTests.setupLogging();
//and started back up cleanly.....
if (chanMgr == null) {
chanMgr = getClientChanMgr();
}
if (mockServer == null) {
ChannelService svcChanMgr = getServerChanMgr();
mockServer = new MockNIOServer(svcChanMgr, getServerFactoryHolder());
}
chanMgr.start();
svrAddr = mockServer.start();
log.trace("server port =" + svrAddr);
loopBack = InetAddress.getByName("127.0.0.1");
loopBackAnyPort = new InetSocketAddress(loopBack, 0);
mockHandler = createMock(DataListener.class);
mockHandler.setDefaultBehavior("incomingData", new CloneByteBuffer());
mockConnect = createMock(ConnectionCallback.class);
client1 = chanMgr.createTCPChannel("ClientChannel", getClientFactoryHolder());
}
use of org.webpieces.nio.api.deprecated.ChannelService in project webpieces by deanhiller.
the class ZNioSuperclassTest method setUp.
protected void setUp() throws Exception {
HandlerForTests.setupLogging();
//and started back up cleanly.....
if (chanMgr == null) {
chanMgr = getClientChanMgr();
}
if (mockServer == null) {
ChannelService svcChanMgr = getServerChanMgr();
mockServer = new MockNIOServer(svcChanMgr, getServerFactoryHolder());
}
chanMgr.start();
svrAddr = mockServer.start();
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);
client1 = chanMgr.createTCPChannel("ClientChannel", getClientFactoryHolder());
}
Aggregations