Class StopWatchTestExecutionListener
java.lang.Object
org.springframework.test.context.support.AbstractTestExecutionListener
org.apache.camel.test.spring.junit5.StopWatchTestExecutionListener
- All Implemented Interfaces:
org.springframework.core.Ordered,org.springframework.test.context.TestExecutionListener
public class StopWatchTestExecutionListener
extends org.springframework.test.context.support.AbstractTestExecutionListener
An execution listener that simulates the timing output built in to
CamelTestSupport.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final ThreadLocal<org.apache.camel.util.StopWatch> Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterTestMethod(org.springframework.test.context.TestContext testContext) voidbeforeTestMethod(org.springframework.test.context.TestContext testContext) intgetOrder()Returns the precedence used by Spring to choose the appropriate execution order of test listeners.static org.apache.camel.util.StopWatchExists primarily for testing purposes, but allows for access to the underlying stop watch instance for a test.Methods inherited from class org.springframework.test.context.support.AbstractTestExecutionListener
afterTestClass, afterTestExecution, beforeTestClass, beforeTestExecution, prepareTestInstance
-
Field Details
-
threadStopWatch
-
-
Constructor Details
-
StopWatchTestExecutionListener
public StopWatchTestExecutionListener()
-
-
Method Details
-
getOrder
public int getOrder()Returns the precedence used by Spring to choose the appropriate execution order of test listeners. SeeSpringTestExecutionListenerSorter.getPrecedence(Class)for more.- Specified by:
getOrderin interfaceorg.springframework.core.Ordered- Overrides:
getOrderin classorg.springframework.test.context.support.AbstractTestExecutionListener
-
getStopWatch
public static org.apache.camel.util.StopWatch getStopWatch()Exists primarily for testing purposes, but allows for access to the underlying stop watch instance for a test. -
beforeTestMethod
public void beforeTestMethod(org.springframework.test.context.TestContext testContext) throws Exception - Specified by:
beforeTestMethodin interfaceorg.springframework.test.context.TestExecutionListener- Overrides:
beforeTestMethodin classorg.springframework.test.context.support.AbstractTestExecutionListener- Throws:
Exception
-
afterTestMethod
public void afterTestMethod(org.springframework.test.context.TestContext testContext) throws Exception - Specified by:
afterTestMethodin interfaceorg.springframework.test.context.TestExecutionListener- Overrides:
afterTestMethodin classorg.springframework.test.context.support.AbstractTestExecutionListener- Throws:
Exception
-