Package org.citrusframework.context
Class TestContextFactory
java.lang.Object
org.citrusframework.context.TestContextFactory
- All Implemented Interfaces:
org.citrusframework.spi.ReferenceResolverAware
- Direct Known Subclasses:
StaticTestContextFactory
public class TestContextFactory
extends Object
implements org.citrusframework.spi.ReferenceResolverAware
Factory bean implementation constructs test context instances. Takes care of adding proper default components
to the test context such as
FunctionRegistry or GlobalVariables.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.citrusframework.context.TestContextcopyOf(org.citrusframework.context.TestContext context) List<org.citrusframework.container.AfterTest>Obtains the afterTest.List<org.citrusframework.container.BeforeTest>Obtains the beforeTest.org.citrusframework.endpoint.EndpointFactoryGets the endpoint factory.org.citrusframework.functions.FunctionRegistryorg.citrusframework.variable.GlobalVariablesorg.citrusframework.log.LogModifierGets the logModifier.org.citrusframework.report.MessageListenersGets the message listeners.org.citrusframework.message.MessageProcessorsGets the message processors.org.citrusframework.validation.MessageValidatorRegistryGets the message validator registry.org.citrusframework.xml.namespace.NamespaceContextBuilderGets the namespace context builder.org.citrusframework.context.TestContextFactory method creates new test context instance and adds all default components in this factory.org.citrusframework.spi.ReferenceResolverGets the value of the referenceResolver property.org.citrusframework.variable.SegmentVariableExtractorRegistryGets the segmentVariableExtractorRegistryorg.citrusframework.report.TestActionListenersObtains the testActionListeners.org.citrusframework.report.TestListenersGets the test listeners.org.citrusframework.util.TypeConverterObtains the typeConverter.org.citrusframework.validation.matcher.ValidationMatcherRegistrystatic TestContextFactoryCreate new empty instance with default components set.voidsetAfterTest(List<org.citrusframework.container.AfterTest> afterTest) Specifies the afterTest.voidsetBeforeTest(List<org.citrusframework.container.BeforeTest> beforeTest) Specifies the beforeTest.voidsetEndpointFactory(org.citrusframework.endpoint.EndpointFactory endpointFactory) Sets the endpoint factory.voidsetFunctionRegistry(org.citrusframework.functions.FunctionRegistry functionRegistry) voidsetGlobalVariables(org.citrusframework.variable.GlobalVariables globalVariables) voidsetLogModifier(org.citrusframework.log.LogModifier logModifier) Sets the logModifier.voidsetMessageListeners(org.citrusframework.report.MessageListeners messageListeners) Sets the message listeners.voidsetMessageProcessors(org.citrusframework.message.MessageProcessors messageProcessors) Sets the message processors.voidsetMessageValidatorRegistry(org.citrusframework.validation.MessageValidatorRegistry messageValidatorRegistry) Sets the message validator registry.voidsetNamespaceContextBuilder(org.citrusframework.xml.namespace.NamespaceContextBuilder namespaceContextBuilder) Sets the namespace context builder.voidsetReferenceResolver(org.citrusframework.spi.ReferenceResolver referenceResolver) voidsetSegmentVariableExtractorRegistry(org.citrusframework.variable.SegmentVariableExtractorRegistry segmentVariableExtractorRegistry) Sets the segmentVariableExtractorRegistryvoidsetTestActionListeners(org.citrusframework.report.TestActionListeners testActionListeners) Specifies the testActionListeners.voidsetTestListeners(org.citrusframework.report.TestListeners testListeners) Sets the test listeners.voidsetTypeConverter(org.citrusframework.util.TypeConverter typeConverter) Specifies the typeConverter.voidsetValidationMatcherRegistry(org.citrusframework.validation.matcher.ValidationMatcherRegistry validationMatcherRegistry)
-
Constructor Details
-
TestContextFactory
public TestContextFactory()
-
-
Method Details
-
newInstance
Create new empty instance with default components set.- Returns:
-
copyOf
public static org.citrusframework.context.TestContext copyOf(org.citrusframework.context.TestContext context) -
getObject
public org.citrusframework.context.TestContext getObject()Factory method creates new test context instance and adds all default components in this factory.- Returns:
-
setFunctionRegistry
public void setFunctionRegistry(org.citrusframework.functions.FunctionRegistry functionRegistry) - Parameters:
functionRegistry- the functionRegistry to set
-
getFunctionRegistry
public org.citrusframework.functions.FunctionRegistry getFunctionRegistry()- Returns:
- the functionRegistry
-
setValidationMatcherRegistry
public void setValidationMatcherRegistry(org.citrusframework.validation.matcher.ValidationMatcherRegistry validationMatcherRegistry) - Parameters:
validationMatcherRegistry- the validationMatcherRegistry to set
-
getValidationMatcherRegistry
public org.citrusframework.validation.matcher.ValidationMatcherRegistry getValidationMatcherRegistry()- Returns:
- the validationMatcherRegistry
-
setGlobalVariables
public void setGlobalVariables(org.citrusframework.variable.GlobalVariables globalVariables) - Parameters:
globalVariables- the globalVariables to set
-
getGlobalVariables
public org.citrusframework.variable.GlobalVariables getGlobalVariables()- Returns:
- the globalVariables
-
getEndpointFactory
public org.citrusframework.endpoint.EndpointFactory getEndpointFactory()Gets the endpoint factory.- Returns:
-
setEndpointFactory
public void setEndpointFactory(org.citrusframework.endpoint.EndpointFactory endpointFactory) Sets the endpoint factory.- Parameters:
endpointFactory-
-
getReferenceResolver
public org.citrusframework.spi.ReferenceResolver getReferenceResolver()Gets the value of the referenceResolver property.- Returns:
- the referenceResolver
-
setReferenceResolver
public void setReferenceResolver(org.citrusframework.spi.ReferenceResolver referenceResolver) - Specified by:
setReferenceResolverin interfaceorg.citrusframework.spi.ReferenceResolverAware
-
setNamespaceContextBuilder
public void setNamespaceContextBuilder(org.citrusframework.xml.namespace.NamespaceContextBuilder namespaceContextBuilder) Sets the namespace context builder.- Parameters:
namespaceContextBuilder-
-
getNamespaceContextBuilder
public org.citrusframework.xml.namespace.NamespaceContextBuilder getNamespaceContextBuilder()Gets the namespace context builder.- Returns:
-
setTestListeners
public void setTestListeners(org.citrusframework.report.TestListeners testListeners) Sets the test listeners.- Parameters:
testListeners-
-
getTestListeners
public org.citrusframework.report.TestListeners getTestListeners()Gets the test listeners.- Returns:
-
getTestActionListeners
public org.citrusframework.report.TestActionListeners getTestActionListeners()Obtains the testActionListeners.- Returns:
-
setTestActionListeners
public void setTestActionListeners(org.citrusframework.report.TestActionListeners testActionListeners) Specifies the testActionListeners.- Parameters:
testActionListeners-
-
getBeforeTest
Obtains the beforeTest.- Returns:
-
setBeforeTest
Specifies the beforeTest.- Parameters:
beforeTest-
-
getAfterTest
Obtains the afterTest.- Returns:
-
setAfterTest
Specifies the afterTest.- Parameters:
afterTest-
-
setMessageValidatorRegistry
public void setMessageValidatorRegistry(org.citrusframework.validation.MessageValidatorRegistry messageValidatorRegistry) Sets the message validator registry.- Parameters:
messageValidatorRegistry-
-
getMessageValidatorRegistry
public org.citrusframework.validation.MessageValidatorRegistry getMessageValidatorRegistry()Gets the message validator registry.- Returns:
-
setMessageListeners
public void setMessageListeners(org.citrusframework.report.MessageListeners messageListeners) Sets the message listeners.- Parameters:
messageListeners-
-
getMessageListeners
public org.citrusframework.report.MessageListeners getMessageListeners()Gets the message listeners.- Returns:
-
setMessageProcessors
public void setMessageProcessors(org.citrusframework.message.MessageProcessors messageProcessors) Sets the message processors.- Parameters:
messageProcessors-
-
getMessageProcessors
public org.citrusframework.message.MessageProcessors getMessageProcessors()Gets the message processors.- Returns:
-
getTypeConverter
public org.citrusframework.util.TypeConverter getTypeConverter()Obtains the typeConverter.- Returns:
-
setTypeConverter
public void setTypeConverter(org.citrusframework.util.TypeConverter typeConverter) Specifies the typeConverter.- Parameters:
typeConverter-
-
getLogModifier
public org.citrusframework.log.LogModifier getLogModifier()Gets the logModifier.- Returns:
-
setLogModifier
public void setLogModifier(org.citrusframework.log.LogModifier logModifier) Sets the logModifier.- Parameters:
logModifier-
-
getSegmentVariableExtractorRegistry
public org.citrusframework.variable.SegmentVariableExtractorRegistry getSegmentVariableExtractorRegistry()Gets the segmentVariableExtractorRegistry- Returns:
-
setSegmentVariableExtractorRegistry
public void setSegmentVariableExtractorRegistry(org.citrusframework.variable.SegmentVariableExtractorRegistry segmentVariableExtractorRegistry) Sets the segmentVariableExtractorRegistry- Parameters:
segmentVariableExtractorRegistry-
-