Examples of refCnt()


Examples of io.netty.buffer.ByteBuf.refCnt()

            ArgumentCaptor<ByteBuf> argument = ArgumentCaptor.forClass(ByteBuf.class);
            captureWrite(STREAM_A, argument, 2, false);
            final ByteBuf writtenBuf = argument.getValue();
            assertEquals(3, writtenBuf.readableBytes());
            assertEquals(data.slice(0, 3), writtenBuf);
            assertEquals(2, writtenBuf.refCnt());
            assertEquals(2, data.refCnt());
        } finally {
            manualSafeRelease(data);
        }
    }
View Full Code Here

Examples of io.netty.handler.codec.http.FullHttpRequest.refCnt()

                .preflightResponseHeader("CustomHeader", Arrays.asList("value1", "value2"))
                .build();
        final EmbeddedChannel channel = new EmbeddedChannel(new CorsHandler(config));
        final FullHttpRequest request = optionsRequest("http://localhost:8888", "content-type, xheader1");
        channel.writeInbound(request);
        assertThat(request.refCnt(), is(0));
    }

    @Test
    public void forbiddenShouldReleaseRequest() {
        final CorsConfig config = CorsConfig.withOrigin("https://localhost").shortCurcuit().build();
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.