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 class
private final class
private final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Thread
private final MasterProcessChannelDecoder
private int
private static final String
private final Queue<BiProperty<MasterProcessCommand,
CommandListener>> private final ConsoleLogger
private final Semaphore
private final Shutdown
private final CountDownLatch
private final AtomicReference<Thread.State>
private final CopyOnWriteArrayList<String>
-
Constructor Summary
ConstructorsConstructorDescriptionCommandReader
(MasterProcessChannelDecoder decoder, Shutdown shutdown, ConsoleLogger logger) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addByeAckListener
(CommandListener listener) private void
addListener
(MasterProcessCommand cmd, CommandListener listener) void
addNoopListener
(CommandListener listener) void
addShutdownListener
(CommandListener listener) void
addSkipNextTestsListener
(CommandListener listener) private void
boolean
getIterableClasses
(MasterProcessChannelEncoder eventChannel) The iterator can be used only in one Thread.private boolean
insertToQueue
(String test) private boolean
private boolean
iterated()
private void
void
stop()
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:
awaitStarted
in interfaceCommandChainReader
- Throws:
TestSetFailedException
-
addSkipNextTestsListener
- Specified by:
addSkipNextTestsListener
in interfaceCommandChainReader
-
addShutdownListener
- Specified by:
addShutdownListener
in 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:
true
ifLAST_TEST_SYMBOL
found at the last index intestClasses
.
-
makeQueueFull
private void makeQueueFull() -
insertToQueue
-
awaitNextTest
private void awaitNextTest() -
wakeupIterator
private void wakeupIterator()
-