Search in sources :

Example 1 with MockDataHandler

use of org.webpieces.nio.api.testutil.MockDataHandler in project webpieces by deanhiller.

the class TryRealConnection method xxxtestRealConnection.

public void xxxtestRealConnection() throws Exception {
    MockObject mockConnect = MockObjectFactory.createMock(ConnectionCallback.class);
    Settings h = new Settings(new MockSSLEngineFactory(), null);
    TCPChannel channel = chanMgr.createTCPChannel("testId", h);
    channel.bind(loopBackAddr);
    log.trace("aaaaa");
    MockObject handler = new MockDataHandler();
    channel.registerForReads((DataListener) handler);
    //		InetAddress host = InetAddress.getByName("shell.sourceforge.net");
    InetAddress host = InetAddress.getByName("www.xsoftware.biz");
    InetSocketAddress addr = new InetSocketAddress(host, 22);
    channel.oldConnect(addr, (ConnectionCallback) mockConnect);
    mockConnect.expect("connected");
    handler.addIgnore("getBuffer");
    //CalledMethod method = 
    handler.expect("incomingData");
//		ByteBuffer b = (ByteBuffer)method.getAllParams()[1];
}
Also used : TCPChannel(org.webpieces.nio.api.channels.TCPChannel) MockDataHandler(org.webpieces.nio.api.testutil.MockDataHandler) InetSocketAddress(java.net.InetSocketAddress) InetAddress(java.net.InetAddress) MockObject(biz.xsoftware.mock.MockObject) Settings(org.webpieces.nio.api.deprecated.Settings) MockSSLEngineFactory(org.webpieces.nio.api.testutil.MockSSLEngineFactory)

Aggregations

MockObject (biz.xsoftware.mock.MockObject)1 InetAddress (java.net.InetAddress)1 InetSocketAddress (java.net.InetSocketAddress)1 TCPChannel (org.webpieces.nio.api.channels.TCPChannel)1 Settings (org.webpieces.nio.api.deprecated.Settings)1 MockDataHandler (org.webpieces.nio.api.testutil.MockDataHandler)1 MockSSLEngineFactory (org.webpieces.nio.api.testutil.MockSSLEngineFactory)1