Package org.apache.camel.test.junit5
Class TransientCamelContextManager
java.lang.Object
org.apache.camel.test.junit5.TransientCamelContextManager
- All Implemented Interfaces:
CamelContextManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.camel.ConsumerTemplateprotected org.apache.camel.FluentProducerTemplateprotected org.apache.camel.ProducerTemplate -
Constructor Summary
ConstructorsConstructorDescriptionTransientCamelContextManager(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 servicevoidclose()Close the manager (this is run after all tests have been executed)org.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) voidDumps the routevoiddumpRouteCoverage(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()Stops the manager (typically run after every test execution)voidStops the contextvoidStops the templatesorg.apache.camel.ProducerTemplatetemplate()Gets the reference to the producer template created during initialization
-
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
-
TransientCamelContextManager
public TransientCamelContextManager(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:CamelContextManagerStops the manager (typically run after every test execution)- Specified by:
stopin interfaceCamelContextManager
-
stopTemplates
public void stopTemplates()Description copied from interface:CamelContextManagerStops the templates- Specified by:
stopTemplatesin interfaceCamelContextManager
-
close
public void close()Description copied from interface:CamelContextManagerClose the manager (this is run after all tests have been executed)- Specified by:
closein 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- Throws:
Exception
-
dumpRoute
Description copied from interface:CamelContextManagerDumps the route- Specified by:
dumpRoutein interfaceCamelContextManager- Throws:
Exception
-