Class 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
    • 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 interface com.consol.citrus.report.TestSuiteListenerAware
      • addTestListener

        public void addTestListener​(com.consol.citrus.report.TestListener testListener)
        Specified by:
        addTestListener in interface com.consol.citrus.report.TestListenerAware
      • addTestActionListener

        public void addTestActionListener​(com.consol.citrus.report.TestActionListener testActionListener)
        Specified by:
        addTestActionListener in interface com.consol.citrus.report.TestActionListenerAware
      • addTestReporter

        public void addTestReporter​(com.consol.citrus.report.TestReporter testReporter)
        Specified by:
        addTestReporter in interface com.consol.citrus.report.TestReporterAware
      • addMessageListener

        public void addMessageListener​(com.consol.citrus.report.MessageListener listener)
        Specified by:
        addMessageListener in interface com.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:
      • bind

        public void bind​(String name,
                         Object value)
        Specified by:
        bind in interface com.consol.citrus.spi.ReferenceRegistry