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:
Closeable
,AutoCloseable
,NotifiableTestStream
Dispatches commands without tests.
- Since:
- 2.19
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Buildsstreams
, registers cachable commands and provides accessible API to dispatch immediate commands to all atomically alive streams. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Semaphore
private final TestLessInputStream.TestLessInputStreamBuilder
private final AtomicBoolean
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
-
Method Summary
Modifier and TypeMethodDescriptionvoid
(package private) int
For testing purposes only.private void
protected void
Possibly waiting for next command (seeAbstractCommandStream.nextCommand()
) unless the stream is atomically closed (seeAbstractCommandStream.isClosed()
returnstrue
) before this method has returned.void
close()
protected boolean
isClosed()
protected Command
void
noop()
void
NotifiesTestProvidingInputStream
in order to dispatch a new test back to the forked jvm (particular fork which hits this call); or do nothing inTestLessInputStream
.void
void
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
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
barrier
-
closed
-
immediateCommands
-
builder
-
cachableCommands
-
-
Constructor Details
-
TestLessInputStream
-
-
Method Details
-
provideNewTest
public void provideNewTest()Description copied from interface:NotifiableTestStream
NotifiesTestProvidingInputStream
in 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:NotifiableTestStream
Sends an event to a fork jvm in order to skip tests. Returns immediately without blocking. -
shutdown
-
noop
public void noop() -
acknowledgeByeEventReceived
public void acknowledgeByeEventReceived() -
isClosed
protected boolean isClosed()- Specified by:
isClosed
in classAbstractCommandStream
-
nextCommand
- Specified by:
nextCommand
in classAbstractCommandStream
-
beforeNextCommand
Description copied from class:AbstractCommandStream
Possibly waiting for next command (seeAbstractCommandStream.nextCommand()
) unless the stream is atomically closed (seeAbstractCommandStream.isClosed()
returnstrue
) before this method has returned.- Overrides:
beforeNextCommand
in classAbstractCommandStream
- Throws:
IOException
- stream error while waiting for notification regarding next test required by forked jvm
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
-
availablePermits
int availablePermits()For testing purposes only.- Returns:
- permits used internally by
beforeNextCommand()
-
awaitNextCommand
- Throws:
IOException
-