org.apache.camel.test.spring
Class CamelSpringTestHelper

java.lang.Object
  extended by org.apache.camel.test.spring.CamelSpringTestHelper

public final class CamelSpringTestHelper
extends Object

Helper that provides state information across the levels of Spring Test that do not expose the necessary context/state for integration of Camel testing features into Spring test. Also provides utility methods.

Note that this class makes use of ThreadLocals to maintain some state. It is imperative that the state setters and getters are accessed within the scope of a single thread in order for this class to work right.


Nested Class Summary
static interface CamelSpringTestHelper.DoToSpringCamelContextsStrategy
           
 
Method Summary
static void doToSpringCamelContexts(org.springframework.context.ApplicationContext context, CamelSpringTestHelper.DoToSpringCamelContextsStrategy strategy)
          Executes strategy against all SpringCamelContexts found in the Spring context.
static Collection<Method> getAllMethods(Class<?> clazz)
          Returns all methods defined in clazz and its superclasses/interfaces.
static String getOriginalJmxDisabled()
           
static Class<?> getTestClass()
           
static void setOriginalJmxDisabledValue(String originalValue)
           
static void setTestClass(Class<?> testClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getOriginalJmxDisabled

public static String getOriginalJmxDisabled()

setOriginalJmxDisabledValue

public static void setOriginalJmxDisabledValue(String originalValue)

getTestClass

public static Class<?> getTestClass()

setTestClass

public static void setTestClass(Class<?> testClass)

getAllMethods

public static Collection<Method> getAllMethods(Class<?> clazz)
Returns all methods defined in clazz and its superclasses/interfaces.


doToSpringCamelContexts

public static void doToSpringCamelContexts(org.springframework.context.ApplicationContext context,
                                           CamelSpringTestHelper.DoToSpringCamelContextsStrategy strategy)
                                    throws Exception
Executes strategy against all SpringCamelContexts found in the Spring context. This method reduces the amount of repeated find and loop code throughout this class.

Parameters:
context - the Spring context to search
strategy - the strategy to execute against the found SpringCamelContexts
Throws:
Exception - if there is an error executing any of the strategies


Apache Camel