Package com.chenshuo.muduo.example.multiplexer

Examples of com.chenshuo.muduo.example.multiplexer.MockClient.disconnect()


        assertEquals(EventSource.kClient, de.source);
        assertEquals(connId, de.whichClient);
        assertEquals(buf, de.data);

        // step 4
        client.disconnect();
        de = (DataEvent) queue.take();
        assertEquals(EventSource.kBackend, de.source);
        m = god.commandChannel.matcher(de.getString());
        if (!m.matches())
            fail("command channel message doesn't match.");
View Full Code Here


        assertEquals(connId, de.whichClient);
        assertEquals(buf, de.data);
        System.out.println(de.data.toString(Charset.defaultCharset()));

        // step 4
        client.disconnect();
        de = (DataEvent) queue.take();
        assertEquals(EventSource.kBackend, de.source);
        m = god.commandChannel.matcher(de.getString());
        if (!m.matches())
            fail("command channel message doesn't match.");
View Full Code Here

        assertEquals(EventSource.kBackend, de.source);
        assertEquals(connId, de.whichClient);
        assertEquals(buf.copy(255, 245), de.data);

        // step 4
        client.disconnect();
        de = (DataEvent) queue.take();
        assertEquals(EventSource.kBackend, de.source);
        m = god.commandChannel.matcher(de.getString());
        if (!m.matches())
            fail("command channel message doesn't match.");
View Full Code Here

        assertTrue(connId > 0);
        client.setId(connId);
       
        assertEquals("UP", m.group(2));
       
        client.disconnect();
        de = (DataEvent) queue.take();
        assertEquals(EventSource.kBackend, de.source);
        m = god.commandChannel.matcher(de.getString());
        if (!m.matches())
            fail("command channel message doesn't match.");
View Full Code Here

        if (!m.matches())
            fail("command channel message doesn't match.");
        assertEquals(connId1, Integer.parseInt(m.group(1)));
        assertEquals("DOWN", m.group(2));

        client2.disconnect();
        de = (DataEvent) queue.take();
        assertEquals(EventSource.kBackend, de.source);
        m = god.commandChannel.matcher(de.getString());
        if (!m.matches())
            fail("command channel message doesn't match.");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.