Interface CamelContextManager

All Known Implementing Classes:
LegacyCamelContextManager, TransientCamelContextManager

public interface CamelContextManager
A ContextManager is used to manage the lifecycle of a CamelContext during test execution
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    A callback method to be executed before starting the context
    org.apache.camel.Service
    Deprecated.
    org.apache.camel.ConsumerTemplate
    Gets the reference to the consumer template created during initialization
    org.apache.camel.model.ModelCamelContext
    Gets the reference to the CamelContext instance
    void
    Creates a new CamelContext
    void
    dumpRouteCoverage(Class<?> clazz, String currentTestName, long time)
    Dumps the route coverage information
    org.apache.camel.FluentProducerTemplate
    Gets the reference to the fluent producer template created during initialization
    void
    setGlobalStore(org.junit.jupiter.api.extension.ExtensionContext.Store globalStore)
    Sets the JUnit's data context that may be used to provide additional information for some tests
    void
    Starts the context
    void
    Fully stops the manager
    void
    Stops the context
    void
    Stops the templates
    org.apache.camel.ProducerTemplate
    Gets the reference to the producer template created during initialization
  • Method Details

    • createCamelContext

      void createCamelContext(Object test) throws Exception
      Creates a new CamelContext
      Parameters:
      test - the test instance requesting the next context
      Throws:
      Exception - if unable to create the context
    • beforeContextStart

      void beforeContextStart(Object test) throws Exception
      A callback method to be executed before starting the context
      Parameters:
      test -
      Throws:
      Exception
    • context

      org.apache.camel.model.ModelCamelContext context()
      Gets the reference to the CamelContext instance
      Returns:
      the CamelContext instance
    • template

      org.apache.camel.ProducerTemplate template()
      Gets the reference to the producer template created during initialization
      Returns:
      the producer template instance
    • fluentTemplate

      org.apache.camel.FluentProducerTemplate fluentTemplate()
      Gets the reference to the fluent producer template created during initialization
      Returns:
      the fluent producer template instance
    • consumer

      org.apache.camel.ConsumerTemplate consumer()
      Gets the reference to the consumer template created during initialization
      Returns:
      the consumer template instance
    • camelContextService

      @Deprecated(since="4.7.0") org.apache.camel.Service camelContextService()
      Deprecated.
      When a separate service is used to manage the context lifecycle, this returns the reference to that service
      Returns:
      the reference to the context lifecycle service
    • startCamelContext

      void startCamelContext() throws Exception
      Starts the context
      Throws:
      Exception - if unable to start the context for any reason
    • stopCamelContext

      void stopCamelContext()
      Stops the context
    • stopTemplates

      void stopTemplates()
      Stops the templates
    • stop

      void stop()
      Fully stops the manager
    • setGlobalStore

      void setGlobalStore(org.junit.jupiter.api.extension.ExtensionContext.Store globalStore)
      Sets the JUnit's data context that may be used to provide additional information for some tests
      Parameters:
      globalStore - JUnit's data context instance
    • dumpRouteCoverage

      void dumpRouteCoverage(Class<?> clazz, String currentTestName, long time) throws Exception
      Dumps the route coverage information
      Parameters:
      clazz -
      currentTestName -
      time -
      Throws:
      Exception