Package org.apache.camel.test.junit5
Class LegacyCamelContextManager
java.lang.Object
org.apache.camel.test.junit5.LegacyCamelContextManager
- All Implemented Interfaces:
CamelContextManager
A
CamelContext test lifecycle manager based on the behavior that was built in CamelTestSupport up to
Camel 4.7.0-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.camel.ConsumerTemplateprotected org.apache.camel.FluentProducerTemplateprotected org.apache.camel.ProducerTemplate -
Constructor Summary
ConstructorsConstructorDescriptionLegacyCamelContextManager(TestExecutionConfiguration testConfigurationBuilder, CamelContextConfiguration camelContextConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidbeforeContextStart(Object test) A callback method to be executed before starting the contextorg.apache.camel.ServiceWhen a separate service is used to manage the context lifecycle, this returns the reference to that serviceorg.apache.camel.ConsumerTemplateconsumer()Gets the reference to the consumer template created during initializationorg.apache.camel.model.ModelCamelContextcontext()Gets the reference to the CamelContext instancevoidcreateCamelContext(Object test) Creates a new CamelContextprotected voidDisables the JMX agent.protected voiddoStopCamelContext(org.apache.camel.CamelContext context, org.apache.camel.Service camelContextService) voiddumpRouteCoverage(Class<?> clazz, String currentTestName, long time) Dumps the route coverage informationprotected voidEnables the JMX agent.org.apache.camel.FluentProducerTemplateGets the reference to the fluent producer template created during initializationvoidsetGlobalStore(org.junit.jupiter.api.extension.ExtensionContext.Store globalStore) Sets the JUnit's data context that may be used to provide additional information for some testsvoidStarts the contextvoidstop()Fully stops the managervoidStops the contextvoidStops the templatesorg.apache.camel.ProducerTemplatetemplate()Gets the reference to the producer template created during initialization
-
Field Details
-
template
protected volatile org.apache.camel.ProducerTemplate template -
fluentTemplate
protected volatile org.apache.camel.FluentProducerTemplate fluentTemplate -
consumer
protected volatile org.apache.camel.ConsumerTemplate consumer
-
-
Constructor Details
-
LegacyCamelContextManager
public LegacyCamelContextManager(TestExecutionConfiguration testConfigurationBuilder, CamelContextConfiguration camelContextConfiguration)
-
-
Method Details
-
createCamelContext
Description copied from interface:CamelContextManagerCreates a new CamelContext- Specified by:
createCamelContextin interfaceCamelContextManager- Parameters:
test- the test instance requesting the next context- Throws:
Exception- if unable to create the context
-
beforeContextStart
Description copied from interface:CamelContextManagerA callback method to be executed before starting the context- Specified by:
beforeContextStartin interfaceCamelContextManager- 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:CamelContextManagerGets the reference to the CamelContext instance- Specified by:
contextin interfaceCamelContextManager- Returns:
- the CamelContext instance
-
template
public org.apache.camel.ProducerTemplate template()Description copied from interface:CamelContextManagerGets the reference to the producer template created during initialization- Specified by:
templatein interfaceCamelContextManager- Returns:
- the producer template instance
-
fluentTemplate
public org.apache.camel.FluentProducerTemplate fluentTemplate()Description copied from interface:CamelContextManagerGets the reference to the fluent producer template created during initialization- Specified by:
fluentTemplatein interfaceCamelContextManager- Returns:
- the fluent producer template instance
-
consumer
public org.apache.camel.ConsumerTemplate consumer()Description copied from interface:CamelContextManagerGets the reference to the consumer template created during initialization- Specified by:
consumerin interfaceCamelContextManager- Returns:
- the consumer template instance
-
camelContextService
public org.apache.camel.Service camelContextService()Description copied from interface:CamelContextManagerWhen a separate service is used to manage the context lifecycle, this returns the reference to that service- Specified by:
camelContextServicein interfaceCamelContextManager- Returns:
- the reference to the context lifecycle service
-
startCamelContext
Description copied from interface:CamelContextManagerStarts the context- Specified by:
startCamelContextin interfaceCamelContextManager- Throws:
Exception- if unable to start the context for any reason
-
stopCamelContext
public void stopCamelContext()Description copied from interface:CamelContextManagerStops the context- Specified by:
stopCamelContextin interfaceCamelContextManager
-
stop
public void stop()Description copied from interface:CamelContextManagerFully stops the manager- Specified by:
stopin interfaceCamelContextManager
-
stopTemplates
public void stopTemplates()Description copied from interface:CamelContextManagerStops the templates- Specified by:
stopTemplatesin interfaceCamelContextManager
-
doStopCamelContext
protected void doStopCamelContext(org.apache.camel.CamelContext context, org.apache.camel.Service camelContextService) -
applyCamelPostProcessor
- Throws:
Exception
-
setGlobalStore
public void setGlobalStore(org.junit.jupiter.api.extension.ExtensionContext.Store globalStore) Description copied from interface:CamelContextManagerSets the JUnit's data context that may be used to provide additional information for some tests- Specified by:
setGlobalStorein interfaceCamelContextManager- Parameters:
globalStore- JUnit's data context instance
-
dumpRouteCoverage
Description copied from interface:CamelContextManagerDumps the route coverage information- Specified by:
dumpRouteCoveragein interfaceCamelContextManager- Parameters:
clazz-currentTestName-time-- Throws:
Exception
-