public class CamelSpringDelegatingTestContextLoader
extends org.springframework.test.context.support.DelegatingSmartContextLoader
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
logger |
Constructor and Description |
---|
CamelSpringDelegatingTestContextLoader() |
Modifier and Type | Method and Description |
---|---|
protected void |
cleanup(Class<?> testClass)
Cleanup/restore global state to defaults / pre-test values after the test setup
is complete.
|
protected Class<?> |
getTestClass()
Returns the class under test in order to enable inspection of annotations while the
Spring context is being created.
|
protected void |
handleCamelContextStartup(org.springframework.context.ConfigurableApplicationContext context,
Class<?> testClass)
Handles starting of Camel contexts based on
UseAdviceWith and other state in the JVM. |
protected void |
handleDisableJmx(org.springframework.context.ConfigurableApplicationContext context,
Class<?> testClass)
Handles disabling of JMX on Camel contexts based on
DisableJmx . |
protected void |
handleMockEndpoints(org.springframework.context.ConfigurableApplicationContext context,
Class<?> testClass)
Handles auto-intercepting of endpoints with mocks based on
MockEndpoints . |
protected void |
handleMockEndpointsAndSkip(org.springframework.context.ConfigurableApplicationContext context,
Class<?> testClass)
Handles auto-intercepting of endpoints with mocks based on
MockEndpointsAndSkip and skipping the
original endpoint. |
protected void |
handleProvidesBreakpoint(org.springframework.context.ConfigurableApplicationContext context,
Class<?> testClass)
Handles the processing of the
ProvidesBreakpoint annotation on a test class. |
protected void |
handleShutdownTimeout(org.springframework.context.ConfigurableApplicationContext context,
Class<?> testClass)
Handles updating shutdown timeouts on Camel contexts based on
ShutdownTimeout . |
org.springframework.context.ApplicationContext |
loadContext(org.springframework.context.ConfigurableApplicationContext context,
Class<?> testClass)
Performs the bulk of the Spring application context loading/customization.
|
org.springframework.context.ApplicationContext |
loadContext(org.springframework.test.context.MergedContextConfiguration mergedConfig) |
getAnnotationConfigLoader, getXmlLoader
public CamelSpringDelegatingTestContextLoader()
public org.springframework.context.ApplicationContext loadContext(org.springframework.test.context.MergedContextConfiguration mergedConfig) throws Exception
loadContext
in interface org.springframework.test.context.SmartContextLoader
loadContext
in class org.springframework.test.context.support.AbstractDelegatingSmartContextLoader
Exception
public org.springframework.context.ApplicationContext loadContext(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) throws Exception
context
- the partially configured context. The context should have the bean definitions loaded, but nothing else.testClass
- the test class being executedException
- if there is an error during initialization/customizationprotected void cleanup(Class<?> testClass)
testClass
- the test class being executedprotected void handleDisableJmx(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass)
DisableJmx
.context
- the initialized Spring contexttestClass
- the test class being executedprotected void handleProvidesBreakpoint(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) throws Exception
ProvidesBreakpoint
annotation on a test class. Exists here
as it is needed incontext
- the initialized Spring context containing the Camel context(s) to insert breakpoints intotestClass
- the test class being processedException
- if there is an error processing the classprotected void handleShutdownTimeout(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) throws Exception
ShutdownTimeout
.context
- the initialized Spring contexttestClass
- the test class being executedException
protected void handleMockEndpoints(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) throws Exception
MockEndpoints
.context
- the initialized Spring contexttestClass
- the test class being executedException
protected void handleMockEndpointsAndSkip(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) throws Exception
MockEndpointsAndSkip
and skipping the
original endpoint.context
- the initialized Spring contexttestClass
- the test class being executedException
protected void handleCamelContextStartup(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) throws Exception
UseAdviceWith
and other state in the JVM.context
- the initialized Spring contexttestClass
- the test class being executedException
protected Class<?> getTestClass()
CamelSpringTestHelper
Apache Camel