Package com.consol.citrus
Class DefaultTestCase
- java.lang.Object
-
- com.consol.citrus.actions.AbstractTestAction
-
- com.consol.citrus.container.AbstractActionContainer
-
- com.consol.citrus.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
-
-
Field Summary
-
Fields inherited from class com.consol.citrus.container.AbstractActionContainer
actions, log
-
Fields inherited from class com.consol.citrus.actions.AbstractTestAction
description
-
-
Constructor Summary
Constructors Constructor Description DefaultTestCase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFinalAction(com.consol.citrus.TestActionBuilder<?> testAction)
void
afterTest(com.consol.citrus.context.TestContext context)
void
beforeTest(com.consol.citrus.context.TestContext context)
void
doExecute(com.consol.citrus.context.TestContext context)
Subclasses may add custom execution logic here.void
executeAction(com.consol.citrus.TestAction action, com.consol.citrus.context.TestContext context)
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.List<com.consol.citrus.TestAction>
getFinalActions()
Get all actions in the finally chain.String[]
getGroups()
com.consol.citrus.TestCaseMetaInfo
getMetaInfo()
String
getPackageName()
Map<String,Object>
getParameters()
Class<?>
getTestClass()
com.consol.citrus.TestResult
getTestResult()
long
getTimeout()
Gets the timeout.Map<String,Object>
getVariableDefinitions()
boolean
isIncremental()
void
setFinalActions(List<com.consol.citrus.TestAction> finalActions)
Setter for finally chain.void
setGroups(String[] groups)
void
setIncremental(boolean incremental)
void
setMetaInfo(com.consol.citrus.TestCaseMetaInfo metaInfo)
Set the test case meta information.void
setPackageName(String packageName)
void
setParameters(String[] parameterNames, Object[] parameterValues)
void
setTestClass(Class<?> type)
void
setTestResult(com.consol.citrus.TestResult testResult)
void
setTimeout(long timeout)
Sets the timeout.void
setVariableDefinitions(Map<String,Object> variableDefinitions)
Setter for variables.void
start(com.consol.citrus.context.TestContext context)
String
toString()
-
Methods inherited from class com.consol.citrus.container.AbstractActionContainer
addTestAction, addTestAction, addTestActions, addTestActions, getActionCount, getActionIndex, getActions, getActiveAction, getExecutedActions, getTestAction, isDone, setActions, setActiveAction
-
Methods inherited from class com.consol.citrus.actions.AbstractTestAction
execute, getActor, getDescription, getName, isDisabled, setActor, setDescription, setName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
start
public void start(com.consol.citrus.context.TestContext context)
- Specified by:
start
in interfacecom.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 classAbstractTestAction
-
beforeTest
public void beforeTest(com.consol.citrus.context.TestContext context)
- Specified by:
beforeTest
in interfacecom.consol.citrus.TestCase
-
afterTest
public void afterTest(com.consol.citrus.context.TestContext context)
- Specified by:
afterTest
in interfacecom.consol.citrus.TestCase
-
executeAction
public void executeAction(com.consol.citrus.TestAction action, com.consol.citrus.context.TestContext context)
- Specified by:
executeAction
in interfacecom.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 interfacecom.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 interfacecom.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 interfacecom.consol.citrus.TestCase
-
getMetaInfo
public com.consol.citrus.TestCaseMetaInfo getMetaInfo()
- Specified by:
getMetaInfo
in interfacecom.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 interfacecom.consol.citrus.TestCase
-
getPackageName
public String getPackageName()
- Specified by:
getPackageName
in interfacecom.consol.citrus.TestCase
-
setTestClass
public void setTestClass(Class<?> type)
- Specified by:
setTestClass
in interfacecom.consol.citrus.TestCase
-
getTestClass
public Class<?> getTestClass()
- Specified by:
getTestClass
in interfacecom.consol.citrus.TestCase
-
setParameters
public void setParameters(String[] parameterNames, Object[] parameterValues)
- Specified by:
setParameters
in interfacecom.consol.citrus.TestParameterAware
-
getParameters
public Map<String,Object> getParameters()
- Specified by:
getParameters
in interfacecom.consol.citrus.TestParameterAware
-
setIncremental
public void setIncremental(boolean incremental)
- Specified by:
setIncremental
in interfacecom.consol.citrus.TestCase
-
isIncremental
public boolean isIncremental()
- Specified by:
isIncremental
in interfacecom.consol.citrus.TestCase
-
setTestResult
public void setTestResult(com.consol.citrus.TestResult testResult)
- Specified by:
setTestResult
in interfacecom.consol.citrus.TestCase
-
getTestResult
public com.consol.citrus.TestResult getTestResult()
- Specified by:
getTestResult
in interfacecom.consol.citrus.TestCase
-
getGroups
public String[] getGroups()
- Specified by:
getGroups
in interfacecom.consol.citrus.TestGroupAware
-
setGroups
public void setGroups(String[] groups)
- Specified by:
setGroups
in interfacecom.consol.citrus.TestGroupAware
-
setTimeout
public void setTimeout(long timeout)
Sets the timeout.- Parameters:
timeout
-
-
getTimeout
public long getTimeout()
Gets the timeout.- Returns:
-
-