Package org.citrusframework
Class CitrusContext
java.lang.Object
org.citrusframework.CitrusContext
- All Implemented Interfaces:
org.citrusframework.report.MessageListenerAware,org.citrusframework.report.TestActionListenerAware,org.citrusframework.report.TestListenerAware,org.citrusframework.report.TestReporterAware,org.citrusframework.report.TestSuiteListenerAware,org.citrusframework.spi.ReferenceRegistry
public class CitrusContext
extends Object
implements org.citrusframework.report.TestListenerAware, org.citrusframework.report.TestActionListenerAware, org.citrusframework.report.TestSuiteListenerAware, org.citrusframework.report.TestReporterAware, org.citrusframework.report.MessageListenerAware, org.citrusframework.spi.ReferenceRegistry
Default Citrus context implementation holds basic components used in Citrus.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCitrusContext(CitrusContext.Builder builder) Protected constructor using given builder to construct this instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComponent(String name, Object component) voidaddMessageListener(org.citrusframework.report.MessageListener listener) voidaddTestActionListener(org.citrusframework.report.TestActionListener testActionListener) voidaddTestListener(org.citrusframework.report.TestListener testListener) voidaddTestReporter(org.citrusframework.report.TestReporter testReporter) voidaddTestSuiteListener(org.citrusframework.report.TestSuiteListener suiteListener) voidvoidclose()Closes the context and all its components.static CitrusContextcreate()Initializing method loads default configuration class and reads component definitions such as test listeners and test context factory.org.citrusframework.context.TestContextCreates a new test context.List<org.citrusframework.container.AfterSuite>Gets list of after suite actions in this context.List<org.citrusframework.container.BeforeSuite>Gets list of before suite actions in this context.org.citrusframework.endpoint.EndpointFactoryObtains the endpointFactory.org.citrusframework.functions.FunctionRegistryObtains the functionRegistry.org.citrusframework.variable.GlobalVariablesObtains the globalVariables.org.citrusframework.log.LogModifierGets the logModifier.org.citrusframework.report.MessageListenersObtains the messageListeners.org.citrusframework.message.MessageProcessorsObtains the messageProcessors.org.citrusframework.validation.MessageValidatorRegistryObtains the messageValidatorRegistry.org.citrusframework.xml.namespace.NamespaceContextBuilderObtains the namespaceContextBuilder.org.citrusframework.spi.ReferenceResolverObtains the referenceResolver.org.citrusframework.report.TestActionListenersGets the test action listeners in this context.Obtains the testContextFactory.org.citrusframework.report.TestListenersGets test listeners in this context.org.citrusframework.report.TestResultsorg.citrusframework.report.TestSuiteListenersGets test suite listeners in this context.org.citrusframework.util.TypeConverterObtains the typeConverter.org.citrusframework.validation.matcher.ValidationMatcherRegistryObtains the validationMatcherRegistry.voidhandleTestResults(org.citrusframework.report.TestResults testResults) voidparseConfiguration(Class<?> configClass) Parse given configuration class and bind annotated fields, methods to reference registry.voidparseConfiguration(Object configuration) Parse given configuration class and bind annotated fields, methods to reference registry.
-
Constructor Details
-
CitrusContext
Protected constructor using given builder to construct this instance.- Parameters:
builder- the instance builder.
-
-
Method Details
-
create
Initializing method loads default configuration class and reads component definitions such as test listeners and test context factory.- Returns:
-
parseConfiguration
Parse given configuration class and bind annotated fields, methods to reference registry.- Parameters:
configClass-
-
parseConfiguration
Parse given configuration class and bind annotated fields, methods to reference registry.- Parameters:
configuration-
-
createTestContext
public org.citrusframework.context.TestContext createTestContext()Creates a new test context.- Returns:
- the new citrus test context.
-
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 testActionListener) - 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
-
close
public void close()Closes the context and all its components. -
getAfterSuite
Gets list of after suite actions in this context.- Returns:
-
getBeforeSuite
Gets list of before suite actions in this context.- Returns:
-
getTestListeners
public org.citrusframework.report.TestListeners getTestListeners()Gets test listeners in this context.- Returns:
-
getTestActionListeners
public org.citrusframework.report.TestActionListeners getTestActionListeners()Gets the test action listeners in this context.- Returns:
-
getTestSuiteListeners
public org.citrusframework.report.TestSuiteListeners getTestSuiteListeners()Gets test suite listeners in this context.- Returns:
-
getFunctionRegistry
public org.citrusframework.functions.FunctionRegistry getFunctionRegistry()Obtains the functionRegistry.- Returns:
-
getValidationMatcherRegistry
public org.citrusframework.validation.matcher.ValidationMatcherRegistry getValidationMatcherRegistry()Obtains the validationMatcherRegistry.- Returns:
-
getGlobalVariables
public org.citrusframework.variable.GlobalVariables getGlobalVariables()Obtains the globalVariables.- Returns:
-
getMessageValidatorRegistry
public org.citrusframework.validation.MessageValidatorRegistry getMessageValidatorRegistry()Obtains the messageValidatorRegistry.- Returns:
-
getMessageListeners
public org.citrusframework.report.MessageListeners getMessageListeners()Obtains the messageListeners.- Returns:
-
getEndpointFactory
public org.citrusframework.endpoint.EndpointFactory getEndpointFactory()Obtains the endpointFactory.- Returns:
-
getReferenceResolver
public org.citrusframework.spi.ReferenceResolver getReferenceResolver()Obtains the referenceResolver.- Returns:
-
getMessageProcessors
public org.citrusframework.message.MessageProcessors getMessageProcessors()Obtains the messageProcessors.- Returns:
-
getNamespaceContextBuilder
public org.citrusframework.xml.namespace.NamespaceContextBuilder getNamespaceContextBuilder()Obtains the namespaceContextBuilder.- Returns:
-
getTypeConverter
public org.citrusframework.util.TypeConverter getTypeConverter()Obtains the typeConverter.- Returns:
-
getLogModifier
public org.citrusframework.log.LogModifier getLogModifier()Gets the logModifier.- Returns:
-
getTestContextFactory
Obtains the testContextFactory.- Returns:
-
bind
- Specified by:
bindin interfaceorg.citrusframework.spi.ReferenceRegistry
-
getTestResults
public org.citrusframework.report.TestResults getTestResults() -
handleTestResults
public void handleTestResults(org.citrusframework.report.TestResults testResults) -
addComponent
-