Class 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

      Fields 
      Modifier and Type Field Description
      protected static ThreadLocal<org.apache.camel.util.StopWatch> threadStopWatch  
      • Fields inherited from interface org.springframework.core.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterTestMethod​(org.springframework.test.context.TestContext testContext)  
      void beforeTestMethod​(org.springframework.test.context.TestContext testContext)  
      int getOrder()
      Returns the precedence that is used by Spring to choose the appropriate execution order of test listeners.
      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.
      • Methods inherited from class org.springframework.test.context.support.AbstractTestExecutionListener

        afterTestClass, afterTestExecution, beforeTestClass, beforeTestExecution, prepareTestInstance
    • Field Detail

      • threadStopWatch

        protected static ThreadLocal<org.apache.camel.util.StopWatch> threadStopWatch
    • Constructor Detail

      • StopWatchTestExecutionListener

        public StopWatchTestExecutionListener()
    • Method Detail

      • getOrder

        public int getOrder()
        Returns the precedence that is used by Spring to choose the appropriate execution order of test listeners. See SpringTestExecutionListenerSorter.getPrecedence(Class) for more.
        Specified by:
        getOrder in interface org.springframework.core.Ordered
        Overrides:
        getOrder in class org.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:
        beforeTestMethod in interface org.springframework.test.context.TestExecutionListener
        Overrides:
        beforeTestMethod in class org.springframework.test.context.support.AbstractTestExecutionListener
        Throws:
        Exception
      • afterTestMethod

        public void afterTestMethod​(org.springframework.test.context.TestContext testContext)
                             throws Exception
        Specified by:
        afterTestMethod in interface org.springframework.test.context.TestExecutionListener
        Overrides:
        afterTestMethod in class org.springframework.test.context.support.AbstractTestExecutionListener
        Throws:
        Exception