Class DefaultTestCase

  • All Implemented Interfaces:
    com.consol.citrus.common.Described, com.consol.citrus.common.Named, com.consol.citrus.Completable, com.consol.citrus.container.TestActionContainer, com.consol.citrus.TestAction, com.consol.citrus.TestActorAware, com.consol.citrus.TestCase, com.consol.citrus.TestGroupAware, com.consol.citrus.TestParameterAware

    public class DefaultTestCase
    extends AbstractActionContainer
    implements com.consol.citrus.TestCase, com.consol.citrus.TestGroupAware, com.consol.citrus.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.
    Author:
    Christoph Deppisch
    • Constructor Detail

      • DefaultTestCase

        public DefaultTestCase()
    • Method Detail

      • start

        public void start​(com.consol.citrus.context.TestContext context)
        Specified by:
        start in interface com.consol.citrus.TestCase
      • doExecute

        public void doExecute​(com.consol.citrus.context.TestContext context)
        Description copied from class: AbstractTestAction
        Subclasses may add custom execution logic here.
        Specified by:
        doExecute in class AbstractTestAction
      • beforeTest

        public void beforeTest​(com.consol.citrus.context.TestContext context)
        Specified by:
        beforeTest in interface com.consol.citrus.TestCase
      • afterTest

        public void afterTest​(com.consol.citrus.context.TestContext context)
        Specified by:
        afterTest in interface com.consol.citrus.TestCase
      • executeAction

        public void executeAction​(com.consol.citrus.TestAction action,
                                  com.consol.citrus.context.TestContext context)
        Specified by:
        executeAction in interface com.consol.citrus.TestCase
      • finish

        public void finish​(com.consol.citrus.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 com.consol.citrus.TestCase
      • setVariableDefinitions

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

        public Map<String,​Object> getVariableDefinitions()
        Specified by:
        getVariableDefinitions in interface com.consol.citrus.TestCase
      • setFinalActions

        public void setFinalActions​(List<com.consol.citrus.TestAction> finalActions)
        Setter for finally chain.
        Parameters:
        finalActions -
      • addFinalAction

        public void addFinalAction​(com.consol.citrus.TestActionBuilder<?> testAction)
        Specified by:
        addFinalAction in interface com.consol.citrus.TestCase
      • getMetaInfo

        public com.consol.citrus.TestCaseMetaInfo getMetaInfo()
        Specified by:
        getMetaInfo in interface com.consol.citrus.TestCase
      • setMetaInfo

        public void setMetaInfo​(com.consol.citrus.TestCaseMetaInfo metaInfo)
        Set the test case meta information.
        Parameters:
        metaInfo - the metaInfo to set
      • getFinalActions

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

        public void setPackageName​(String packageName)
        Specified by:
        setPackageName in interface com.consol.citrus.TestCase
      • getPackageName

        public String getPackageName()
        Specified by:
        getPackageName in interface com.consol.citrus.TestCase
      • setTestClass

        public void setTestClass​(Class<?> type)
        Specified by:
        setTestClass in interface com.consol.citrus.TestCase
      • getTestClass

        public Class<?> getTestClass()
        Specified by:
        getTestClass in interface com.consol.citrus.TestCase
      • setParameters

        public void setParameters​(String[] parameterNames,
                                  Object[] parameterValues)
        Specified by:
        setParameters in interface com.consol.citrus.TestParameterAware
      • getParameters

        public Map<String,​Object> getParameters()
        Specified by:
        getParameters in interface com.consol.citrus.TestParameterAware
      • setIncremental

        public void setIncremental​(boolean incremental)
        Specified by:
        setIncremental in interface com.consol.citrus.TestCase
      • isIncremental

        public boolean isIncremental()
        Specified by:
        isIncremental in interface com.consol.citrus.TestCase
      • setTestResult

        public void setTestResult​(com.consol.citrus.TestResult testResult)
        Specified by:
        setTestResult in interface com.consol.citrus.TestCase
      • getTestResult

        public com.consol.citrus.TestResult getTestResult()
        Specified by:
        getTestResult in interface com.consol.citrus.TestCase
      • getGroups

        public String[] getGroups()
        Specified by:
        getGroups in interface com.consol.citrus.TestGroupAware
      • setGroups

        public void setGroups​(String[] groups)
        Specified by:
        setGroups in interface com.consol.citrus.TestGroupAware
      • setTimeout

        public void setTimeout​(long timeout)
        Sets the timeout.
        Parameters:
        timeout -
      • getTimeout

        public long getTimeout()
        Gets the timeout.
        Returns: