Class TestProvidingInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, NotifiableTestStream, 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.
    • Field Detail

      • barrier

        private final java.util.concurrent.Semaphore barrier
      • commands

        private final java.util.Queue<Command> commands
      • closed

        private final java.util.concurrent.atomic.AtomicBoolean closed
      • testClassNames

        private final java.util.Queue<java.lang.String> testClassNames
    • 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

      • testSetFinished

        void testSetFinished()
        For testing purposes.
      • 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​(Shutdown shutdownType)
      • noop

        public void noop()
      • acknowledgeByeEventReceived

        public void acknowledgeByeEventReceived()
      • isClosed

        public boolean isClosed()
      • provideNewTest

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

        public void close()
      • awaitNextTest

        private void awaitNextTest()
                            throws java.io.IOException
        Throws:
        java.io.IOException