Class ManagerRestTester

  • All Implemented Interfaces:
    org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Orderable, org.junit.runner.manipulation.Sortable

    public class ManagerRestTester
    extends org.junit.runners.ParentRunner<ManagerRestTester.TestInfo>
    A junit test runner that fires up apiman and makes it ready for use in the tests. This runner also loads up the test plan from the required ManagerRestTestPlan annotation.
    Author:
    eric.wittmann@redhat.com
    • Constructor Detail

      • ManagerRestTester

        public ManagerRestTester​(Class<?> testClass)
                          throws org.junit.runners.model.InitializationError
        Constructor.
        Throws:
        org.junit.runners.model.InitializationError
    • Method Detail

      • withBeforeClasses

        protected org.junit.runners.model.Statement withBeforeClasses​(org.junit.runners.model.Statement statement)
        Overrides:
        withBeforeClasses in class org.junit.runners.ParentRunner<ManagerRestTester.TestInfo>
      • setup

        public static void setup()
        Called to setup the test.
        Throws:
        org.junit.runners.model.InitializationError
      • shutdown

        public static void shutdown()
        Called at the end of the test.
      • startServer

        protected static void startServer()
        Throws:
        Exception
      • stopServer

        protected static void stopServer()
        Throws:
        Exception
      • run

        public void run​(org.junit.runner.notification.RunNotifier notifier)
        Overrides:
        run in class org.junit.runners.ParentRunner<ManagerRestTester.TestInfo>
        See Also:
        ParentRunner.run(org.junit.runner.notification.RunNotifier)
      • runChild

        protected void runChild​(ManagerRestTester.TestInfo testInfo,
                                org.junit.runner.notification.RunNotifier notifier)
        Specified by:
        runChild in class org.junit.runners.ParentRunner<ManagerRestTester.TestInfo>
        See Also:
        ParentRunner.runChild(java.lang.Object, org.junit.runner.notification.RunNotifier)
      • describeChild

        protected org.junit.runner.Description describeChild​(ManagerRestTester.TestInfo child)
        Specified by:
        describeChild in class org.junit.runners.ParentRunner<ManagerRestTester.TestInfo>
        See Also:
        ParentRunner.describeChild(java.lang.Object)
      • getBaseApiContext

        protected String getBaseApiContext()
        Returns:
        the base context of the DT API
      • getTestServerPort

        protected int getTestServerPort()
        Returns:
        the port to use when sending requests
      • log

        public void log​(String message,
                        Object... params)
        Logs a message.
        Parameters:
        message -
        params -