Enum Class PlanningStrategy

java.lang.Object
java.lang.Enum<PlanningStrategy>
jp.co.moneyforward.autotest.framework.testengine.PlanningStrategy
All Implemented Interfaces:
Serializable, Comparable<PlanningStrategy>, Constable

public enum PlanningStrategy extends Enum<PlanningStrategy>
Used with Spec#planExecutionWith. Specifies how actual execution of actions (given by Spec#{beforeAll,beforeEach,value,afterEach,afterAll}) is planned.
See Also:
  • Enum Constant Details

    • PASSTHROUGH

      public static final PlanningStrategy PASSTHROUGH
      Actions will be executed as they are specified. That is, actions specified for beforeAll will be executed in beforeAll test execution phase JUnit, as such.
    • DEPENDENCY_BASED

      public static final PlanningStrategy DEPENDENCY_BASED

      Actions will be executed based on dependency resolution. That is, ones specified in value will be considered "true" tests and actions depended on by them will be considered "arranging" (or "set up") actions. The framework ensures ones not explicitly specified in value but depended on by one in the step to be included in beforeAll step.

      If an action is annotated with @ClosedBy and it is in beforeAll step, the referenced action will be included in afterAll step. This addition is done in the reverse order, where actions which have @ClosedBy are found. At this addition, the target action (an action by specified by @ClosedBy annotation) should be wrapped by the actionunit 's When action, so that it will be performed the original action has succeeded. (Without this mechanism, a releasing action will be executed even if a resource to be released is not allocated because of a failure)

      Similarly, if an action in beforeEach has @ClosedBy, the referenced action will be included in afterEach step.

      Suppose, open has the @ClosedBy("close"). If it is in beforeAll, close will be included in afterAll. If close is already in afterAll, it will not be added again. If it is in beforeEach, close will be included in afterEach.

      This feature is useful to ensure allocated resources are released.

      See Also:
  • Method Details

    • values

      public static PlanningStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PlanningStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • composeDependencyMapInMain

      public static Map<String, List<String>> composeDependencyMapInMain(List<String> main, Map<String, List<String>> sceneCallGraph)
    • planExecution

      public abstract AutotestEngine.ExecutionPlan planExecution(AutotestExecution.Spec executionSpec, Map<String, List<String>> sceneCallGraph, Map<String, List<String>> assertions)
      Returns an execution plan based on the design which this instance specifies.
      Parameters:
      executionSpec - A "spec" object of the execution given at runtime.
      sceneCallGraph - A graph that describes relationships between sceneCalls.
      assertions - A map from a normal scene to assertion scenes.
      Returns:
      An execution plan.