Class IdempotentCloserTest
java.lang.Object
org.apache.kafka.common.internals.IdempotentCloserTest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidTests basic functionality, i.e.voidTests that theIdempotentCloser.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.voidTests that the onClose callback is only invoked once.voidTests that if theIdempotentCloseris created with its initial state as closed, the various APIs will behave as expected.voidTests that the onClose callback is only invoked once, while the onPreviousClose callback can be invoked a variable number of times.voidTests that if the invoked onClose callback throws an exception, that: The exception does not prevent theIdempotentCloserfrom being updated to the closed state The exception is bubbled up to the uservoidTests that if the invoked onSubsequentClose callback throws an exception, that it is thrown fromIdempotentCloser.close(Runnable, Runnable)so the user can handle it.
-
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 theIdempotentCloser.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:- The exception does not prevent the
IdempotentCloserfrom being updated to the closed state - The exception is bubbled up to the user
- The exception does not prevent the
-
testErrorsInOnPreviousCloseCallbacksAreNotSwallowed
@Test public void testErrorsInOnPreviousCloseCallbacksAreNotSwallowed()Tests that if the invoked onSubsequentClose callback throws an exception, that it is thrown fromIdempotentCloser.close(Runnable, Runnable)so the user can handle it. -
testCreatedClosed
@Test public void testCreatedClosed()Tests that if theIdempotentCloseris created with its initial state as closed, the various APIs will behave as expected.
-