Class

work.martins.simon.expect.core

RichProcess

Related Doc: package core

Permalink

case class RichProcess(command: Seq[String], timeout: FiniteDuration, charset: Charset, bufferSize: Int, redirectStdErrToStdOut: Boolean) extends Product with Serializable

Launches a java.lang.Process with methods to read and print from its stdout and stdin respectively.

command

the command to launch and its arguments.

timeout

how much time to wait when performing a read.

charset

the charset used for encoding and decoding the Strings.

bufferSize

how many bytes to read.

redirectStdErrToStdOut

whether to redirect stdErr to stdOut.

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RichProcess
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RichProcess(command: Seq[String], timeout: FiniteDuration, charset: Charset, bufferSize: Int, redirectStdErrToStdOut: Boolean)

    Permalink

    command

    the command to launch and its arguments.

    timeout

    how much time to wait when performing a read.

    charset

    the charset used for encoding and decoding the Strings.

    bufferSize

    how many bytes to read.

    redirectStdErrToStdOut

    whether to redirect stdErr to stdOut.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. val bufferSize: Int

    Permalink

    how many bytes to read.

  6. val charset: Charset

    Permalink

    the charset used for encoding and decoding the Strings.

  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. val command: Seq[String]

    Permalink

    the command to launch and its arguments.

  9. def deadLineHasTimeLeft(): Boolean

    Permalink

    returns

    whether the current deadline has any time left.

  10. def destroy(): Unit

    Permalink

    If the underlying process is still alive it's destroy method is invoked and the input and output streams are closed.

  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. def print(text: String): Unit

    Permalink

    Writes to the underlying OutputStream the bytes obtained from decoding text using charset.

    Writes to the underlying OutputStream the bytes obtained from decoding text using charset. Followed by a flush of the OutputStream.

    text

    the text to write to the OutputStream.

  19. val process: Process

    Permalink
  20. val processBuilder: ProcessBuilder

    Permalink
  21. def read()(implicit ex: ExecutionContext): String

    Permalink

    Tries to read bufferSize bytes from the underlying InputStream.

    Tries to read bufferSize bytes from the underlying InputStream. If no bytes are read within timeout a TimeoutException will be thrown. If the end of file is reached an EOFException is thrown. Otherwise, a String encoded with charset is created from the read bytes. This method awaits for the result of a future, aka, is blocking.

    ex

    the ExecutionContext upon the internal Future will run.

    returns

    a String created from the read bytes encoded with charset.

  22. val redirectStdErrToStdOut: Boolean

    Permalink

    whether to redirect stdErr to stdOut.

  23. def resetDeadline(): Unit

    Permalink

    Resets the underlying deadline used when performing a read.

    Resets the underlying deadline used when performing a read. The new deadline is timeout.fromNow.

  24. val stdin: OutputStream

    Permalink
  25. val stdout: InputStream

    Permalink
  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. val timeout: FiniteDuration

    Permalink

    how much time to wait when performing a read.

  28. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped