Class JUnitHttpServerExecutionListener

  • All Implemented Interfaces:
    org.springframework.core.Ordered, org.springframework.test.context.TestExecutionListener

    public class JUnitHttpServerExecutionListener
    extends OpenNMSAbstractTestExecutionListener
    This TestExecutionListener looks for the JUnitHttpServer annotation and uses attributes on it to launch a temporary HTTP server for use during unit tests.
    Author:
    ranger
    • Field Summary

      • 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)
      static int getPort()  
      • Methods inherited from class org.springframework.test.context.support.AbstractTestExecutionListener

        afterTestClass, beforeTestClass, getOrder, prepareTestInstance
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JUnitHttpServerExecutionListener

        public JUnitHttpServerExecutionListener()
    • Method Detail

      • beforeTestMethod

        public void beforeTestMethod​(org.springframework.test.context.TestContext testContext)
                              throws java.lang.Exception
        Specified by:
        beforeTestMethod in interface org.springframework.test.context.TestExecutionListener
        Overrides:
        beforeTestMethod in class OpenNMSAbstractTestExecutionListener
        Throws:
        java.lang.Exception
      • afterTestMethod

        public void afterTestMethod​(org.springframework.test.context.TestContext testContext)
                             throws java.lang.Exception
        Specified by:
        afterTestMethod in interface org.springframework.test.context.TestExecutionListener
        Overrides:
        afterTestMethod in class OpenNMSAbstractTestExecutionListener
        Throws:
        java.lang.Exception
      • getPort

        public static int getPort()