Package org.citrusframework.context
Class TestContextFactoryBean
java.lang.Object
org.citrusframework.context.TestContextFactory
org.citrusframework.context.TestContextFactoryBean
- All Implemented Interfaces:
org.citrusframework.spi.ReferenceResolverAware,org.springframework.beans.factory.Aware,org.springframework.beans.factory.FactoryBean<TestContext>,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
public class TestContextFactoryBean
extends TestContextFactory
implements org.springframework.beans.factory.FactoryBean<TestContext>, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
Factory bean implementation taking care of
FunctionRegistry and GlobalVariables. Enriches a test context factory delegate with
components coming from Spring application context. In addition to that adds application context reference to the test context when building new instances.- Author:
- Christoph Deppisch
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor using default factory delegate.TestContextFactoryBean(TestContextFactory factory) Constructor initializes with given factory delegate. -
Method Summary
Modifier and TypeMethodDescriptionvoidorg.springframework.context.ApplicationContextObtains the applicationContext.org.citrusframework.xml.namespace.NamespaceContextBuilderorg.citrusframework.spi.ReferenceResolverbooleanstatic TestContextFactorynewInstance(org.springframework.context.ApplicationContext applicationContext) Construct new factory instance from application context.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) Methods inherited from class org.citrusframework.context.TestContextFactory
copyOf, newInstance, setAfterTest, setBeforeTest, setEndpointFactory, setFunctionRegistry, setGlobalVariables, setLogModifier, setMessageListeners, setMessageProcessors, setMessageValidatorRegistry, setNamespaceContextBuilder, setReferenceResolver, setSegmentVariableExtractorRegistry, setTestActionListeners, setTestListeners, setTypeConverter, setValidationMatcherRegistry
-
Constructor Details
-
TestContextFactoryBean
public TestContextFactoryBean()Default constructor using default factory delegate. -
TestContextFactoryBean
Constructor initializes with given factory delegate.- Parameters:
factory-
-
-
Method Details
-
newInstance
public static TestContextFactory newInstance(org.springframework.context.ApplicationContext applicationContext) Construct new factory instance from application context.- Parameters:
applicationContext-- Returns:
-
getObjectType
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<TestContext>
-
getObject
- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean<TestContext>- Overrides:
getObjectin classTestContextFactory
-
isSingleton
public boolean isSingleton()- Specified by:
isSingletonin interfaceorg.springframework.beans.factory.FactoryBean<TestContext>
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext()Obtains the applicationContext.- Returns:
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
getFunctionRegistry
- Overrides:
getFunctionRegistryin classTestContextFactory
-
getValidationMatcherRegistry
- Overrides:
getValidationMatcherRegistryin classTestContextFactory
-
getGlobalVariables
- Overrides:
getGlobalVariablesin classTestContextFactory
-
getMessageValidatorRegistry
- Overrides:
getMessageValidatorRegistryin classTestContextFactory
-
getTestListeners
- Overrides:
getTestListenersin classTestContextFactory
-
getTestActionListeners
- Overrides:
getTestActionListenersin classTestContextFactory
-
getBeforeTest
- Overrides:
getBeforeTestin classTestContextFactory
-
getAfterTest
- Overrides:
getAfterTestin classTestContextFactory
-
getMessageListeners
- Overrides:
getMessageListenersin classTestContextFactory
-
getMessageProcessors
- Overrides:
getMessageProcessorsin classTestContextFactory
-
getEndpointFactory
- Overrides:
getEndpointFactoryin classTestContextFactory
-
getReferenceResolver
public org.citrusframework.spi.ReferenceResolver getReferenceResolver()- Overrides:
getReferenceResolverin classTestContextFactory
-
getTypeConverter
- Overrides:
getTypeConverterin classTestContextFactory
-
getLogModifier
- Overrides:
getLogModifierin classTestContextFactory
-
getNamespaceContextBuilder
public org.citrusframework.xml.namespace.NamespaceContextBuilder getNamespaceContextBuilder()- Overrides:
getNamespaceContextBuilderin classTestContextFactory
-
getSegmentVariableExtractorRegistry
- Overrides:
getSegmentVariableExtractorRegistryin classTestContextFactory
-