Class TestProvidingInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, NotifiableTestStream, org.apache.maven.surefire.extensions.CommandReader

    public final class TestProvidingInputStream
    extends DefaultCommandReader
    An InputStream that, when read, provides test class names out of a queue.
    The Stream provides only one test at a time, but only after provideNewTest() has been invoked.
    The instance is used only in reusable forks in ForkStarter by one Thread.
    Author:
    Andreas Gudian, Tibor Digana (tibor17)
    • Constructor Detail

      • TestProvidingInputStream

        public TestProvidingInputStream​(java.util.Queue<java.lang.String> testClassNames)
        C'tor
        Parameters:
        testClassNames - source of the tests to be read from this stream
    • Method Detail

      • 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

        public void shutdown​(org.apache.maven.surefire.api.booter.Shutdown shutdownType)
      • noop

        public void noop()
      • acknowledgeByeEventReceived

        public void acknowledgeByeEventReceived()
      • beforeNextCommand

        protected void beforeNextCommand()
                                  throws java.io.IOException
        Description copied from class: DefaultCommandReader
        Possibly waiting for next command (see DefaultCommandReader.nextCommand()) unless the stream is atomically closed (see CommandReader.isClosed() returns true) before this method has returned.
        Overrides:
        beforeNextCommand in class DefaultCommandReader
        Throws:
        java.io.IOException - stream error while waiting for notification regarding next test required by forked jvm
      • isClosed

        public boolean isClosed()
      • provideNewTest

        public void provideNewTest()
        Signal that a new test is to be provided.
      • close

        public void close()