Package org.apache.mina.common

Examples of org.apache.mina.common.IoService


        }
    }

    public void testContext() {
        appContext = SpringMain.getApplicationContext();
        IoService service = (IoService) appContext.getBean("ioAcceptor");
        IoService ioAcceptorWithSSL = (IoService) appContext.getBean("ioAcceptorWithSSL");
        assertTrue(service.isActive());
        assertTrue(ioAcceptorWithSSL.isActive());
        appContext.close();
        assertFalse(service.isActive());
        assertFalse(ioAcceptorWithSSL.isActive());
    }
View Full Code Here


                ( IoFilter ) MockControl.createControl( IoFilter.class )
                        .getMock(),
                ( IoFilter ) MockControl.createControl( IoFilter.class )
                        .getMock() };

        IoService ioSessionManager =
            ( IoService ) mockIoService.getMock();
        DefaultIoFilterChainBuilder ioFilterChainBuilder =
            ( DefaultIoFilterChainBuilder ) mockIoFilterChainBuilder.getMock();

        /*
         * Record expectations.
         */
        ioFilterChainBuilder.addLast( "managerFilter0", filters[ 0 ] );
        ioFilterChainBuilder.addLast( "managerFilter1", filters[ 1 ] );
        ioFilterChainBuilder.addLast( "managerFilter2", filters[ 2 ] );

        ioSessionManager.getFilterChain();
        mockIoService.setReturnValue( mockIoFilterChainBuilder.getMock() );

        /*
         * Replay.
         */
 
View Full Code Here

                new IoFilterMapping( "second", ( IoFilter ) MockControl
                        .createControl( IoFilter.class ).getMock() ),
                new IoFilterMapping( "third", ( IoFilter ) MockControl
                        .createControl( IoFilter.class ).getMock() ) };

        IoService ioSessionManager = ( IoService ) mockIoService
                .getMock();
        DefaultIoFilterChainBuilder ioFilterChainBuilder = ( DefaultIoFilterChainBuilder ) mockIoFilterChainBuilder
                .getMock();

        /*
         * Record expectations.
         */
        ioFilterChainBuilder.addLast( "first", mappings[ 0 ].getFilter() );
        ioFilterChainBuilder.addLast( "second", mappings[ 1 ].getFilter() );
        ioFilterChainBuilder.addLast( "third", mappings[ 2 ].getFilter() );

        ioSessionManager.getFilterChain();
        mockIoService.setReturnValue( mockIoFilterChainBuilder.getMock() );

        /*
         * Replay.
         */
 
View Full Code Here

         * Create EasyMock mocks.
         */
        MockControl mockIoService = MockControl
                .createControl( IoService.class );

        IoService ioSessionManager = ( IoService ) mockIoService
                .getMock();
        DefaultIoFilterChainBuilder ioFilterChainBuilder = ( DefaultIoFilterChainBuilder ) MockClassControl
                .createControl( DefaultIoFilterChainBuilder.class ).getMock();

        /*
         * Record expectations.
         */
        ioSessionManager.getFilterChain();
        mockIoService.setReturnValue( ioFilterChainBuilder );

        /*
         * Replay.
         */
 
View Full Code Here

        MockControl mockIoFilterChainBuilder = MockClassControl
                .createStrictControl( DefaultIoFilterChainBuilder.class );
        MockControl mockIoService = MockControl
                .createControl( IoService.class );

        IoService ioSessionManager = ( IoService ) mockIoService
                .getMock();
        DefaultIoFilterChainBuilder ioFilterChainBuilder = ( DefaultIoFilterChainBuilder ) mockIoFilterChainBuilder
                .getMock();

        /*
         * Record expectations.
         */
        ioSessionManager.getFilterChain();
        mockIoService.setReturnValue( ioFilterChainBuilder );
        ioFilterChainBuilder.clear();

        /*
         * Replay.
 
View Full Code Here

TOP

Related Classes of org.apache.mina.common.IoService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.