java.lang.Object
java.io.InputStream
org.apache.maven.plugin.surefire.booterclient.lazytestprovider.AbstractForkInputStream
org.apache.maven.plugin.surefire.booterclient.lazytestprovider.AbstractCommandStream
All Implemented Interfaces:
Closeable, AutoCloseable, NotifiableTestStream
Direct Known Subclasses:
TestLessInputStream, TestProvidingInputStream

public abstract class AbstractCommandStream extends AbstractForkInputStream
Reader stream sends commands to forked jvm std-input-stream.
Since:
2.19
See Also:
  • Field Details

    • currentBuffer

      private byte[] currentBuffer
    • currentPos

      private int currentPos
  • Constructor Details

    • AbstractCommandStream

      public AbstractCommandStream()
  • Method Details

    • isClosed

      protected abstract boolean isClosed()
    • canContinue

      protected boolean canContinue()
      Opposite to isClosed().
      Returns:
      true if not closed
    • beforeNextCommand

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

      protected abstract Command nextCommand()
    • invalidateInternalBuffer

      protected final void invalidateInternalBuffer()
      Returns quietly and immediately.
    • read

      public int read() throws IOException
      Used by single thread in StreamFeeder class.
      Specified by:
      read in class InputStream
      Returns:
      Throws:
      IOException