Package com.couchbase.client.java.document

Examples of com.couchbase.client.java.document.JsonBooleanDocument.content()


    @Test
    public void shouldDecodeTrueFromLegacy() {
        ByteBuf content = Unpooled.buffer().writeChar('1');
        JsonBooleanDocument decoded = converter.decode("id", content, 0, 0, 1 << 8,
            ResponseStatus.SUCCESS);
        assertTrue(decoded.content());
    }

    @Test
    public void shouldDecodeFalseFromLegacy() {
        ByteBuf content = Unpooled.buffer().writeChar('0');
View Full Code Here


    @Test
    public void shouldDecodeFalseFromLegacy() {
        ByteBuf content = Unpooled.buffer().writeChar('0');
        JsonBooleanDocument decoded = converter.decode("id", content, 0, 0, 1 << 8,
            ResponseStatus.SUCCESS);
        assertFalse(decoded.content());
    }

    @Test
    public void shouldDecodeTrueFromCommonFlags() {
        ByteBuf content = Unpooled.copiedBuffer("true", CharsetUtil.UTF_8);
View Full Code Here

    @Test
    public void shouldDecodeTrueFromCommonFlags() {
        ByteBuf content = Unpooled.copiedBuffer("true", CharsetUtil.UTF_8);
        JsonBooleanDocument decoded = converter.decode("id", content, 0, 0, TranscoderUtils.JSON_COMMON_FLAGS,
            ResponseStatus.SUCCESS);
        assertTrue(decoded.content());
    }

    @Test
    public void shouldDecodeFalseFromCommonFlags() {
        ByteBuf content = Unpooled.copiedBuffer("false", CharsetUtil.UTF_8);
View Full Code Here

    @Test
    public void shouldDecodeFalseFromCommonFlags() {
        ByteBuf content = Unpooled.copiedBuffer("false", CharsetUtil.UTF_8);
        JsonBooleanDocument decoded = converter.decode("id", content, 0, 0, TranscoderUtils.JSON_COMMON_FLAGS,
            ResponseStatus.SUCCESS);
        assertFalse(decoded.content());
    }

    @Test
    public void shouldReleaseBufferWhenDecoded() {
        ByteBuf content = Unpooled.copiedBuffer("false", CharsetUtil.UTF_8);
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.