org.scalacheck.Commands

trait Command

[source: org/scalacheck/Commands.scala]

trait Command
extends AnyRef
Abstract commands are defined as subtypes of the traits Command or SetCommand. Each command must have a run method and a method that returns the new abstract state, as it should look after the command has been run. A command can also define a precondition that states how the current abstract state must look if the command should be allowed to run. Finally, we can also define a postcondition which verifies that the system under test is in a correct state after the command exectution.
Direct Known Subclasses:
Commands.SetCommand

Value Summary
val postConditions : scala.collection.mutable.ListBuffer[(State, State, Any) => Prop]
A postcondition is a function that takes three parameters, s0, s1 and r. s0 is the abstract state before the command was run, s1 is the abstract state after the command was run, and r is the result from the command's run method. The postcondition function should return a Boolean (or a Prop instance) that says if the condition holds or not. You can add several conditions to the postConditions list.
val preConditions : scala.collection.mutable.ListBuffer[(State) => Boolean]
A precondition is a function that takes the current abstract state as parameter and returns a boolean that says if the precondition is fulfilled or not. You can add several conditions to the precondition list
Method Summary
abstract def nextState (s : State) : State
def postCondition : (State, State, Any) => Prop
Returns all postconditions merged into a single function
def postCondition_= (f : (State, Any) => Prop) : Unit
def postCondition_= (f : (State, State, Any) => Prop) : Unit
def preCondition : (State) => Boolean
Returns all preconditions merged into a single function
def preCondition_= (f : (State) => Boolean) : Unit
abstract def run (s : State) : Any
protected[Commands] def run_ (s : State) : Any
Used internally.
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Value Details
val preConditions : scala.collection.mutable.ListBuffer[(State) => Boolean]
A precondition is a function that takes the current abstract state as parameter and returns a boolean that says if the precondition is fulfilled or not. You can add several conditions to the precondition list

val postConditions : scala.collection.mutable.ListBuffer[(State, State, Any) => Prop]
A postcondition is a function that takes three parameters, s0, s1 and r. s0 is the abstract state before the command was run, s1 is the abstract state after the command was run, and r is the result from the command's run method. The postcondition function should return a Boolean (or a Prop instance) that says if the condition holds or not. You can add several conditions to the postConditions list.

Method Details
protected[Commands] def run_(s : State) : Any
Used internally.

abstract def run(s : State) : Any

abstract def nextState(s : State) : State

@scala.deprecated

def preCondition_=(f : (State) => Boolean) : Unit
Deprecated
Use preConditions += ... instead.

def preCondition : (State) => Boolean
Returns all preconditions merged into a single function

@scala.deprecated

def postCondition_=(f : (State, Any) => Prop) : Unit
Deprecated
Use postConditions += ... instead.

@scala.deprecated

def postCondition_=(f : (State, State, Any) => Prop) : Unit
Deprecated
Use postConditions += ... instead.

def postCondition : (State, State, Any) => Prop
Returns all postconditions merged into a single function