Class ChunkedByteBufferOutputStreamTest

java.lang.Object
org.apache.kafka.clients.producer.internals.ChunkedByteBufferOutputStreamTest

public class ChunkedByteBufferOutputStreamTest extends Object
  • Constructor Details

    • ChunkedByteBufferOutputStreamTest

      public ChunkedByteBufferOutputStreamTest()
  • Method Details

    • teardown

      @AfterEach public void teardown()
    • testConstructorRejectsInvalidChunks

      @Test public void testConstructorRejectsInvalidChunks()
    • testOperationsRejectedAfterDeallocate

      @Test public void testOperationsRejectedAfterDeallocate() throws Exception
      Throws:
      Exception
    • testWritesDisallowedAfterClose

      @Test public void testWritesDisallowedAfterClose() throws Exception
      Throws:
      Exception
    • testSingleChunkWriteRoundtrip

      @Test public void testSingleChunkWriteRoundtrip() throws Exception
      Throws:
      Exception
    • testWriteAcrossMultipleChunks

      @Test public void testWriteAcrossMultipleChunks() throws Exception
      Throws:
      Exception
    • testRemainingSumsFreeBytesAcrossChunks

      @Test public void testRemainingSumsFreeBytesAcrossChunks() throws Exception
      Throws:
      Exception
    • testEnsureRemainingDoesNotWasteCurrentChunk

      @Test public void testEnsureRemainingDoesNotWasteCurrentChunk() throws Exception
      Throws:
      Exception
    • testAddBuffersExtendsStream

      @Test public void testAddBuffersExtendsStream() throws Exception
      Throws:
      Exception
    • testAddBuffersRejectsWrongSizeChunks

      @Test public void testAddBuffersRejectsWrongSizeChunks() throws Exception
      Throws:
      Exception
    • testPositionWalksAcrossChunks

      @Test public void testPositionWalksAcrossChunks() throws Exception
      Throws:
      Exception
    • testDeallocateReturnsAllChunks

      @Test public void testDeallocateReturnsAllChunks() throws Exception
      Throws:
      Exception
    • testUnusedChunksReleasedOnCloseNotOnBuffer

      @Test public void testUnusedChunksReleasedOnCloseNotOnBuffer() throws Exception
      The fully-unused chunks are returned to the pool on ChunkedByteBufferOutputStream.close() (the stream is closed for appends). Reading ChunkedByteBufferOutputStream.buffer() afterwards has no chunk-releasing side effect; the data-bearing chunks stay reserved until ChunkedByteBufferOutputStream.deallocate(), which must not return the already-released chunks a second time.
      Throws:
      Exception