Package org.reactivestreams.tck
Class TestEnvironment.Latch
- java.lang.Object
-
- org.reactivestreams.tck.TestEnvironment.Latch
-
- Enclosing class:
- TestEnvironment
public static class TestEnvironment.Latch extends java.lang.Object
Like a CountDownLatch, but resettable and with some convenience methods
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
TestEnvironment.Latch.ExpectedClosedLatchException
(package private) static class
TestEnvironment.Latch.ExpectedOpenLatchException
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.CountDownLatch
countDownLatch
private TestEnvironment
env
-
Constructor Summary
Constructors Constructor Description Latch(TestEnvironment env)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assertClosed(java.lang.String openErrorMsg)
void
assertOpen(java.lang.String closedErrorMsg)
void
close()
void
expectClose(long timeoutMillis, java.lang.String notClosedErrorMsg)
void
expectClose(java.lang.String notClosedErrorMsg)
boolean
isClosed()
void
reOpen()
-
-
-
Field Detail
-
env
private final TestEnvironment env
-
countDownLatch
private volatile java.util.concurrent.CountDownLatch countDownLatch
-
-
Constructor Detail
-
Latch
public Latch(TestEnvironment env)
-
-
Method Detail
-
reOpen
public void reOpen()
-
isClosed
public boolean isClosed()
-
close
public void close()
-
assertClosed
public void assertClosed(java.lang.String openErrorMsg)
-
assertOpen
public void assertOpen(java.lang.String closedErrorMsg)
-
expectClose
public void expectClose(java.lang.String notClosedErrorMsg) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
expectClose
public void expectClose(long timeoutMillis, java.lang.String notClosedErrorMsg) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
-