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.ConsumerTemplate
protected org.apache.camel.FluentProducerTemplate
protected org.apache.camel.ProducerTemplate
-
Constructor Summary
ConstructorsConstructorDescriptionTransientCamelContextManager
(TestExecutionConfiguration testConfigurationBuilder, CamelContextConfiguration camelContextConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
beforeContextStart
(Object test) A callback method to be executed before starting the contextorg.apache.camel.Service
When a separate service is used to manage the context lifecycle, this returns the reference to that serviceorg.apache.camel.ConsumerTemplate
consumer()
Gets the reference to the consumer template created during initializationorg.apache.camel.model.ModelCamelContext
context()
Gets the reference to the CamelContext instancevoid
createCamelContext
(Object test) Creates a new CamelContextprotected void
Disables the JMX agent.protected void
doStopCamelContext
(org.apache.camel.CamelContext context, org.apache.camel.Service camelContextService) void
dumpRouteCoverage
(Class<?> clazz, String currentTestName, long time) Dumps the route coverage informationprotected void
Enables the JMX agent.org.apache.camel.FluentProducerTemplate
Gets the reference to the fluent producer template created during initializationvoid
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 testsvoid
Starts the contextvoid
stop()
Fully stops the managervoid
Stops the contextvoid
Stops the templatesorg.apache.camel.ProducerTemplate
template()
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:CamelContextManager
Creates a new CamelContext- Specified by:
createCamelContext
in interfaceCamelContextManager
- Parameters:
test
- the test instance requesting the next context- Throws:
Exception
- if unable to create the context
-
beforeContextStart
Description copied from interface:CamelContextManager
A callback method to be executed before starting the context- Specified by:
beforeContextStart
in 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:CamelContextManager
Gets the reference to the CamelContext instance- Specified by:
context
in interfaceCamelContextManager
- 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 interfaceCamelContextManager
- 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 interfaceCamelContextManager
- 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 interfaceCamelContextManager
- 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 interfaceCamelContextManager
- Returns:
- the reference to the context lifecycle service
-
startCamelContext
Description copied from interface:CamelContextManager
Starts the context- Specified by:
startCamelContext
in interfaceCamelContextManager
- 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 interfaceCamelContextManager
-
stop
public void stop()Description copied from interface:CamelContextManager
Fully stops the manager- Specified by:
stop
in interfaceCamelContextManager
-
stopTemplates
public void stopTemplates()Description copied from interface:CamelContextManager
Stops the templates- Specified by:
stopTemplates
in 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:CamelContextManager
Sets the JUnit's data context that may be used to provide additional information for some tests- Specified by:
setGlobalStore
in interfaceCamelContextManager
- Parameters:
globalStore
- JUnit's data context instance
-
dumpRouteCoverage
Description copied from interface:CamelContextManager
Dumps the route coverage information- Specified by:
dumpRouteCoverage
in interfaceCamelContextManager
- Parameters:
clazz
-currentTestName
-time
-- Throws:
Exception
-