Package com.consol.citrus
Class Citrus
- java.lang.Object
-
- com.consol.citrus.Citrus
-
- All Implemented Interfaces:
com.consol.citrus.report.MessageListenerAware
,com.consol.citrus.report.TestListenerAware
,com.consol.citrus.report.TestReporterAware
,com.consol.citrus.report.TestSuiteListenerAware
public final class Citrus extends Object implements com.consol.citrus.report.TestListenerAware, com.consol.citrus.report.TestSuiteListenerAware, com.consol.citrus.report.TestReporterAware, com.consol.citrus.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
- Author:
- Christoph Deppisch
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMessageListener(com.consol.citrus.report.MessageListener listener)
void
addTestListener(com.consol.citrus.report.TestListener testListener)
void
addTestReporter(com.consol.citrus.report.TestReporter testReporter)
void
addTestSuiteListener(com.consol.citrus.report.TestSuiteListener suiteListener)
void
afterSuite(String suiteName, String... testGroups)
Performs after suite test actions.void
beforeSuite(String suiteName, String... testGroups)
Performs before suite test actions.void
close()
Closing Citrus and its context.CitrusContext
getCitrusContext()
Obtains the citrusContext.static String
getVersion()
Gets the Citrus version from classpath resource properties.static Citrus
newInstance()
Initializing method with given Citrus context and its components such as test listeners and test context factory.static Citrus
newInstance(CitrusContext citrusContext)
Initializing method with given Citrus context and its components such as test listeners and test context factory.void
run(com.consol.citrus.TestAction action)
Runs a test action which can also be a whole test case.void
run(com.consol.citrus.TestAction action, com.consol.citrus.context.TestContext testContext)
Runs test action with given test context.
-
-
-
Method Detail
-
newInstance
public static Citrus newInstance()
Initializing method with given Citrus context and its components such as test listeners and test context factory.- Returns:
-
newInstance
public static Citrus newInstance(CitrusContext citrusContext)
Initializing method with given Citrus context and its components such as test listeners and test context factory.- Returns:
-
beforeSuite
public void beforeSuite(String suiteName, String... testGroups)
Performs before suite test actions.- Parameters:
suiteName
-testGroups
-
-
afterSuite
public void afterSuite(String suiteName, String... testGroups)
Performs after suite test actions.- Parameters:
suiteName
-testGroups
-
-
run
public void run(com.consol.citrus.TestAction action)
Runs a test action which can also be a whole test case.
-
run
public void run(com.consol.citrus.TestAction action, com.consol.citrus.context.TestContext testContext)
Runs test action with given test context. Test action can also be a whole test case.- Parameters:
action
-testContext
-
-
getVersion
public static String getVersion()
Gets the Citrus version from classpath resource properties.- Returns:
-
addTestSuiteListener
public void addTestSuiteListener(com.consol.citrus.report.TestSuiteListener suiteListener)
- Specified by:
addTestSuiteListener
in interfacecom.consol.citrus.report.TestSuiteListenerAware
-
addTestListener
public void addTestListener(com.consol.citrus.report.TestListener testListener)
- Specified by:
addTestListener
in interfacecom.consol.citrus.report.TestListenerAware
-
addTestReporter
public void addTestReporter(com.consol.citrus.report.TestReporter testReporter)
- Specified by:
addTestReporter
in interfacecom.consol.citrus.report.TestReporterAware
-
addMessageListener
public void addMessageListener(com.consol.citrus.report.MessageListener listener)
- Specified by:
addMessageListener
in interfacecom.consol.citrus.report.MessageListenerAware
-
getCitrusContext
public CitrusContext getCitrusContext()
Obtains the citrusContext.- Returns:
-
close
public void close()
Closing Citrus and its context.
-
-