Class TestLessInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.maven.plugin.surefire.booterclient.lazytestprovider.AbstractForkInputStream
-
- org.apache.maven.plugin.surefire.booterclient.lazytestprovider.AbstractCommandStream
-
- org.apache.maven.plugin.surefire.booterclient.lazytestprovider.TestLessInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,NotifiableTestStream
public final class TestLessInputStream extends AbstractCommandStream
Dispatches commands without tests.- Since:
- 2.19
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTestLessInputStream.TestLessInputStreamBuilderBuildsstreams, registers cachable commands and provides accessible API to dispatch immediate commands to all atomically alive streams.
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.Semaphorebarrierprivate TestLessInputStream.TestLessInputStreamBuilderbuilderprivate java.util.Iterator<Command>cachableCommandsprivate java.util.concurrent.atomic.AtomicBooleanclosedprivate java.util.Queue<Command>immediateCommands
-
Constructor Summary
Constructors Modifier Constructor Description privateTestLessInputStream(TestLessInputStream.TestLessInputStreamBuilder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacknowledgeByeEventReceived()(package private) intavailablePermits()For testing purposes only.private voidawaitNextCommand()protected voidbeforeNextCommand()Possibly waiting for next command (seeAbstractCommandStream.nextCommand()) unless the stream is atomically closed (seeAbstractCommandStream.isClosed()returnstrue) before this method has returned.voidclose()protected booleanisClosed()protected CommandnextCommand()voidnoop()voidprovideNewTest()NotifiesTestProvidingInputStreamin order to dispatch a new test back to the forked jvm (particular fork which hits this call); or do nothing inTestLessInputStream.voidshutdown(Shutdown shutdownType)voidskipSinceNextTest()Sends an event to a fork jvm in order to skip tests.-
Methods inherited from class org.apache.maven.plugin.surefire.booterclient.lazytestprovider.AbstractCommandStream
canContinue, invalidateInternalBuffer, read
-
Methods inherited from class org.apache.maven.plugin.surefire.booterclient.lazytestprovider.AbstractForkInputStream
setFlushReceiverProvider, tryFlush
-
-
-
-
Field Detail
-
barrier
private final java.util.concurrent.Semaphore barrier
-
closed
private final java.util.concurrent.atomic.AtomicBoolean closed
-
immediateCommands
private final java.util.Queue<Command> immediateCommands
-
builder
private final TestLessInputStream.TestLessInputStreamBuilder builder
-
cachableCommands
private java.util.Iterator<Command> cachableCommands
-
-
Constructor Detail
-
TestLessInputStream
private TestLessInputStream(TestLessInputStream.TestLessInputStreamBuilder builder)
-
-
Method Detail
-
provideNewTest
public void provideNewTest()
Description copied from interface:NotifiableTestStreamNotifiesTestProvidingInputStreamin order to dispatch a new test back to the forked jvm (particular fork which hits this call); or do nothing inTestLessInputStream.
-
skipSinceNextTest
public void skipSinceNextTest()
Description copied from interface:NotifiableTestStreamSends an event to a fork jvm in order to skip tests. Returns immediately without blocking.
-
shutdown
public void shutdown(Shutdown shutdownType)
-
noop
public void noop()
-
acknowledgeByeEventReceived
public void acknowledgeByeEventReceived()
-
isClosed
protected boolean isClosed()
- Specified by:
isClosedin classAbstractCommandStream
-
nextCommand
protected Command nextCommand()
- Specified by:
nextCommandin classAbstractCommandStream
-
beforeNextCommand
protected void beforeNextCommand() throws java.io.IOExceptionDescription copied from class:AbstractCommandStreamPossibly waiting for next command (seeAbstractCommandStream.nextCommand()) unless the stream is atomically closed (seeAbstractCommandStream.isClosed()returnstrue) before this method has returned.- Overrides:
beforeNextCommandin classAbstractCommandStream- Throws:
java.io.IOException- stream error while waiting for notification regarding next test required by forked jvm
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream
-
availablePermits
int availablePermits()
For testing purposes only.- Returns:
- permits used internally by
beforeNextCommand()
-
awaitNextCommand
private void awaitNextCommand() throws java.io.IOException- Throws:
java.io.IOException
-
-