Class StateMachine

java.lang.Object
org.jmock.internal.StateMachine
All Implemented Interfaces:
org.hamcrest.SelfDescribing, States, StatesClause

public class StateMachine extends Object implements States
  • Field Details

    • name

      private final String name
    • currentState

      private String currentState
  • Constructor Details

    • StateMachine

      public StateMachine(String name)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • startsAs

      public States startsAs(String initialState)
      Description copied from interface: States
      Put the state machine into state initialState.
      Specified by:
      startsAs in interface States
      Parameters:
      initialState - The initial state of the state machine.
      Returns:
      Itself.
    • become

      public void become(String nextState)
      Description copied from interface: States
      Put the state machine into state nextState.
      Specified by:
      become in interface States
      Parameters:
      nextState - The next state of the state machine.
    • is

      public State is(String state)
      Specified by:
      is in interface StatesClause
    • isNot

      public StatePredicate isNot(String state)
      Specified by:
      isNot in interface StatesClause
    • describeTo

      public void describeTo(org.hamcrest.Description description)
      Specified by:
      describeTo in interface org.hamcrest.SelfDescribing