Package org.apache.maven.surefire.booter
Class LazyTestsToRun
java.lang.Object
org.apache.maven.surefire.api.util.TestsToRun
org.apache.maven.surefire.booter.LazyTestsToRun
A variant of TestsToRun that is provided with test class names
from an
System.in
.
The method iterator()
returns an Iterator that blocks on calls to
Iterator.hasNext()
or Iterator.next()
until new classes are available, or no more
classes will be available or the internal stream is closed.
The iterator can be used only in one Thread and it is the thread which executes
provider implementation
.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CommandReader
private final MasterProcessChannelEncoder
-
Constructor Summary
ConstructorsConstructorDescriptionLazyTestsToRun
(MasterProcessChannelEncoder eventChannel, CommandReader commandReader) C'tor -
Method Summary
Methods inherited from class org.apache.maven.surefire.api.util.TestsToRun
containsAtLeast, containsExactly, fromClass, getClassByName, getLocatedClasses, isFinished, markTestSetFinished
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
eventChannel
-
commandReader
-
-
Constructor Details
-
LazyTestsToRun
LazyTestsToRun(MasterProcessChannelEncoder eventChannel, CommandReader commandReader) C'tor- Parameters:
eventChannel
- the output stream to use when requesting new new tests
-
-
Method Details
-
iterated
- Overrides:
iterated
in classTestsToRun
- Returns:
- test classes which have been retrieved by
iterator()
.
-
iterator
The iterator can be used only in one Thread. Returns an iterator over the located java.lang.Class objects- Specified by:
iterator
in interfaceIterable<Class<?>>
- Overrides:
iterator
in classTestsToRun
- Returns:
- an unmodifiable iterator
- See Also:
-
toString
- Overrides:
toString
in classTestsToRun
-
allowEagerReading
public boolean allowEagerReading()- Overrides:
allowEagerReading
in classTestsToRun
- Returns:
true
, if the classes may be read eagerly.false
, if the classes must only be read lazy.
-
findClass
-
newWeakIterator
- Returns:
- snapshot of tests upon constructs of
iterator
. Therefore weakly consistent whileiterator()
is being iterated.
-