Package com.consol.citrus
Class CitrusContext
- java.lang.Object
-
- com.consol.citrus.CitrusContext
-
- All Implemented Interfaces:
com.consol.citrus.report.MessageListenerAware
,com.consol.citrus.report.TestActionListenerAware
,com.consol.citrus.report.TestListenerAware
,com.consol.citrus.report.TestReporterAware
,com.consol.citrus.report.TestSuiteListenerAware
,com.consol.citrus.spi.ReferenceRegistry
public class CitrusContext extends Object implements com.consol.citrus.report.TestListenerAware, com.consol.citrus.report.TestActionListenerAware, com.consol.citrus.report.TestSuiteListenerAware, com.consol.citrus.report.TestReporterAware, com.consol.citrus.report.MessageListenerAware, com.consol.citrus.spi.ReferenceRegistry
Default Citrus context implementation holds basic components used in Citrus.- Author:
- Christoph Deppisch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CitrusContext.Builder
Citrus context builder.
-
Constructor Summary
Constructors Modifier Constructor Description protected
CitrusContext(CitrusContext.Builder builder)
Protected constructor using given builder to construct this instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMessageListener(com.consol.citrus.report.MessageListener listener)
void
addTestActionListener(com.consol.citrus.report.TestActionListener testActionListener)
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
bind(String name, Object value)
void
close()
Closes the context and all its components.static CitrusContext
create()
Initializing method loads Spring application context and reads bean definitions such as test listeners and test context factory.com.consol.citrus.context.TestContext
createTestContext()
Creates a new test context.List<com.consol.citrus.container.AfterSuite>
getAfterSuite()
Gets list of after suite actions in this context.List<com.consol.citrus.container.BeforeSuite>
getBeforeSuite()
Gets list of before suite actions in this context.com.consol.citrus.endpoint.EndpointFactory
getEndpointFactory()
Obtains the endpointFactory.com.consol.citrus.functions.FunctionRegistry
getFunctionRegistry()
Obtains the functionRegistry.com.consol.citrus.variable.GlobalVariables
getGlobalVariables()
Obtains the globalVariables.com.consol.citrus.report.MessageListeners
getMessageListeners()
Obtains the messageListeners.com.consol.citrus.message.MessageProcessors
getMessageProcessors()
Obtains the messageProcessors.com.consol.citrus.validation.MessageValidatorRegistry
getMessageValidatorRegistry()
Obtains the messageValidatorRegistry.com.consol.citrus.xml.namespace.NamespaceContextBuilder
getNamespaceContextBuilder()
Obtains the namespaceContextBuilder.com.consol.citrus.spi.ReferenceResolver
getReferenceResolver()
Obtains the referenceResolver.com.consol.citrus.report.TestActionListeners
getTestActionListeners()
Gets the test action listeners in this context.com.consol.citrus.context.TestContextFactory
getTestContextFactory()
Obtains the testContextFactory.com.consol.citrus.report.TestListeners
getTestListeners()
Gets test listeners in this context.com.consol.citrus.report.TestSuiteListeners
getTestSuiteListeners()
Gets test suite listeners in this context.com.consol.citrus.util.TypeConverter
getTypeConverter()
Obtains the typeConverter.com.consol.citrus.validation.matcher.ValidationMatcherRegistry
getValidationMatcherRegistry()
Obtains the validationMatcherRegistry.
-
-
-
Constructor Detail
-
CitrusContext
protected CitrusContext(CitrusContext.Builder builder)
Protected constructor using given builder to construct this instance.- Parameters:
builder
- the instance builder.
-
-
Method Detail
-
create
public static CitrusContext create()
Initializing method loads Spring application context and reads bean definitions such as test listeners and test context factory.- Returns:
-
createTestContext
public com.consol.citrus.context.TestContext createTestContext()
Creates a new test context.- Returns:
- the new citrus test context.
-
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
-
addTestActionListener
public void addTestActionListener(com.consol.citrus.report.TestActionListener testActionListener)
- Specified by:
addTestActionListener
in interfacecom.consol.citrus.report.TestActionListenerAware
-
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
-
close
public void close()
Closes the context and all its components.
-
getAfterSuite
public List<com.consol.citrus.container.AfterSuite> getAfterSuite()
Gets list of after suite actions in this context.- Returns:
-
getBeforeSuite
public List<com.consol.citrus.container.BeforeSuite> getBeforeSuite()
Gets list of before suite actions in this context.- Returns:
-
getTestListeners
public com.consol.citrus.report.TestListeners getTestListeners()
Gets test listeners in this context.- Returns:
-
getTestActionListeners
public com.consol.citrus.report.TestActionListeners getTestActionListeners()
Gets the test action listeners in this context.- Returns:
-
getTestSuiteListeners
public com.consol.citrus.report.TestSuiteListeners getTestSuiteListeners()
Gets test suite listeners in this context.- Returns:
-
getFunctionRegistry
public com.consol.citrus.functions.FunctionRegistry getFunctionRegistry()
Obtains the functionRegistry.- Returns:
-
getValidationMatcherRegistry
public com.consol.citrus.validation.matcher.ValidationMatcherRegistry getValidationMatcherRegistry()
Obtains the validationMatcherRegistry.- Returns:
-
getGlobalVariables
public com.consol.citrus.variable.GlobalVariables getGlobalVariables()
Obtains the globalVariables.- Returns:
-
getMessageValidatorRegistry
public com.consol.citrus.validation.MessageValidatorRegistry getMessageValidatorRegistry()
Obtains the messageValidatorRegistry.- Returns:
-
getMessageListeners
public com.consol.citrus.report.MessageListeners getMessageListeners()
Obtains the messageListeners.- Returns:
-
getEndpointFactory
public com.consol.citrus.endpoint.EndpointFactory getEndpointFactory()
Obtains the endpointFactory.- Returns:
-
getReferenceResolver
public com.consol.citrus.spi.ReferenceResolver getReferenceResolver()
Obtains the referenceResolver.- Returns:
-
getMessageProcessors
public com.consol.citrus.message.MessageProcessors getMessageProcessors()
Obtains the messageProcessors.- Returns:
-
getNamespaceContextBuilder
public com.consol.citrus.xml.namespace.NamespaceContextBuilder getNamespaceContextBuilder()
Obtains the namespaceContextBuilder.- Returns:
-
getTypeConverter
public com.consol.citrus.util.TypeConverter getTypeConverter()
Obtains the typeConverter.- Returns:
-
getTestContextFactory
public com.consol.citrus.context.TestContextFactory getTestContextFactory()
Obtains the testContextFactory.- Returns:
-
-