Class TestLessInputStream.TestLessInputStreamBuilder
- java.lang.Object
-
- org.apache.maven.plugin.surefire.booterclient.lazytestprovider.TestLessInputStream.TestLessInputStreamBuilder
-
- Enclosing class:
- TestLessInputStream
public static final class TestLessInputStream.TestLessInputStreamBuilder extends java.lang.Object
Buildsstreams
, registers cachable commands and provides accessible API to dispatch immediate commands to all atomically alive streams.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
TestLessInputStream.TestLessInputStreamBuilder.CachableCommands
Event is persisted.private class
TestLessInputStream.TestLessInputStreamBuilder.CIt
private class
TestLessInputStream.TestLessInputStreamBuilder.ImmediateCommands
Event is called just now for all alive streams and command is not persisted.private static class
TestLessInputStream.TestLessInputStreamBuilder.Node
-
Field Summary
Fields Modifier and Type Field Description private java.util.Queue<TestLessInputStream>
aliveStreams
private TestLessInputStream.TestLessInputStreamBuilder.CachableCommands
cachableCommands
private TestLessInputStream.TestLessInputStreamBuilder.Node
head
private TestLessInputStream.TestLessInputStreamBuilder.ImmediateCommands
immediateCommands
private java.lang.Iterable<Command>
iterableCachable
private java.util.concurrent.locks.ReentrantReadWriteLock
rwLock
-
Constructor Summary
Constructors Constructor Description TestLessInputStreamBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
addTailNodeIfAbsent(Command command)
TestLessInputStream
build()
NotifiableTestStream
getCachableCommands()
Cached commands are sent to all alive or future alive forks.NotifiableTestStream
getImmediateCommands()
OnlyNotifiableTestStream.noop()
andNotifiableTestStream.shutdown(Shutdown)
are supported.(package private) java.lang.Iterable<Command>
getIterableCachable()
The iterator is not thread safe.private static TestLessInputStream.TestLessInputStreamBuilder.Node
nextCachedNode(TestLessInputStream.TestLessInputStreamBuilder.Node current)
void
removeStream(TestLessInputStream is)
-
-
-
Field Detail
-
rwLock
private final java.util.concurrent.locks.ReentrantReadWriteLock rwLock
-
aliveStreams
private final java.util.Queue<TestLessInputStream> aliveStreams
-
immediateCommands
private final TestLessInputStream.TestLessInputStreamBuilder.ImmediateCommands immediateCommands
-
cachableCommands
private final TestLessInputStream.TestLessInputStreamBuilder.CachableCommands cachableCommands
-
head
private final TestLessInputStream.TestLessInputStreamBuilder.Node head
-
iterableCachable
private final java.lang.Iterable<Command> iterableCachable
-
-
Method Detail
-
build
public TestLessInputStream build()
-
removeStream
public void removeStream(TestLessInputStream is)
-
getImmediateCommands
public NotifiableTestStream getImmediateCommands()
OnlyNotifiableTestStream.noop()
andNotifiableTestStream.shutdown(Shutdown)
are supported. Another methods throwUnsupportedOperationException
.- Returns:
- commands which are immediately transmitted once to all alive forked JVMs, not cached. As opposite to cached commands, the immediate commands disappear and cannot be seen by any fork initiated after the command has dispatched.
-
getCachableCommands
public NotifiableTestStream getCachableCommands()
Cached commands are sent to all alive or future alive forks. These are termination commands which are not reversible and therefore onlyNotifiableTestStream.shutdown(Shutdown)
andNotifiableTestStream.skipSinceNextTest()
are supported. Another methods throwUnsupportedOperationException
.- Returns:
- commands which are cached for currently alive or future forks.
-
getIterableCachable
java.lang.Iterable<Command> getIterableCachable()
The iterator is not thread safe.
-
addTailNodeIfAbsent
private boolean addTailNodeIfAbsent(Command command)
-
nextCachedNode
private static TestLessInputStream.TestLessInputStreamBuilder.Node nextCachedNode(TestLessInputStream.TestLessInputStreamBuilder.Node current)
-
-