Class TestContextFactoryBean

  • All Implemented Interfaces:
    com.consol.citrus.spi.ReferenceResolverAware, org.springframework.beans.factory.Aware, org.springframework.beans.factory.FactoryBean<com.consol.citrus.context.TestContext>, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

    public class TestContextFactoryBean
    extends com.consol.citrus.context.TestContextFactory
    implements org.springframework.beans.factory.FactoryBean<com.consol.citrus.context.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
    • Constructor Detail

      • TestContextFactoryBean

        public TestContextFactoryBean()
        Default constructor using default factory delegate.
      • TestContextFactoryBean

        public TestContextFactoryBean​(com.consol.citrus.context.TestContextFactory factory)
        Constructor initializes with given factory delegate.
        Parameters:
        factory -
    • Method Detail

      • newInstance

        public static com.consol.citrus.context.TestContextFactory newInstance​(org.springframework.context.ApplicationContext applicationContext)
        Construct new factory instance from application context.
        Parameters:
        applicationContext -
        Returns:
      • getObjectType

        public Class<com.consol.citrus.context.TestContext> getObjectType()
        Specified by:
        getObjectType in interface org.springframework.beans.factory.FactoryBean<com.consol.citrus.context.TestContext>
      • getObject

        public com.consol.citrus.context.TestContext getObject()
        Specified by:
        getObject in interface org.springframework.beans.factory.FactoryBean<com.consol.citrus.context.TestContext>
        Overrides:
        getObject in class com.consol.citrus.context.TestContextFactory
      • isSingleton

        public boolean isSingleton()
        Specified by:
        isSingleton in interface org.springframework.beans.factory.FactoryBean<com.consol.citrus.context.TestContext>
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        Specified by:
        afterPropertiesSet in interface org.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:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException
      • getFunctionRegistry

        public com.consol.citrus.functions.FunctionRegistry getFunctionRegistry()
        Overrides:
        getFunctionRegistry in class com.consol.citrus.context.TestContextFactory
      • getValidationMatcherRegistry

        public com.consol.citrus.validation.matcher.ValidationMatcherRegistry getValidationMatcherRegistry()
        Overrides:
        getValidationMatcherRegistry in class com.consol.citrus.context.TestContextFactory
      • getGlobalVariables

        public com.consol.citrus.variable.GlobalVariables getGlobalVariables()
        Overrides:
        getGlobalVariables in class com.consol.citrus.context.TestContextFactory
      • getMessageValidatorRegistry

        public com.consol.citrus.validation.MessageValidatorRegistry getMessageValidatorRegistry()
        Overrides:
        getMessageValidatorRegistry in class com.consol.citrus.context.TestContextFactory
      • getTestListeners

        public com.consol.citrus.report.TestListeners getTestListeners()
        Overrides:
        getTestListeners in class com.consol.citrus.context.TestContextFactory
      • getTestActionListeners

        public com.consol.citrus.report.TestActionListeners getTestActionListeners()
        Overrides:
        getTestActionListeners in class com.consol.citrus.context.TestContextFactory
      • getBeforeTest

        public List<com.consol.citrus.container.BeforeTest> getBeforeTest()
        Overrides:
        getBeforeTest in class com.consol.citrus.context.TestContextFactory
      • getAfterTest

        public List<com.consol.citrus.container.AfterTest> getAfterTest()
        Overrides:
        getAfterTest in class com.consol.citrus.context.TestContextFactory
      • getMessageListeners

        public com.consol.citrus.report.MessageListeners getMessageListeners()
        Overrides:
        getMessageListeners in class com.consol.citrus.context.TestContextFactory
      • getMessageProcessors

        public com.consol.citrus.message.MessageProcessors getMessageProcessors()
        Overrides:
        getMessageProcessors in class com.consol.citrus.context.TestContextFactory
      • getEndpointFactory

        public com.consol.citrus.endpoint.EndpointFactory getEndpointFactory()
        Overrides:
        getEndpointFactory in class com.consol.citrus.context.TestContextFactory
      • getReferenceResolver

        public com.consol.citrus.spi.ReferenceResolver getReferenceResolver()
        Overrides:
        getReferenceResolver in class com.consol.citrus.context.TestContextFactory
      • getTypeConverter

        public com.consol.citrus.util.TypeConverter getTypeConverter()
        Overrides:
        getTypeConverter in class com.consol.citrus.context.TestContextFactory
      • getNamespaceContextBuilder

        public com.consol.citrus.xml.namespace.NamespaceContextBuilder getNamespaceContextBuilder()
        Overrides:
        getNamespaceContextBuilder in class com.consol.citrus.context.TestContextFactory