Search in sources :

Example 11 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 12 with WritableBuffer

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

the class NettyWritableBufferAllocatorTest method testCapacityHasMinimum.

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

Aggregations

WritableBuffer (io.grpc.internal.WritableBuffer)12 Test (org.junit.Test)10 Buffer (java.nio.Buffer)2 ByteBuffer (java.nio.ByteBuffer)2 Executor (java.util.concurrent.Executor)2 BidirectionalStream (org.chromium.net.BidirectionalStream)2 ExperimentalBidirectionalStream (org.chromium.net.ExperimentalBidirectionalStream)2 Metadata (io.grpc.Metadata)1 Status (io.grpc.Status)1 RpcProgress (io.grpc.internal.ClientStreamListener.RpcProgress)1 MessageFramer (io.grpc.internal.MessageFramer)1 MessageProducer (io.grpc.internal.StreamListener.MessageProducer)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 UrlResponseInfo (org.chromium.net.UrlResponseInfo)1 UrlResponseInfoImpl (org.chromium.net.impl.UrlResponseInfoImpl)1