Package org.apache.maven.surefire.booter
Class CommandReader
java.lang.Object
org.apache.maven.surefire.booter.CommandReader
- All Implemented Interfaces:
CommandChainReader
Reader of commands coming from plugin(master) process.
- Since:
- 2.19
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final classprivate final classprivate final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Threadprivate final MasterProcessChannelDecoderprivate intprivate static final Stringprivate final Queue<BiProperty<MasterProcessCommand,CommandListener>> private final ConsoleLoggerprivate final Semaphoreprivate final Shutdownprivate final CountDownLatchprivate final AtomicReference<Thread.State>private final CopyOnWriteArrayList<String> -
Constructor Summary
ConstructorsConstructorDescriptionCommandReader(MasterProcessChannelDecoder decoder, Shutdown shutdown, ConsoleLogger logger) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddByeAckListener(CommandListener listener) private voidaddListener(MasterProcessCommand cmd, CommandListener listener) voidaddNoopListener(CommandListener listener) voidaddShutdownListener(CommandListener listener) voidaddSkipNextTestsListener(CommandListener listener) private voidbooleangetIterableClasses(MasterProcessChannelEncoder eventChannel) The iterator can be used only in one Thread.private booleaninsertToQueue(String test) private booleanprivate booleaniterated()private voidvoidstop()private void
-
Field Details
-
LAST_TEST_SYMBOL
- See Also:
-
listeners
-
commandThread
-
state
-
startMonitor
-
nextCommandNotifier
-
testClasses
-
decoder
-
shutdown
-
logger
-
iteratedCount
private int iteratedCount
-
-
Constructor Details
-
CommandReader
-
-
Method Details
-
awaitStarted
- Specified by:
awaitStartedin interfaceCommandChainReader- Throws:
TestSetFailedException
-
addSkipNextTestsListener
- Specified by:
addSkipNextTestsListenerin interfaceCommandChainReader
-
addShutdownListener
- Specified by:
addShutdownListenerin interfaceCommandChainReader
-
addNoopListener
-
addByeAckListener
-
addListener
-
iterated
- Returns:
- test classes which have been retrieved by
getIterableClasses(MasterProcessChannelEncoder).
-
getIterableClasses
The iterator can be used only in one Thread. Two simultaneous instances are not allowed for sake of only onenextCommandNotifier.- Parameters:
eventChannel- original stream in current JVM process- Returns:
- Iterator with test classes lazily loaded as commands from the main process
-
stop
public void stop() -
isStopped
private boolean isStopped() -
isQueueFull
private boolean isQueueFull()- Returns:
trueifLAST_TEST_SYMBOLfound at the last index intestClasses.
-
makeQueueFull
private void makeQueueFull() -
insertToQueue
-
awaitNextTest
private void awaitNextTest() -
wakeupIterator
private void wakeupIterator()
-