Search in sources :

Example 6 with WritableBuffer

use of io.grpc.internal.WritableBuffer in project grpc-java by grpc.

the class NettyWritableBufferAllocatorTest method testCapacityIsExactAboveMinimum.

@Test
public void testCapacityIsExactAboveMinimum() {
    WritableBuffer buffer = allocator().allocate(9000);
    assertEquals(0, buffer.readableBytes());
    assertEquals(9000, buffer.writableBytes());
}
Also used : WritableBuffer(io.grpc.internal.WritableBuffer) Test(org.junit.Test)

Example 7 with WritableBuffer

use of io.grpc.internal.WritableBuffer in project grpc-java by grpc.

the class OkHttpWritableBufferAllocatorTest method testCapacity.

@Test
public void testCapacity() {
    WritableBuffer buffer = allocator().allocate(4096);
    assertEquals(0, buffer.readableBytes());
    assertEquals(4096, buffer.writableBytes());
}
Also used : WritableBuffer(io.grpc.internal.WritableBuffer) Test(org.junit.Test)

Example 8 with WritableBuffer

use of io.grpc.internal.WritableBuffer in project grpc-java by grpc.

the class OkHttpWritableBufferAllocatorTest method testIsExactBelowMaxCapacity.

@Test
public void testIsExactBelowMaxCapacity() {
    WritableBuffer buffer = allocator().allocate(4097);
    assertEquals(0, buffer.readableBytes());
    assertEquals(4097, buffer.writableBytes());
}
Also used : WritableBuffer(io.grpc.internal.WritableBuffer) Test(org.junit.Test)

Aggregations

WritableBuffer (io.grpc.internal.WritableBuffer)8 Test (org.junit.Test)6 MessageFramer (io.grpc.internal.MessageFramer)1 ByteBuf (io.netty.buffer.ByteBuf)1 CompositeByteBuf (io.netty.buffer.CompositeByteBuf)1 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)1 DefaultHttp2FrameWriter (io.netty.handler.codec.http2.DefaultHttp2FrameWriter)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 Buffer (okio.Buffer)1