Interface ActionComposer


public interface ActionComposer

An interface that models a factory of actions.

This interface is designed to be a "visitor" of "calls", each of which represents a call of an action (ActionFactory).

A call is a model of an occurrence of an action, and it has input and output.

Calls can be categorized into two. Calls for scenes (Scene) and calls for acts (Act). Corresponding to the subclasses of Act, there are subcategories of it, which are LeafAct, AssertionAct, and PipelinedAct.

In this interface, there are create(XyzCall xyzCall, Map<String, Function<Context, Object>> assignmentResolversFromCurrentCall) methods defined.

assignmentResolversFromCurrentCall is a map from a variable name to a function which resolves its value from the ongoing context object. By relying on this object for resolving variable values referenced inside Act objects (, which are held by Calls), we can define Act objects work in different variable spaces without changing code (transparent to variable space name, which is determined by a call's object name).

See Also:
  • Field Details

    • LOGGER

      static final org.slf4j.Logger LOGGER
      A logger object
  • Method Details

    • ongoingSceneCall

      SceneCall ongoingSceneCall()
      Returns currently ongoing SceneCall object.
      Returns:
      Currently ongoing SceneCall object.
    • executionEnvironment

      ExecutionEnvironment executionEnvironment()
      Returns an execution environment in which actions created by this composer objects are performed.
      Returns:
      An execution environment.
    • ongoingWorkingVariableStoreNames

      List<String> ongoingWorkingVariableStoreNames()
    • create

      default com.github.dakusui.actionunit.core.Action create(SceneCall sceneCall)
      Creates an action for a given SceneCall object.
      Parameters:
      sceneCall - A scene call from which an action should be created.
      Returns:
      A sequential action created from sceneCall.
    • create

      default com.github.dakusui.actionunit.core.Action create(EnsuredCall ensuredCall)
    • create

      default com.github.dakusui.actionunit.core.Action create(RetryCall retryCall)
    • create

      default com.github.dakusui.actionunit.core.Action create(AssertionCall<?> call)
    • create

      default com.github.dakusui.actionunit.core.Action create(ActCall<?,?> actCall)
    • createActionComposer

      static ActionComposer createActionComposer(ExecutionEnvironment executionEnvironment)