Package com.consol.citrus
Interface TestCase
-
- All Superinterfaces:
Described,Named,TestAction,TestActionContainer
public interface TestCase extends TestActionContainer, Named, Described
Test case executing a list ofTestActionin sequence.- Since:
- 2006
- Author:
- Christoph Deppisch
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidaddFinalAction(TestAction action)Adds action to finally action chain.voidaddFinalAction(TestActionBuilder<?> builder)Adds action to finally action chain.default voidafterTest(TestContext context)Sequence of test actions after test case.default voidbeforeTest(TestContext context)Sequence of test actions before the test case.voidexecuteAction(TestAction action, TestContext context)Executes a single test action with given test context.voidfinish(TestContext context)Method that will be executed in any case of test case result (success, error) Usually used for clean up tasks.List<TestActionBuilder<?>>getActionBuilders()Provides access to the raw test action builders used to construct the list of actions in this test case.TestCaseMetaInfogetMetaInfo()Get the test case meta information.StringgetName()Name of test action injected as Spring bean nameStringgetPackageName()Get the package nameClass<?>getTestClass()Gets the value of the testClass property.TestResultgetTestResult()Retrieve test result.Map<String,Object>getVariableDefinitions()Gets the variables for this test case.default booleanisIncremental()Marks that this test case runs its actions one by one growing over time.voidsetIncremental(boolean incremental)Sets the test runner flag.voidsetPackageName(String packageName)Set the package namevoidsetTestClass(Class<?> type)Set the test class type.voidsetTestResult(TestResult testResult)Sets the test result from outside.voidstart(TestContext context)Starts the test case.-
Methods inherited from interface com.consol.citrus.common.Described
getDescription, setDescription
-
Methods inherited from interface com.consol.citrus.TestAction
execute, getActor, isDisabled
-
Methods inherited from interface com.consol.citrus.container.TestActionContainer
addTestAction, addTestActions, getActionCount, getActionIndex, getActions, getActiveAction, getExecutedActions, getTestAction, setActions, setActiveAction, setExecutedAction
-
-
-
-
Method Detail
-
start
void start(TestContext context)
Starts the test case.
-
beforeTest
default void beforeTest(TestContext context)
Sequence of test actions before the test case.
-
afterTest
default void afterTest(TestContext context)
Sequence of test actions after test case. This operation does not raise andy errors - exceptions will only be logged as warning. This is because we do not want to overwrite errors that may have occurred before in test execution.
-
executeAction
void executeAction(TestAction action, TestContext context)
Executes a single test action with given test context.- Parameters:
action-context-
-
finish
void finish(TestContext context)
Method that will be executed in any case of test case result (success, error) Usually used for clean up tasks.
-
getMetaInfo
TestCaseMetaInfo getMetaInfo()
Get the test case meta information.- Returns:
- the metaInfo
-
getTestClass
Class<?> getTestClass()
Gets the value of the testClass property.- Returns:
- the testClass
-
setTestClass
void setTestClass(Class<?> type)
Set the test class type.- Parameters:
type-
-
getPackageName
String getPackageName()
Get the package name- Returns:
- the packageName
-
setPackageName
void setPackageName(String packageName)
Set the package name- Parameters:
packageName- the packageName to set
-
getName
String getName()
Description copied from interface:TestActionName of test action injected as Spring bean name- Specified by:
getNamein interfaceTestAction- Returns:
- name as String
-
setTestResult
void setTestResult(TestResult testResult)
Sets the test result from outside.- Parameters:
testResult-
-
getTestResult
TestResult getTestResult()
Retrieve test result.- Returns:
-
isIncremental
default boolean isIncremental()
Marks that this test case runs its actions one by one growing over time. This is usually the case when using the Java DSL that adds test actions as the Java method is processed. XML test cases ususally build and load all actions beforehand and run all actions in one step.- Returns:
-
setIncremental
void setIncremental(boolean incremental)
Sets the test runner flag.- Parameters:
incremental-
-
getVariableDefinitions
Map<String,Object> getVariableDefinitions()
Gets the variables for this test case.- Returns:
-
addFinalAction
default void addFinalAction(TestAction action)
Adds action to finally action chain.- Parameters:
action-
-
addFinalAction
void addFinalAction(TestActionBuilder<?> builder)
Adds action to finally action chain.- Parameters:
builder-
-
getActionBuilders
List<TestActionBuilder<?>> getActionBuilders()
Provides access to the raw test action builders used to construct the list of actions in this test case.- Returns:
-
-