Class TransientCamelContextManager

java.lang.Object
org.apache.camel.test.junit5.TransientCamelContextManager
All Implemented Interfaces:
CamelContextManager

public class TransientCamelContextManager extends Object implements CamelContextManager
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.apache.camel.ConsumerTemplate
     
    protected org.apache.camel.FluentProducerTemplate
     
    protected org.apache.camel.ProducerTemplate
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    TransientCamelContextManager(TestExecutionConfiguration testConfigurationBuilder, CamelContextConfiguration camelContextConfiguration)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    void
    A callback method to be executed before starting the context
    org.apache.camel.Service
    When a separate service is used to manage the context lifecycle, this returns the reference to that service
    void
    Close the manager (this is run after all tests have been executed)
    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
    protected void
    Disables the JMX agent.
    protected void
    doStopCamelContext(org.apache.camel.CamelContext context, org.apache.camel.Service camelContextService)
     
    void
    dumpRoute(Class<?> clazz, String currentTestName, String format)
    Dumps the route
    void
    dumpRouteCoverage(Class<?> clazz, String currentTestName, long time)
    Dumps the route coverage information
    protected void
    Enables the JMX agent.
    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
    Stops the manager (typically run after every test execution)
    void
    Stops the context
    void
    Stops the templates
    org.apache.camel.ProducerTemplate
    Gets the reference to the producer template created during initialization

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • template

      protected org.apache.camel.ProducerTemplate template
    • fluentTemplate

      protected org.apache.camel.FluentProducerTemplate fluentTemplate
    • consumer

      protected org.apache.camel.ConsumerTemplate consumer
  • Constructor Details

  • Method Details

    • createCamelContext

      public void createCamelContext(Object test) throws Exception
      Description copied from interface: CamelContextManager
      Creates a new CamelContext
      Specified by:
      createCamelContext in interface CamelContextManager
      Parameters:
      test - the test instance requesting the next context
      Throws:
      Exception - if unable to create the context
    • beforeContextStart

      public void beforeContextStart(Object test) throws Exception
      Description copied from interface: CamelContextManager
      A callback method to be executed before starting the context
      Specified by:
      beforeContextStart in interface CamelContextManager
      Parameters:
      test -
      Throws:
      Exception
    • disableJMX

      protected void disableJMX()
      Disables the JMX agent.
    • enableJMX

      protected void enableJMX()
      Enables the JMX agent.
    • context

      public org.apache.camel.model.ModelCamelContext context()
      Description copied from interface: CamelContextManager
      Gets the reference to the CamelContext instance
      Specified by:
      context in interface CamelContextManager
      Returns:
      the CamelContext instance
    • template

      public org.apache.camel.ProducerTemplate template()
      Description copied from interface: CamelContextManager
      Gets the reference to the producer template created during initialization
      Specified by:
      template in interface CamelContextManager
      Returns:
      the producer template instance
    • fluentTemplate

      public org.apache.camel.FluentProducerTemplate fluentTemplate()
      Description copied from interface: CamelContextManager
      Gets the reference to the fluent producer template created during initialization
      Specified by:
      fluentTemplate in interface CamelContextManager
      Returns:
      the fluent producer template instance
    • consumer

      public org.apache.camel.ConsumerTemplate consumer()
      Description copied from interface: CamelContextManager
      Gets the reference to the consumer template created during initialization
      Specified by:
      consumer in interface CamelContextManager
      Returns:
      the consumer template instance
    • camelContextService

      public org.apache.camel.Service camelContextService()
      Description copied from interface: CamelContextManager
      When a separate service is used to manage the context lifecycle, this returns the reference to that service
      Specified by:
      camelContextService in interface CamelContextManager
      Returns:
      the reference to the context lifecycle service
    • startCamelContext

      public void startCamelContext() throws Exception
      Description copied from interface: CamelContextManager
      Starts the context
      Specified by:
      startCamelContext in interface CamelContextManager
      Throws:
      Exception - if unable to start the context for any reason
    • stopCamelContext

      public void stopCamelContext()
      Description copied from interface: CamelContextManager
      Stops the context
      Specified by:
      stopCamelContext in interface CamelContextManager
    • stop

      public void stop()
      Description copied from interface: CamelContextManager
      Stops the manager (typically run after every test execution)
      Specified by:
      stop in interface CamelContextManager
    • stopTemplates

      public void stopTemplates()
      Description copied from interface: CamelContextManager
      Stops the templates
      Specified by:
      stopTemplates in interface CamelContextManager
    • close

      public void close()
      Description copied from interface: CamelContextManager
      Close the manager (this is run after all tests have been executed)
      Specified by:
      close in interface CamelContextManager
    • doStopCamelContext

      protected void doStopCamelContext(org.apache.camel.CamelContext context, org.apache.camel.Service camelContextService)
    • applyCamelPostProcessor

      protected void applyCamelPostProcessor(Object test) throws Exception
      Throws:
      Exception
    • setGlobalStore

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

      public void dumpRouteCoverage(Class<?> clazz, String currentTestName, long time) throws Exception
      Description copied from interface: CamelContextManager
      Dumps the route coverage information
      Specified by:
      dumpRouteCoverage in interface CamelContextManager
      Throws:
      Exception
    • dumpRoute

      public void dumpRoute(Class<?> clazz, String currentTestName, String format) throws Exception
      Description copied from interface: CamelContextManager
      Dumps the route
      Specified by:
      dumpRoute in interface CamelContextManager
      Throws:
      Exception