Class EnsuredCall

java.lang.Object
jp.co.moneyforward.autotest.framework.action.CallDecorator.Base<SceneCall>
jp.co.moneyforward.autotest.framework.action.EnsuredCall
All Implemented Interfaces:
Call, CallDecorator<SceneCall>

public final class EnsuredCall extends CallDecorator.Base<SceneCall>

A class to provide a construct to "ensure" a specific state checked by target call.

Each element in ensurers is performed first, then target is performed. This procedure is repeated until:

  • Both an element from ensurers and the target are successfully performed.
  • Either an element from ensurer or the target throws a non-recoverable exception.

target should be a call to an action, which succeeds when and only when the state you want to ensure is satisfied. Each element in ensurers should be an action that tries to make the state meet your expectation. The ensurers should be sorted by an ascending order of their execution cost.

See Also:
  • Constructor Details

    • EnsuredCall

      public EnsuredCall(SceneCall target, List<SceneCall> ensurers, ResolverBundle resolverBundle)
      Creates an object of this class.
      Parameters:
      target - A target class to be decorated.
  • Method Details

    • toAction

      public com.github.dakusui.actionunit.core.Action toAction(ActionComposer actionComposer)
      Description copied from interface: Call

      Converts this call to action to an action object.

      This is an Node#accept method in the Visitor pattern. Usually implementations of this method should call back by actionComposer#create(this) to make a double dispatch happen.

      Each value in the ongoingResolverBundle is a function that resolves a value of a variable designated by a corresponding key.

      Parameters:
      actionComposer - A visitor, which creates an action from this object.
      Returns:
      An action created by actionComposer.
    • ensurers

      public List<SceneCall> ensurers()
      Returns "ensurer" calls.
      Returns:
      A list of "ensurer" calls.