Package org.citrusframework
Class DefaultTestCase
java.lang.Object
org.citrusframework.actions.AbstractTestAction
org.citrusframework.container.AbstractActionContainer
org.citrusframework.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.
-
Field Summary
Fields inherited from class org.citrusframework.container.AbstractActionContainer
actionsFields inherited from class org.citrusframework.actions.AbstractTestAction
description -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFinalAction(org.citrusframework.TestActionBuilder<?> testAction) voidafterTest(org.citrusframework.context.TestContext context) voidbeforeTest(org.citrusframework.context.TestContext context) voiddoExecute(org.citrusframework.context.TestContext context) Subclasses may add custom execution logic here.voidexecuteAction(org.citrusframework.TestAction action, org.citrusframework.context.TestContext context) Runs the give action and makes sure to properly set active and executed action state for this container.voidvoidfinish(org.citrusframework.context.TestContext context) Method that will be executed in any case of test case result (success, error).List<org.citrusframework.TestActionBuilder<?>>List<org.citrusframework.endpoint.EndpointBuilder<?>>List<org.citrusframework.TestAction>Get all actions in the finally chain.String[]org.citrusframework.TestCaseMetaInfoClass<?>org.citrusframework.TestResultlongGets the timeout.booleanvoidsetFinalActions(List<org.citrusframework.TestAction> finalActions) Setter for finally chain.voidvoidsetIncremental(boolean incremental) voidsetMetaInfo(org.citrusframework.TestCaseMetaInfo metaInfo) Set the test case meta information.voidsetPackageName(String packageName) voidsetParameters(String[] parameterNames, Object[] parameterValues) voidsetTestClass(Class<?> type) voidsetTestResult(org.citrusframework.TestResult testResult) voidsetTimeout(long timeout) Sets the timeout.voidsetVariableDefinitions(Map<String, Object> variableDefinitions) Setter for variables.voidstart(org.citrusframework.context.TestContext context) toString()Methods inherited from class org.citrusframework.container.AbstractActionContainer
addTestAction, addTestAction, addTestActions, addTestActions, getActionCount, getActionIndex, getActions, getActiveAction, getExecutedActions, getNumberOfExecutedActions, getTestAction, isDone, setActions, setActiveAction, setExecutedActionMethods inherited from class org.citrusframework.actions.AbstractTestAction
execute, getActor, getDescription, getName, isDisabled, setActor, setDescription, setNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.citrusframework.common.Described
getDescription, setDescriptionMethods inherited from interface org.citrusframework.common.Named
setNameMethods inherited from interface org.citrusframework.TestAction
execute, getActor, isDisabledMethods inherited from interface org.citrusframework.container.TestActionContainer
addTestAction, addTestActions, getActionCount, getActionIndex, getActions, getActiveAction, getExecutedActions, getNumberOfExecutedActions, getTestAction, setActions, setActiveAction, setExecutedActionMethods inherited from interface org.citrusframework.TestCase
addFinalAction, getName
-
Constructor Details
-
DefaultTestCase
public DefaultTestCase()
-
-
Method Details
-
doExecute
public void doExecute(org.citrusframework.context.TestContext context) Description copied from class:AbstractTestActionSubclasses may add custom execution logic here.- Specified by:
doExecutein classAbstractTestAction
-
start
public void start(org.citrusframework.context.TestContext context) - Specified by:
startin interfaceorg.citrusframework.TestCase
-
beforeTest
public void beforeTest(org.citrusframework.context.TestContext context) - Specified by:
beforeTestin interfaceorg.citrusframework.TestCase
-
afterTest
public void afterTest(org.citrusframework.context.TestContext context) - Specified by:
afterTestin interfaceorg.citrusframework.TestCase
-
executeAction
public void executeAction(org.citrusframework.TestAction action, org.citrusframework.context.TestContext context) Description copied from class:AbstractActionContainerRuns the give action and makes sure to properly set active and executed action state for this container.- Specified by:
executeActionin interfaceorg.citrusframework.TestCase- Overrides:
executeActionin classAbstractActionContainer
-
fail
- Specified by:
failin interfaceorg.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:
finishin interfaceorg.citrusframework.TestCase
-
setVariableDefinitions
Setter for variables. -
getVariableDefinitions
- Specified by:
getVariableDefinitionsin interfaceorg.citrusframework.TestCase
-
getEndpointDefinitions
- Specified by:
getEndpointDefinitionsin interfaceorg.citrusframework.TestCase
-
getEndpoints
- Specified by:
getEndpointsin interfaceorg.citrusframework.TestCase
-
setFinalActions
Setter for finally chain. -
toString
-
addFinalAction
public void addFinalAction(org.citrusframework.TestActionBuilder<?> testAction) - Specified by:
addFinalActionin interfaceorg.citrusframework.TestCase
-
getMetaInfo
public org.citrusframework.TestCaseMetaInfo getMetaInfo()- Specified by:
getMetaInfoin interfaceorg.citrusframework.TestCase
-
setMetaInfo
public void setMetaInfo(org.citrusframework.TestCaseMetaInfo metaInfo) Set the test case meta information.- Parameters:
metaInfo- the metaInfo to set
-
getFinalActions
Get all actions in the finally chain.- Returns:
- the finalActions
-
setPackageName
- Specified by:
setPackageNamein interfaceorg.citrusframework.TestCase
-
getPackageName
- Specified by:
getPackageNamein interfaceorg.citrusframework.TestCase
-
setTestClass
- Specified by:
setTestClassin interfaceorg.citrusframework.TestCase
-
getTestClass
- Specified by:
getTestClassin interfaceorg.citrusframework.TestCase
-
setParameters
- Specified by:
setParametersin interfaceorg.citrusframework.TestParameterAware
-
getActionBuilders
- Specified by:
getActionBuildersin interfaceorg.citrusframework.TestCase
-
getParameters
- Specified by:
getParametersin interfaceorg.citrusframework.TestParameterAware
-
setIncremental
public void setIncremental(boolean incremental) - Specified by:
setIncrementalin interfaceorg.citrusframework.TestCase
-
isIncremental
public boolean isIncremental()- Specified by:
isIncrementalin interfaceorg.citrusframework.TestCase
-
setTestResult
public void setTestResult(org.citrusframework.TestResult testResult) - Specified by:
setTestResultin interfaceorg.citrusframework.TestCase
-
getTestResult
public org.citrusframework.TestResult getTestResult()- Specified by:
getTestResultin interfaceorg.citrusframework.TestCase
-
getGroups
- Specified by:
getGroupsin interfaceorg.citrusframework.TestGroupAware
-
setGroups
- Specified by:
setGroupsin interfaceorg.citrusframework.TestGroupAware
-
setTimeout
public void setTimeout(long timeout) Sets the timeout. -
getTimeout
public long getTimeout()Gets the timeout.
-