|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.test.context.support.AbstractDelegatingSmartContextLoader
org.springframework.test.context.support.DelegatingSmartContextLoader
org.apache.camel.test.spring.CamelSpringDelegatingTestContextLoader
public class CamelSpringDelegatingTestContextLoader
CamelSpringDelegatingTestContextLoader which fixes issues in Camel's JavaConfigContextLoader. (adds support for Camel's test annotations)
This loader can handle either classes or locations for configuring the context.
NOTE: This TestContextLoader doesn't support the annotation of ExcludeRoutes now.
| Field Summary | |
|---|---|
protected org.slf4j.Logger |
logger
|
| Constructor Summary | |
|---|---|
CamelSpringDelegatingTestContextLoader()
|
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class org.springframework.test.context.support.DelegatingSmartContextLoader |
|---|
getAnnotationConfigLoader, getXmlLoader |
| Methods inherited from class org.springframework.test.context.support.AbstractDelegatingSmartContextLoader |
|---|
loadContext, processContextConfiguration, processLocations |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.slf4j.Logger logger
| Constructor Detail |
|---|
public CamelSpringDelegatingTestContextLoader()
| Method Detail |
|---|
public org.springframework.context.ApplicationContext loadContext(org.springframework.test.context.MergedContextConfiguration mergedConfig)
throws Exception
loadContext in interface org.springframework.test.context.SmartContextLoaderloadContext in class org.springframework.test.context.support.AbstractDelegatingSmartContextLoaderException
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 executed
Exception - if there is an error during initialization/customizationprotected void cleanup(Class<?> testClass)
testClass - the test class being executed
protected void handleDisableJmx(org.springframework.context.ConfigurableApplicationContext context,
Class<?> testClass)
DisableJmx.
context - the initialized Spring contexttestClass - the test class being executed
protected void handleProvidesBreakpoint(org.springframework.context.ConfigurableApplicationContext context,
Class<?> testClass)
throws Exception
ProvidesBreakpoint annotation on a test class. Exists here
as it is needed in
context - the initialized Spring context containing the Camel context(s) to insert breakpoints intotestClass - the test class being processed
Exception - if there is an error processing the class
protected void handleShutdownTimeout(org.springframework.context.ConfigurableApplicationContext context,
Class<?> testClass)
throws Exception
ShutdownTimeout.
context - the initialized Spring contexttestClass - the test class being executed
Exception
protected void handleMockEndpoints(org.springframework.context.ConfigurableApplicationContext context,
Class<?> testClass)
throws Exception
MockEndpoints.
context - the initialized Spring contexttestClass - the test class being executed
Exception
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 executed
Exception
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 executed
Exceptionprotected Class<?> getTestClass()
CamelSpringTestHelper
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||