|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.junit.Assert org.apache.camel.test.junit4.TestSupport org.apache.camel.test.junit4.CamelTestSupport org.apache.camel.test.junit4.CamelSpringTestSupport
public abstract class CamelSpringTestSupport
Field Summary | |
---|---|
protected org.springframework.context.support.AbstractApplicationContext |
applicationContext
|
protected static Object |
lock
|
protected static ThreadLocal<org.springframework.context.support.AbstractApplicationContext> |
threadAppContext
|
Fields inherited from class org.apache.camel.test.junit4.CamelTestSupport |
---|
camelContextService, consumer, context, template |
Fields inherited from class org.apache.camel.test.junit4.TestSupport |
---|
log, LS, testName |
Constructor Summary | |
---|---|
CamelSpringTestSupport()
|
Method Summary | ||
---|---|---|
protected void |
assertValidContext(org.apache.camel.CamelContext context)
|
|
protected abstract org.springframework.context.support.AbstractApplicationContext |
createApplicationContext()
|
|
protected org.apache.camel.CamelContext |
createCamelContext()
|
|
void |
doPreSetup()
Strategy to perform any pre setup, before CamelContext is created |
|
protected Class<?> |
excludeRoute()
Template method used to exclude a Route from the test camel context |
|
protected Class<?>[] |
excludeRoutes()
Template method used to exclude Route from the test time context
route scanning |
|
protected int |
getExpectedRouteCount()
|
|
|
getMandatoryBean(Class<T> type,
String name)
Looks up the mandatory spring bean of the given name and type, failing if it is not present or the correct type |
|
protected org.springframework.context.ApplicationContext |
getRouteExcludingApplicationContext()
Create a parent context that initializes a PackageScanClassResolver to exclude a set of given classes from
being resolved. |
|
void |
postProcessTest()
Lets post process this test instance to process any Camel annotations. |
|
void |
tearDown()
|
|
static void |
tearSpringDownAfterClass()
|
Methods inherited from class org.junit.Assert |
---|
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static ThreadLocal<org.springframework.context.support.AbstractApplicationContext> threadAppContext
protected static Object lock
protected org.springframework.context.support.AbstractApplicationContext applicationContext
Constructor Detail |
---|
public CamelSpringTestSupport()
Method Detail |
---|
protected abstract org.springframework.context.support.AbstractApplicationContext createApplicationContext()
public void postProcessTest() throws Exception
CamelTestSupport
postProcessTest
in class CamelTestSupport
Exception
public void doPreSetup() throws Exception
CamelTestSupport
CamelContext
is created
doPreSetup
in class CamelTestSupport
Exception
public void tearDown() throws Exception
tearDown
in class CamelTestSupport
Exception
public static void tearSpringDownAfterClass() throws Exception
Exception
protected org.springframework.context.ApplicationContext getRouteExcludingApplicationContext()
PackageScanClassResolver
to exclude a set of given classes from
being resolved. Typically this is used at test time to exclude certain routes,
which might otherwise be just noisy, from being discovered and initialized.
To use this filtering mechanism it is necessary to provide the
ApplicationContext
returned from here as the parent context to
your test context e.g.
protected AbstractXmlApplicationContext createApplicationContext() { return new ClassPathXmlApplicationContext(new String[] {"test-context.xml"}, getRouteExcludingApplicationContext()); }This will, in turn, call the template methods
excludedRoutes
and excludedRoute
to determine the classes to be excluded from scanning.
ApplicationContext
configured
to exclude certain classes from package scanningprotected Class<?>[] excludeRoutes()
Route
from the test time context
route scanning
protected Class<?> excludeRoute()
Route
from the test camel context
public <T> T getMandatoryBean(Class<T> type, String name)
protected void assertValidContext(org.apache.camel.CamelContext context)
assertValidContext
in class CamelTestSupport
protected int getExpectedRouteCount()
protected org.apache.camel.CamelContext createCamelContext() throws Exception
createCamelContext
in class CamelTestSupport
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |