public final class TestLessInputStream extends AbstractCommandStream
Modifier and Type | Class and Description |
---|---|
static class |
TestLessInputStream.TestLessInputStreamBuilder
Builds
streams , registers cachable commands
and provides accessible API to dispatch immediate commands to all atomically
alive streams. |
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.Semaphore |
barrier |
private TestLessInputStream.TestLessInputStreamBuilder |
builder |
private java.util.Iterator<Command> |
cachableCommands |
private java.util.concurrent.atomic.AtomicBoolean |
closed |
private java.util.Queue<Command> |
immediateCommands |
Modifier | Constructor and Description |
---|---|
private |
TestLessInputStream(TestLessInputStream.TestLessInputStreamBuilder builder) |
Modifier and Type | Method and Description |
---|---|
(package private) int |
availablePermits()
For testing purposes only.
|
private void |
awaitNextCommand() |
protected void |
beforeNextCommand()
Possibly waiting for next command (see
AbstractCommandStream.nextCommand() ) unless the stream is atomically
closed (see AbstractCommandStream.isClosed() returns true ) before this method has returned. |
protected boolean |
canContinue()
Unnecessarily opposite to
AbstractCommandStream.isClosed() however may respect
last command and AbstractCommandStream.isClosed() . |
void |
close() |
protected boolean |
isClosed() |
protected Command |
nextCommand() |
void |
noop() |
void |
provideNewTest()
Notifies
TestProvidingInputStream in order to dispatch a new test back to the forked
jvm (particular fork which hits this call); or do nothing in TestLessInputStream . |
void |
shutdown(Shutdown shutdownType) |
void |
skipSinceNextTest()
Sends an event to a fork jvm in order to skip tests.
|
getLastCommand, invalidateInternalBuffer, read
setFlushReceiverProvider, tryFlush
private final java.util.concurrent.Semaphore barrier
private final java.util.concurrent.atomic.AtomicBoolean closed
private final java.util.Queue<Command> immediateCommands
private final TestLessInputStream.TestLessInputStreamBuilder builder
private java.util.Iterator<Command> cachableCommands
private TestLessInputStream(TestLessInputStream.TestLessInputStreamBuilder builder)
public void provideNewTest()
NotifiableTestStream
TestProvidingInputStream
in order to dispatch a new test back to the forked
jvm (particular fork which hits this call); or do nothing in TestLessInputStream
.public void skipSinceNextTest()
NotifiableTestStream
public void shutdown(Shutdown shutdownType)
public void noop()
protected boolean isClosed()
isClosed
in class AbstractCommandStream
protected boolean canContinue()
AbstractCommandStream
AbstractCommandStream.isClosed()
however may respect
last command
and AbstractCommandStream.isClosed()
.canContinue
in class AbstractCommandStream
protected Command nextCommand()
nextCommand
in class AbstractCommandStream
protected void beforeNextCommand() throws java.io.IOException
AbstractCommandStream
AbstractCommandStream.nextCommand()
) unless the stream is atomically
closed (see AbstractCommandStream.isClosed()
returns true
) before this method has returned.beforeNextCommand
in class AbstractCommandStream
java.io.IOException
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
int availablePermits()
beforeNextCommand()
private void awaitNextCommand() throws java.io.IOException
java.io.IOException