Package org.citrusframework
Class Citrus
java.lang.Object
org.citrusframework.Citrus
- All Implemented Interfaces:
MessageListenerAware,TestListenerAware,TestReporterAware,TestSuiteListenerAware
public final class Citrus
extends Object
implements TestListenerAware, TestSuiteListenerAware, TestReporterAware, MessageListenerAware
Citrus main class initializes a new Citrus runtime environment with a Citrus context. Provides before/after suite action execution
and test execution methods.
- Since:
- 2.1
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessageListener(MessageListener listener) voidaddTestListener(TestListener testListener) voidaddTestReporter(TestReporter testReporter) voidaddTestSuiteListener(TestSuiteListener suiteListener) voidafterSuite(String suiteName, String... testGroups) Performs after suite test actions.voidbeforeSuite(String suiteName, String... testGroups) Performs before suite test actions.voidclose()Closing Citrus and its context.Obtains the citrusContext.static StringGets the Citrus version from classpath resource properties.static CitrusInitializing method creating a Citrus instance with new default CitrusContext and its components such as test listeners and test context factory.static CitrusnewInstance(CitrusContextProvider contextProvider) Initializing method creating a Citrus instance with given Citrus context provider.voidrun(TestAction action) Runs a test action which can also be a whole test case.voidrun(TestAction action, TestContext testContext) Runs test action with given test context.
-
Method Details
-
newInstance
Initializing method creating a Citrus instance with new default CitrusContext and its components such as test listeners and test context factory.- Returns:
-
newInstance
Initializing method creating a Citrus instance with given Citrus context provider. Provider creates new CitrusContext and its components such as test listeners and test context factory.- Returns:
-
beforeSuite
Performs before suite test actions.- Parameters:
suiteName-testGroups-
-
afterSuite
Performs after suite test actions.- Parameters:
suiteName-testGroups-
-
run
Runs a test action which can also be a whole test case. -
run
Runs test action with given test context. Test action can also be a whole test case.- Parameters:
action-testContext-
-
getVersion
Gets the Citrus version from classpath resource properties.- Returns:
-
addTestSuiteListener
- Specified by:
addTestSuiteListenerin interfaceTestSuiteListenerAware
-
addTestListener
- Specified by:
addTestListenerin interfaceTestListenerAware
-
addTestReporter
- Specified by:
addTestReporterin interfaceTestReporterAware
-
addMessageListener
- Specified by:
addMessageListenerin interfaceMessageListenerAware
-
getCitrusContext
Obtains the citrusContext.- Returns:
-
close
public void close()Closing Citrus and its context.
-