Package org.citrusframework
Class Citrus
java.lang.Object
org.citrusframework.Citrus
- All Implemented Interfaces:
org.citrusframework.report.MessageListenerAware,org.citrusframework.report.TestActionListenerAware,org.citrusframework.report.TestListenerAware,org.citrusframework.report.TestReporterAware,org.citrusframework.report.TestSuiteListenerAware
public final class Citrus
extends Object
implements org.citrusframework.report.TestListenerAware, org.citrusframework.report.TestActionListenerAware, org.citrusframework.report.TestSuiteListenerAware, org.citrusframework.report.TestReporterAware, org.citrusframework.report.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(org.citrusframework.report.MessageListener listener) voidaddTestActionListener(org.citrusframework.report.TestActionListener testListener) voidaddTestListener(org.citrusframework.report.TestListener testListener) voidaddTestReporter(org.citrusframework.report.TestReporter testReporter) voidaddTestSuiteListener(org.citrusframework.report.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(org.citrusframework.TestAction action) Runs a test action which can also be a whole test case.voidrun(org.citrusframework.TestAction action, org.citrusframework.context.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
public void run(org.citrusframework.TestAction action) Runs a test action which can also be a whole test case. -
run
public void run(org.citrusframework.TestAction action, org.citrusframework.context.TestContext testContext) 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. -
addTestSuiteListener
public void addTestSuiteListener(org.citrusframework.report.TestSuiteListener suiteListener) - Specified by:
addTestSuiteListenerin interfaceorg.citrusframework.report.TestSuiteListenerAware
-
addTestListener
public void addTestListener(org.citrusframework.report.TestListener testListener) - Specified by:
addTestListenerin interfaceorg.citrusframework.report.TestListenerAware
-
addTestActionListener
public void addTestActionListener(org.citrusframework.report.TestActionListener testListener) - Specified by:
addTestActionListenerin interfaceorg.citrusframework.report.TestActionListenerAware
-
addTestReporter
public void addTestReporter(org.citrusframework.report.TestReporter testReporter) - Specified by:
addTestReporterin interfaceorg.citrusframework.report.TestReporterAware
-
addMessageListener
public void addMessageListener(org.citrusframework.report.MessageListener listener) - Specified by:
addMessageListenerin interfaceorg.citrusframework.report.MessageListenerAware
-
getCitrusContext
Obtains the citrusContext. -
close
public void close()Closing Citrus and its context.
-