Package org.apache.mina.handler.demux

Examples of org.apache.mina.handler.demux.DemuxingIoHandler


         */
        mockHandler1.replay();
        mockHandler2.replay();
        mockHandler3.replay();
       
        DemuxingIoHandler ioHandler = new DemuxingIoHandler();
       
        /*
         * First round. All messages should be handled by handler1
         */
        ioHandler.addMessageHandler( C1.class, ( MessageHandler ) mockHandler1.getMock() );
        ioHandler.messageReceived( session, msg[0] );
        ioHandler.messageReceived( session, msg[1] );
        ioHandler.messageReceived( session, msg[2] );
       
        /*
         * Second round. C1 messages should be handled by handler1. C2 and C3
         * messages should be handled by handler2.
         */
        ioHandler.addMessageHandler( C2.class, ( MessageHandler ) mockHandler2.getMock() );
        ioHandler.messageReceived( session, msg[3] );
        ioHandler.messageReceived( session, msg[4] );
        ioHandler.messageReceived( session, msg[5] );
       
        /*
         * Third round. C1 messages should be handled by handler1, C2 by
         * handler2 and C3 by handler3.
         */
        ioHandler.addMessageHandler( C3.class, ( MessageHandler ) mockHandler3.getMock() );
        ioHandler.messageReceived( session, msg[6] );
        ioHandler.messageReceived( session, msg[7] );
        ioHandler.messageReceived( session, msg[8] );
       
        /*
         * Verify.
         */
        mockHandler1.verify();
View Full Code Here


         */
        mockHandler1.replay();
        mockHandler2.replay();
        mockHandler3.replay();
       
        DemuxingIoHandler ioHandler = new DemuxingIoHandler();
       
        /*
         * First round. All messages should be handled by handler1
         */
        ioHandler.addMessageHandler( I4.class, ( MessageHandler ) mockHandler1.getMock() );
        ioHandler.messageReceived( session, msg[0] );
        ioHandler.messageReceived( session, msg[1] );
        ioHandler.messageReceived( session, msg[2] );
       
        /*
         * Second round. C1 and C3 messages should be handled by handler1. C2
         * messages should be handled by handler2.
         */
        ioHandler.addMessageHandler( I6.class, ( MessageHandler ) mockHandler2.getMock() );
        ioHandler.messageReceived( session, msg[3] );
        ioHandler.messageReceived( session, msg[4] );
        ioHandler.messageReceived( session, msg[5] );
       
        /*
         * Third round. C1 and C3 messages should be handled by handler3. C2
         * messages should be handled by handler2.
         */
        ioHandler.addMessageHandler( I3.class, ( MessageHandler ) mockHandler3.getMock() );
        ioHandler.messageReceived( session, msg[6] );
        ioHandler.messageReceived( session, msg[7] );
        ioHandler.messageReceived( session, msg[8] );
       
        /*
         * Verify.
         */
        mockHandler1.verify();
View Full Code Here

         */
        mockHandler1.replay();
        mockHandler2.replay();
        mockHandler3.replay();
       
        DemuxingIoHandler ioHandler = new DemuxingIoHandler();
       
        /*
         * First round. All messages should be handled by handler1
         */
        ioHandler.addMessageHandler( I4.class, ( MessageHandler ) mockHandler1.getMock() );
        ioHandler.messageReceived( session, msg[0] );
        ioHandler.messageReceived( session, msg[1] );
        ioHandler.messageReceived( session, msg[2] );
       
        /*
         * Second round. C1 and C3 messages should be handled by handler1. C2
         * messages should be handled by handler2.
         */
        ioHandler.addMessageHandler( I6.class, ( MessageHandler ) mockHandler2.getMock() );
        ioHandler.messageReceived( session, msg[3] );
        ioHandler.messageReceived( session, msg[4] );
        ioHandler.messageReceived( session, msg[5] );
       
        /*
         * Third round. C1 and C3 messages should be handled by handler3. C2
         * messages should be handled by handler2.
         */
        ioHandler.addMessageHandler( I3.class, ( MessageHandler ) mockHandler3.getMock() );
        ioHandler.messageReceived( session, msg[6] );
        ioHandler.messageReceived( session, msg[7] );
        ioHandler.messageReceived( session, msg[8] );
       
        /*
         * Verify.
         */
        mockHandler1.verify();
View Full Code Here

         */
        mockHandler1.replay();
        mockHandler2.replay();
        mockHandler3.replay();
       
        DemuxingIoHandler ioHandler = new DemuxingIoHandler();
       
        /*
         * First round. All messages should be handled by handler1
         */
        ioHandler.addMessageHandler( C1.class, ( MessageHandler ) mockHandler1.getMock() );
        ioHandler.messageReceived( session, msg[0] );
        ioHandler.messageReceived( session, msg[1] );
        ioHandler.messageReceived( session, msg[2] );
       
        /*
         * Second round. C1 messages should be handled by handler1. C2 and C3
         * messages should be handled by handler2.
         */
        ioHandler.addMessageHandler( C2.class, ( MessageHandler ) mockHandler2.getMock() );
        ioHandler.messageReceived( session, msg[3] );
        ioHandler.messageReceived( session, msg[4] );
        ioHandler.messageReceived( session, msg[5] );
       
        /*
         * Third round. C1 messages should be handled by handler1, C2 by
         * handler2 and C3 by handler3.
         */
        ioHandler.addMessageHandler( C3.class, ( MessageHandler ) mockHandler3.getMock() );
        ioHandler.messageReceived( session, msg[6] );
        ioHandler.messageReceived( session, msg[7] );
        ioHandler.messageReceived( session, msg[8] );
       
        /*
         * Verify.
         */
        mockHandler1.verify();
View Full Code Here

         */
        mockHandler1.replay();
        mockHandler2.replay();
        mockHandler3.replay();

        DemuxingIoHandler ioHandler = new DemuxingIoHandler();

        /*
         * First round. All messages should be handled by handler1
         */
        ioHandler.addMessageHandler(C1.class, (MessageHandler) mockHandler1
                .getMock());
        ioHandler.messageReceived(session, msg[0]);
        ioHandler.messageReceived(session, msg[1]);
        ioHandler.messageReceived(session, msg[2]);

        /*
         * Second round. C1 messages should be handled by handler1. C2 and C3
         * messages should be handled by handler2.
         */
        ioHandler.addMessageHandler(C2.class, (MessageHandler) mockHandler2
                .getMock());
        ioHandler.messageReceived(session, msg[3]);
        ioHandler.messageReceived(session, msg[4]);
        ioHandler.messageReceived(session, msg[5]);

        /*
         * Third round. C1 messages should be handled by handler1, C2 by
         * handler2 and C3 by handler3.
         */
        ioHandler.addMessageHandler(C3.class, (MessageHandler) mockHandler3
                .getMock());
        ioHandler.messageReceived(session, msg[6]);
        ioHandler.messageReceived(session, msg[7]);
        ioHandler.messageReceived(session, msg[8]);

        /*
         * Verify.
         */
        mockHandler1.verify();
View Full Code Here

         */
        mockHandler1.replay();
        mockHandler2.replay();
        mockHandler3.replay();

        DemuxingIoHandler ioHandler = new DemuxingIoHandler();

        /*
         * First round. All messages should be handled by handler1
         */
        ioHandler.addMessageHandler(I4.class, (MessageHandler) mockHandler1
                .getMock());
        ioHandler.messageReceived(session, msg[0]);
        ioHandler.messageReceived(session, msg[1]);
        ioHandler.messageReceived(session, msg[2]);

        /*
         * Second round. C1 and C3 messages should be handled by handler1. C2
         * messages should be handled by handler2.
         */
        ioHandler.addMessageHandler(I6.class, (MessageHandler) mockHandler2
                .getMock());
        ioHandler.messageReceived(session, msg[3]);
        ioHandler.messageReceived(session, msg[4]);
        ioHandler.messageReceived(session, msg[5]);

        /*
         * Third round. C1 and C3 messages should be handled by handler3. C2
         * messages should be handled by handler2.
         */
        ioHandler.addMessageHandler(I3.class, (MessageHandler) mockHandler3
                .getMock());
        ioHandler.messageReceived(session, msg[6]);
        ioHandler.messageReceived(session, msg[7]);
        ioHandler.messageReceived(session, msg[8]);

        /*
         * Verify.
         */
        mockHandler1.verify();
View Full Code Here

         */
        mockHandler1.replay();
        mockHandler2.replay();
        mockHandler3.replay();
       
        DemuxingIoHandler ioHandler = new DemuxingIoHandler();
       
        /*
         * First round. All messages should be handled by handler1
         */
        ioHandler.addMessageHandler( C1.class, ( MessageHandler ) mockHandler1.getMock() );
        ioHandler.messageReceived( session, msg[0] );
        ioHandler.messageReceived( session, msg[1] );
        ioHandler.messageReceived( session, msg[2] );
       
        /*
         * Second round. C1 messages should be handled by handler1. C2 and C3
         * messages should be handled by handler2.
         */
        ioHandler.addMessageHandler( C2.class, ( MessageHandler ) mockHandler2.getMock() );
        ioHandler.messageReceived( session, msg[3] );
        ioHandler.messageReceived( session, msg[4] );
        ioHandler.messageReceived( session, msg[5] );
       
        /*
         * Third round. C1 messages should be handled by handler1, C2 by
         * handler2 and C3 by handler3.
         */
        ioHandler.addMessageHandler( C3.class, ( MessageHandler ) mockHandler3.getMock() );
        ioHandler.messageReceived( session, msg[6] );
        ioHandler.messageReceived( session, msg[7] );
        ioHandler.messageReceived( session, msg[8] );
       
        /*
         * Verify.
         */
        mockHandler1.verify();
View Full Code Here

         */
        mockHandler1.replay();
        mockHandler2.replay();
        mockHandler3.replay();
       
        DemuxingIoHandler ioHandler = new DemuxingIoHandler();
       
        /*
         * First round. All messages should be handled by handler1
         */
        ioHandler.addMessageHandler( C1.class, ( MessageHandler ) mockHandler1.getMock() );
        ioHandler.messageReceived( session, msg[0] );
        ioHandler.messageReceived( session, msg[1] );
        ioHandler.messageReceived( session, msg[2] );
       
        /*
         * Second round. C1 messages should be handled by handler1. C2 and C3
         * messages should be handled by handler2.
         */
        ioHandler.addMessageHandler( C2.class, ( MessageHandler ) mockHandler2.getMock() );
        ioHandler.messageReceived( session, msg[3] );
        ioHandler.messageReceived( session, msg[4] );
        ioHandler.messageReceived( session, msg[5] );
       
        /*
         * Third round. C1 messages should be handled by handler1, C2 by
         * handler2 and C3 by handler3.
         */
        ioHandler.addMessageHandler( C3.class, ( MessageHandler ) mockHandler3.getMock() );
        ioHandler.messageReceived( session, msg[6] );
        ioHandler.messageReceived( session, msg[7] );
        ioHandler.messageReceived( session, msg[8] );
       
        /*
         * Verify.
         */
        mockHandler1.verify();
View Full Code Here

         */
        mockHandler1.replay();
        mockHandler2.replay();
        mockHandler3.replay();
       
        DemuxingIoHandler ioHandler = new DemuxingIoHandler();
       
        /*
         * First round. All messages should be handled by handler1
         */
        ioHandler.addMessageHandler( I4.class, ( MessageHandler ) mockHandler1.getMock() );
        ioHandler.messageReceived( session, msg[0] );
        ioHandler.messageReceived( session, msg[1] );
        ioHandler.messageReceived( session, msg[2] );
       
        /*
         * Second round. C1 and C3 messages should be handled by handler1. C2
         * messages should be handled by handler2.
         */
        ioHandler.addMessageHandler( I6.class, ( MessageHandler ) mockHandler2.getMock() );
        ioHandler.messageReceived( session, msg[3] );
        ioHandler.messageReceived( session, msg[4] );
        ioHandler.messageReceived( session, msg[5] );
       
        /*
         * Third round. C1 and C3 messages should be handled by handler3. C2
         * messages should be handled by handler2.
         */
        ioHandler.addMessageHandler( I3.class, ( MessageHandler ) mockHandler3.getMock() );
        ioHandler.messageReceived( session, msg[6] );
        ioHandler.messageReceived( session, msg[7] );
        ioHandler.messageReceived( session, msg[8] );
       
        /*
         * Verify.
         */
        mockHandler1.verify();
View Full Code Here

         */
        mockHandler1.replay();
        mockHandler2.replay();
        mockHandler3.replay();
       
        DemuxingIoHandler ioHandler = new DemuxingIoHandler();
       
        /*
         * First round. All messages should be handled by handler1
         */
        ioHandler.addMessageHandler( I4.class, ( MessageHandler ) mockHandler1.getMock() );
        ioHandler.messageReceived( session, msg[0] );
        ioHandler.messageReceived( session, msg[1] );
        ioHandler.messageReceived( session, msg[2] );
       
        /*
         * Second round. C1 and C3 messages should be handled by handler1. C2
         * messages should be handled by handler2.
         */
        ioHandler.addMessageHandler( I6.class, ( MessageHandler ) mockHandler2.getMock() );
        ioHandler.messageReceived( session, msg[3] );
        ioHandler.messageReceived( session, msg[4] );
        ioHandler.messageReceived( session, msg[5] );
       
        /*
         * Third round. C1 and C3 messages should be handled by handler3. C2
         * messages should be handled by handler2.
         */
        ioHandler.addMessageHandler( I3.class, ( MessageHandler ) mockHandler3.getMock() );
        ioHandler.messageReceived( session, msg[6] );
        ioHandler.messageReceived( session, msg[7] );
        ioHandler.messageReceived( session, msg[8] );
       
        /*
         * Verify.
         */
        mockHandler1.verify();
View Full Code Here

TOP

Related Classes of org.apache.mina.handler.demux.DemuxingIoHandler

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.