Class IdempotentCloserTest

java.lang.Object
org.apache.kafka.common.internals.IdempotentCloserTest

public class IdempotentCloserTest extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Tests basic functionality, i.e.
    void
    Tests that the IdempotentCloser.assertOpen(String) method will not throw an exception if the closer is in the "open" state, but if invoked after it's in the "closed" state, it will throw the exception.
    void
    Tests that the onClose callback is only invoked once.
    void
    Tests that if the IdempotentCloser is created with its initial state as closed, the various APIs will behave as expected.
    void
    Tests that the onClose callback is only invoked once, while the onPreviousClose callback can be invoked a variable number of times.
    void
    Tests that if the invoked onClose callback throws an exception, that: The exception does not prevent the IdempotentCloser from being updated to the closed state The exception is bubbled up to the user
    void
    Tests that if the invoked onSubsequentClose callback throws an exception, that it is thrown from IdempotentCloser.close(Runnable, Runnable) so the user can handle it.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IdempotentCloserTest

      public IdempotentCloserTest()
  • Method Details

    • testBasicClose

      @Test public void testBasicClose()
      Tests basic functionality, i.e. that close means closed.
    • testCountCloses

      @Test public void testCountCloses()
      Tests that the onClose callback is only invoked once.
    • testEnsureIdempotentClose

      @Test public void testEnsureIdempotentClose()
      Tests that the onClose callback is only invoked once, while the onPreviousClose callback can be invoked a variable number of times.
    • testCloseBeforeThrows

      @Test public void testCloseBeforeThrows()
      Tests that the IdempotentCloser.assertOpen(String) method will not throw an exception if the closer is in the "open" state, but if invoked after it's in the "closed" state, it will throw the exception.
    • testErrorsInOnCloseCallbacksAreNotSwallowed

      @Test public void testErrorsInOnCloseCallbacksAreNotSwallowed()
      Tests that if the invoked onClose callback throws an exception, that:
      1. The exception does not prevent the IdempotentCloser from being updated to the closed state
      2. The exception is bubbled up to the user
    • testErrorsInOnPreviousCloseCallbacksAreNotSwallowed

      @Test public void testErrorsInOnPreviousCloseCallbacksAreNotSwallowed()
      Tests that if the invoked onSubsequentClose callback throws an exception, that it is thrown from IdempotentCloser.close(Runnable, Runnable) so the user can handle it.
    • testCreatedClosed

      @Test public void testCreatedClosed()
      Tests that if the IdempotentCloser is created with its initial state as closed, the various APIs will behave as expected.