Class DefaultTestCase

All Implemented Interfaces:
org.citrusframework.common.Described, org.citrusframework.common.Named, org.citrusframework.Completable, org.citrusframework.container.TestActionContainer, org.citrusframework.TestAction, org.citrusframework.TestActorAware, org.citrusframework.TestCase, org.citrusframework.TestGroupAware, org.citrusframework.TestParameterAware

public class DefaultTestCase extends AbstractActionContainer implements org.citrusframework.TestCase, org.citrusframework.TestGroupAware, org.citrusframework.TestParameterAware
Default test case implementation holding a list of test actions to execute. Test case also holds variable definitions and performs the test lifecycle such as start, finish, before and after test.
  • Constructor Details

    • DefaultTestCase

      public DefaultTestCase()
  • Method Details

    • doExecute

      public void doExecute(org.citrusframework.context.TestContext context)
      Description copied from class: AbstractTestAction
      Subclasses may add custom execution logic here.
      Specified by:
      doExecute in class AbstractTestAction
    • start

      public void start(org.citrusframework.context.TestContext context)
      Specified by:
      start in interface org.citrusframework.TestCase
    • beforeTest

      public void beforeTest(org.citrusframework.context.TestContext context)
      Specified by:
      beforeTest in interface org.citrusframework.TestCase
    • afterTest

      public void afterTest(org.citrusframework.context.TestContext context)
      Specified by:
      afterTest in interface org.citrusframework.TestCase
    • executeAction

      public void executeAction(org.citrusframework.TestAction action, org.citrusframework.context.TestContext context)
      Description copied from class: AbstractActionContainer
      Runs the give action and makes sure to properly set active and executed action state for this container.
      Specified by:
      executeAction in interface org.citrusframework.TestCase
      Overrides:
      executeAction in class AbstractActionContainer
    • fail

      public void fail(Throwable throwable)
      Specified by:
      fail in interface org.citrusframework.TestCase
    • finish

      public void finish(org.citrusframework.context.TestContext context)
      Method that will be executed in any case of test case result (success, error). Usually used for clean up tasks.
      Specified by:
      finish in interface org.citrusframework.TestCase
    • setVariableDefinitions

      public void setVariableDefinitions(Map<String,Object> variableDefinitions)
      Setter for variables.
    • getVariableDefinitions

      public Map<String,Object> getVariableDefinitions()
      Specified by:
      getVariableDefinitions in interface org.citrusframework.TestCase
    • getEndpointDefinitions

      public List<String> getEndpointDefinitions()
      Specified by:
      getEndpointDefinitions in interface org.citrusframework.TestCase
    • getEndpoints

      public List<org.citrusframework.endpoint.EndpointBuilder<?>> getEndpoints()
      Specified by:
      getEndpoints in interface org.citrusframework.TestCase
    • setFinalActions

      public void setFinalActions(List<org.citrusframework.TestAction> finalActions)
      Setter for finally chain.
    • toString

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

      public void addFinalAction(org.citrusframework.TestActionBuilder<?> testAction)
      Specified by:
      addFinalAction in interface org.citrusframework.TestCase
    • getMetaInfo

      public org.citrusframework.TestCaseMetaInfo getMetaInfo()
      Specified by:
      getMetaInfo in interface org.citrusframework.TestCase
    • setMetaInfo

      public void setMetaInfo(org.citrusframework.TestCaseMetaInfo metaInfo)
      Set the test case meta information.
      Parameters:
      metaInfo - the metaInfo to set
    • getFinalActions

      public List<org.citrusframework.TestAction> getFinalActions()
      Get all actions in the finally chain.
      Returns:
      the finalActions
    • setPackageName

      public void setPackageName(String packageName)
      Specified by:
      setPackageName in interface org.citrusframework.TestCase
    • getPackageName

      public String getPackageName()
      Specified by:
      getPackageName in interface org.citrusframework.TestCase
    • setTestClass

      public void setTestClass(Class<?> type)
      Specified by:
      setTestClass in interface org.citrusframework.TestCase
    • getTestClass

      public Class<?> getTestClass()
      Specified by:
      getTestClass in interface org.citrusframework.TestCase
    • setParameters

      public void setParameters(String[] parameterNames, Object[] parameterValues)
      Specified by:
      setParameters in interface org.citrusframework.TestParameterAware
    • getActionBuilders

      public List<org.citrusframework.TestActionBuilder<?>> getActionBuilders()
      Specified by:
      getActionBuilders in interface org.citrusframework.TestCase
    • getParameters

      public Map<String,Object> getParameters()
      Specified by:
      getParameters in interface org.citrusframework.TestParameterAware
    • setIncremental

      public void setIncremental(boolean incremental)
      Specified by:
      setIncremental in interface org.citrusframework.TestCase
    • isIncremental

      public boolean isIncremental()
      Specified by:
      isIncremental in interface org.citrusframework.TestCase
    • setTestResult

      public void setTestResult(org.citrusframework.TestResult testResult)
      Specified by:
      setTestResult in interface org.citrusframework.TestCase
    • getTestResult

      public org.citrusframework.TestResult getTestResult()
      Specified by:
      getTestResult in interface org.citrusframework.TestCase
    • getGroups

      public String[] getGroups()
      Specified by:
      getGroups in interface org.citrusframework.TestGroupAware
    • setGroups

      public void setGroups(String[] groups)
      Specified by:
      setGroups in interface org.citrusframework.TestGroupAware
    • setTimeout

      public void setTimeout(long timeout)
      Sets the timeout.
    • getTimeout

      public long getTimeout()
      Gets the timeout.