IoServiceConfig config1 =
( IoServiceConfig ) MockControl.createControl( IoServiceConfig.class ).getMock();
IoServiceConfig config2 =
( IoServiceConfig ) MockControl.createControl( IoServiceConfig.class ).getMock();
MockControl mockIoAcceptor = MockControl.createControl( IoAcceptor.class );
IoAcceptor acceptor = ( IoAcceptor ) mockIoAcceptor.getMock();
acceptor.bind( new InetSocketAddress( 80 ), handler1, config1 );
acceptor.bind( new InetSocketAddress( "192.168.0.1", 22 ), handler2, config2 );
acceptor.bind( new InetSocketAddress( "10.0.0.1", 9876 ), handler3 );
acceptor.unbind( new InetSocketAddress( 80 ) );
acceptor.unbind( new InetSocketAddress( "192.168.0.1", 22 ) );
acceptor.unbind( new InetSocketAddress( "10.0.0.1", 9876 ) );
mockIoAcceptor.replay();
IoAcceptorFactoryBean factory = new IoAcceptorFactoryBean();
factory.setTarget( acceptor );