Examples of readInbound()


Examples of io.netty.channel.embedded.EmbeddedChannel.readInbound()

        Assert.assertTrue(channel.writeInbound(input.readBytes(7)));

        Assert.assertTrue(channel.finish());
        Assert.assertEquals(buf.readBytes(3), channel.readInbound());
        Assert.assertEquals(buf.readBytes(3), channel.readInbound());
        Assert.assertEquals(buf.readBytes(3), channel.readInbound());
    }
}
View Full Code Here

Examples of io.netty.channel.embedded.EmbeddedChannel.readInbound()

        }
        Assert.assertTrue(channel.writeInbound(input.readBytes(3)));


        Assert.assertTrue(channel.finish());
        Assert.assertEquals(buf.readBytes(2), channel.readInbound());
        Assert.assertEquals(buf.skipBytes(4).readBytes(3), channel.readInbound());
    }
}
View Full Code Here

Examples of io.netty.channel.embedded.EmbeddedChannel.readInbound()

        Assert.assertTrue(channel.writeInbound(input.readBytes(3)));


        Assert.assertTrue(channel.finish());
        Assert.assertEquals(buf.readBytes(2), channel.readInbound());
        Assert.assertEquals(buf.skipBytes(4).readBytes(3), channel.readInbound());
    }
}
View Full Code Here

Examples of io.netty.channel.embedded.EmbeddedChannel.readInbound()

        buffer.writeBytes(key);
        buffer.writeBytes(body);
       
        Assert.assertTrue(channel.writeInbound(buffer));

        MemcachedResponse response = (MemcachedResponse) channel.readInbound();
        assertResponse(response, magic, opCode, dataType, Status.KEY_EXISTS, 0, 0, id, cas, key, body);
    }

    @Test
    public void testMemcachedResponseDecoderFragments() {
View Full Code Here

Examples of io.netty.channel.embedded.EmbeddedChannel.readInbound()

        Assert.assertFalse(channel.writeInbound(fragment1));
        Assert.assertFalse(channel.writeInbound(fragment2));
        Assert.assertTrue(channel.writeInbound(fragment3));

        MemcachedResponse response = (MemcachedResponse) channel.readInbound();
        assertResponse(response, magic, opCode, dataType, Status.KEY_EXISTS, 0, 0, id, cas, key, body);
    }

    private static void assertResponse(MemcachedResponse response, byte magic, byte opCode, byte dataType, short status, int expires, int flags, int id, long cas, byte[] key, byte[] body) {
        Assert.assertEquals(magic, response.magic());
View Full Code Here

Examples of io.netty.channel.embedded.EmbeddedChannel.readInbound()

        encoded.readBytes(data);
        Assert.assertArrayEquals((request.key() + request.body()).getBytes(CharsetUtil.UTF_8), data);
        Assert.assertFalse(encoded.isReadable());

        Assert.assertFalse(channel.finish());
        Assert.assertNull(channel.readInbound());
    }
}
View Full Code Here

Examples of io.netty.channel.embedded.EmbeddedChannel.readInbound()

        assertTrue(compressedFrame instanceof BinaryWebSocketFrame);
        assertEquals(WebSocketExtension.RSV1 | WebSocketExtension.RSV3, compressedFrame.rsv());

        decoderChannel.writeInbound(compressedFrame.content());
        decoderChannel.writeInbound(DeflateDecoder.FRAME_TAIL);
        ByteBuf uncompressedPayload = decoderChannel.readInbound();
        assertEquals(300, uncompressedPayload.readableBytes());

        byte[] finalPayload = new byte[300];
        uncompressedPayload.readBytes(finalPayload);
        assertTrue(Arrays.equals(finalPayload, payload));
View Full Code Here

Examples of io.netty.channel.embedded.EmbeddedChannel.readInbound()

        assertFalse(compressedFrame2.isFinalFragment());
        assertTrue(compressedFrame3.isFinalFragment());

        decoderChannel.writeInbound(compressedFrame1.content());
        decoderChannel.writeInbound(Unpooled.wrappedBuffer(DeflateDecoder.FRAME_TAIL));
        ByteBuf uncompressedPayload1 = decoderChannel.readInbound();
        byte[] finalPayload1 = new byte[100];
        uncompressedPayload1.readBytes(finalPayload1);
        assertTrue(Arrays.equals(finalPayload1, payload1));
        uncompressedPayload1.release();
View Full Code Here

Examples of io.netty.channel.embedded.EmbeddedChannel.readInbound()

        assertTrue(Arrays.equals(finalPayload1, payload1));
        uncompressedPayload1.release();

        decoderChannel.writeInbound(compressedFrame2.content());
        decoderChannel.writeInbound(Unpooled.wrappedBuffer(DeflateDecoder.FRAME_TAIL));
        ByteBuf uncompressedPayload2 = decoderChannel.readInbound();
        byte[] finalPayload2 = new byte[100];
        uncompressedPayload2.readBytes(finalPayload2);
        assertTrue(Arrays.equals(finalPayload2, payload2));
        uncompressedPayload2.release();
View Full Code Here

Examples of io.netty.channel.embedded.EmbeddedChannel.readInbound()

        assertTrue(Arrays.equals(finalPayload2, payload2));
        uncompressedPayload2.release();

        decoderChannel.writeInbound(compressedFrame3.content());
        decoderChannel.writeInbound(Unpooled.wrappedBuffer(DeflateDecoder.FRAME_TAIL));
        ByteBuf uncompressedPayload3 = decoderChannel.readInbound();
        byte[] finalPayload3 = new byte[100];
        uncompressedPayload3.readBytes(finalPayload3);
        assertTrue(Arrays.equals(finalPayload3, payload3));
        uncompressedPayload3.release();
    }
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.