}
public void testCreateInstance() throws Exception
{
DefaultIoFilterChainBuilder builder1 = new DefaultIoFilterChainBuilder();
builder1.addLast( "portFilter0", filter1 );
DefaultIoFilterChainBuilder builder2 = new DefaultIoFilterChainBuilder();
builder2.addLast( "portFilter0", filter1 );
builder2.addLast( "portFilter1", filter2 );
/*
* Record expectations.
*/
factory.createIoAcceptor();
mockFactory.setReturnValue( ioAcceptor );
ioAcceptor.setDisconnectClientsOnUnbind( true );
factory.initIoService( ioAcceptor );
ioAcceptor.bind( new DummySocketAddress( ":110" ), popHandler, builder1 );
mockIoAcceptor.setMatcher( new IoAcceptorBindArgumentsMatcher() );
ioAcceptor.bind( new DummySocketAddress( "127.0.0.1:22" ), sshHandler, builder2 );
ioAcceptor.bind( new DummySocketAddress( "192.168.0.1:80" ),
httpHandler, new DefaultIoFilterChainBuilder() );
/*
* Replay.
*/
mockIoAcceptor.replay();