Package org.citrusframework
Class DefaultTestCase
java.lang.Object
org.citrusframework.actions.AbstractTestAction
org.citrusframework.container.AbstractActionContainer
org.citrusframework.DefaultTestCase
- All Implemented Interfaces:
Described,Named,Completable,TestActionContainer,TestAction,TestActorAware,TestCase,TestGroupAware,TestParameterAware
public class DefaultTestCase
extends AbstractActionContainer
implements TestCase, TestGroupAware, 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(TestActionBuilder<?> testAction) voidafterTest(TestContext context) voidbeforeTest(TestContext context) voiddoExecute(TestContext context) Subclasses may add custom execution logic here.voidexecuteAction(TestAction action, TestContext context) Runs the give action and makes sure to properly set active and executed action state for this container.voidvoidfinish(TestContext context) Method that will be executed in any case of test case result (success, error).Get all actions in the finally chain.String[]Class<?>longGets the timeout.booleanvoidsetFinalActions(List<TestAction> finalActions) Setter for finally chain.voidvoidsetIncremental(boolean incremental) voidsetMetaInfo(TestCaseMetaInfo metaInfo) Set the test case meta information.voidsetPackageName(String packageName) voidsetParameters(String[] parameterNames, Object[] parameterValues) voidsetTestClass(Class<?> type) voidsetTestResult(TestResult testResult) voidsetTimeout(long timeout) Sets the timeout.voidsetVariableDefinitions(Map<String, Object> variableDefinitions) Setter for variables.voidstart(TestContext context) toString()Methods inherited from class org.citrusframework.container.AbstractActionContainer
addTestAction, addTestAction, addTestActions, addTestActions, getActionCount, getActionIndex, getActions, getActiveAction, getExecutedActions, 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.TestAction
execute, getActor, isDisabledMethods inherited from interface org.citrusframework.container.TestActionContainer
addTestAction, addTestActions, getActionCount, getActionIndex, getActions, getActiveAction, getExecutedActions, getTestAction, setActions, setActiveAction, setExecutedActionMethods inherited from interface org.citrusframework.TestCase
addFinalAction, getName
-
Constructor Details
-
DefaultTestCase
public DefaultTestCase()
-
-
Method Details
-
doExecute
Description copied from class:AbstractTestActionSubclasses may add custom execution logic here.- Specified by:
doExecutein classAbstractTestAction
-
start
-
beforeTest
- Specified by:
beforeTestin interfaceTestCase
-
afterTest
-
executeAction
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 interfaceTestCase- Overrides:
executeActionin classAbstractActionContainer
-
fail
-
finish
Method that will be executed in any case of test case result (success, error). Usually used for clean up tasks. -
setVariableDefinitions
Setter for variables.- Parameters:
variableDefinitions-
-
getVariableDefinitions
- Specified by:
getVariableDefinitionsin interfaceTestCase
-
setFinalActions
Setter for finally chain.- Parameters:
finalActions-
-
toString
-
addFinalAction
- Specified by:
addFinalActionin interfaceTestCase
-
getMetaInfo
- Specified by:
getMetaInfoin interfaceTestCase
-
setMetaInfo
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 interfaceTestCase
-
getPackageName
- Specified by:
getPackageNamein interfaceTestCase
-
setTestClass
- Specified by:
setTestClassin interfaceTestCase
-
getTestClass
- Specified by:
getTestClassin interfaceTestCase
-
setParameters
- Specified by:
setParametersin interfaceTestParameterAware
-
getActionBuilders
- Specified by:
getActionBuildersin interfaceTestCase
-
getParameters
- Specified by:
getParametersin interfaceTestParameterAware
-
setIncremental
public void setIncremental(boolean incremental) - Specified by:
setIncrementalin interfaceTestCase
-
isIncremental
public boolean isIncremental()- Specified by:
isIncrementalin interfaceTestCase
-
setTestResult
- Specified by:
setTestResultin interfaceTestCase
-
getTestResult
- Specified by:
getTestResultin interfaceTestCase
-
getGroups
- Specified by:
getGroupsin interfaceTestGroupAware
-
setGroups
- Specified by:
setGroupsin interfaceTestGroupAware
-
setTimeout
public void setTimeout(long timeout) Sets the timeout.- Parameters:
timeout-
-
getTimeout
public long getTimeout()Gets the timeout.- Returns:
-