Package

work.martins.simon.expect

core

Permalink

package core

Visibility
  1. Public
  2. All

Type Members

  1. trait Action[-W <: When[_]] extends AnyRef

    Permalink

  2. case class ChangeToNewExpect[R](expect: Expect[R]) extends ExecutionAction with Product with Serializable

    Permalink
  3. case class EndOfFileWhen[R](actions: Action[EndOfFileWhen[R]]*) extends When[R] with Product with Serializable

    Permalink
  4. sealed trait ExecutionAction extends AnyRef

    Permalink
  5. class Expect[R] extends LazyLogging

    Permalink
  6. class ExpectBlock[R] extends LazyLogging

    Permalink
  7. case class IntermediateResult[R](output: String, value: R, executionAction: ExecutionAction) extends Product with Serializable

    Permalink
  8. case class RegexWhen[R](pattern: Regex)(actions: Action[RegexWhen[R]]*) extends When[R] with Product with Serializable

    Permalink
  9. case class Returning[R](result: () ⇒ R) extends Action[When[R]] with Product with Serializable

    Permalink

    When this action is executed the result of evaluating result is returned by the current run of Expect.

    When this action is executed the result of evaluating result is returned by the current run of Expect. If more than one returning action is added to a When only the last result will be returned. Note however that every ReturningAction will still be executed.

  10. case class ReturningExpect[R](result: () ⇒ Expect[R]) extends Action[When[R]] with Product with Serializable

    Permalink

    When this action is executed:

    When this action is executed:

    1. The current run of Expect is terminated (like with an Exit) but its return value is discarded. 2. result is evaluated to obtain the expect. 3. The obtained expect is run with the same run context (timeout, charset, etc) as the terminated expect. 4. The result obtained in the previous step becomes the result of the current expect (the terminated one).

    This works out as a special combination of an Exit with a Returning. Where the exit deallocates the resources allocated by the current expect. And the result of the Returning is obtained from the result of executing the received expect.

    Any action or expect block added after this will not be executed.

  11. case class ReturningExpectWithRegex[R](result: (Match) ⇒ Expect[R]) extends Action[RegexWhen[R]] with Product with Serializable

    Permalink

    When this action is executed:

    When this action is executed:

    1. The current run of Expect is terminated (like with an Exit) but its return value is discarded. 2. result is evaluated to obtain the expect. 3. The obtained expect is run with the same run context (timeout, charset, etc) as the terminated expect. 4. The result obtained in the previous step becomes the result of the current expect (the terminated one).

    This works out as a special combination of an Exit with a Returning. Where the exit deallocates the resources allocated by the current expect. And the result of the Returning is obtained from the result of executing the received expect.

    This allows to construct the Expect based on the regex Match. This action can only be added to a RegexWhen. Any action or expect block added after this will not be executed.

  12. case class ReturningWithRegex[R](result: (Match) ⇒ R) extends Action[RegexWhen[R]] with Product with Serializable

    Permalink

    When this action is executed the result of evaluating result is returned by the current run of Expect.

    When this action is executed the result of evaluating result is returned by the current run of Expect. This allows to return data based on the regex Match. This action can only be added to a RegexWhen. If more than one returning action is added to a When only the last result will be returned. Note however that every ReturningAction will still be executed.

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

    Permalink

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

    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.

  14. case class Send(text: String) extends Action[When[_]] with Product with Serializable

    Permalink

    When this action is executed text will be sent to the stdIn of the underlying process.

    When this action is executed text will be sent to the stdIn of the underlying process.

    text

    the text to send.

  15. case class SendWithRegex(text: (Match) ⇒ String) extends Action[RegexWhen[_]] with Product with Serializable

    Permalink

    When this action is executed the result of evaluating text will be sent to the stdIn of the underlying process.

    When this action is executed the result of evaluating text will be sent to the stdIn of the underlying process. This allows to send data to the process based on the regex Match. This action can only be added to a RegexWhen.

    text

    the text to send.

  16. case class StringWhen[R](pattern: String)(actions: Action[StringWhen[R]]*) extends When[R] with Product with Serializable

    Permalink
  17. case class TimeoutWhen[R](actions: Action[TimeoutWhen[R]]*) extends When[R] with Product with Serializable

    Permalink
  18. trait When[R] extends AnyRef

    Permalink

Value Members

  1. object Continue extends ExecutionAction with Product with Serializable

    Permalink
  2. object Exit extends Action[When[_]] with Product with Serializable

    Permalink

    When this action is executed the current run of Expect is terminated causing it to return the last value, if there is a ReturningAction, or the default value otherwise.

    When this action is executed the current run of Expect is terminated causing it to return the last value, if there is a ReturningAction, or the default value otherwise. Any action or expect block added after this will not be executed.

  3. object Sendln

    Permalink
  4. object SendlnWithRegex

    Permalink
  5. object Terminate extends ExecutionAction with Product with Serializable

    Permalink

Ungrouped