Package io.apiman.manager.test.junit
Class ManagerRestTester
- java.lang.Object
-
- org.junit.runner.Runner
-
- org.junit.runners.ParentRunner<ManagerRestTester.TestInfo>
-
- io.apiman.manager.test.junit.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 requiredManagerRestTestPlanannotation.- Author:
- eric.wittmann@redhat.com
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classManagerRestTester.GatewayAssertionTestInfostatic classManagerRestTester.PublishPayloadTestInfostatic classManagerRestTester.TestInfostatic classManagerRestTester.TestPlanInfo
-
Constructor Summary
Constructors Constructor Description ManagerRestTester(Class<?> testClass)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.junit.runner.DescriptiondescribeChild(ManagerRestTester.TestInfo child)protected StringgetBaseApiContext()protected List<ManagerRestTester.TestInfo>getChildren()protected intgetTestServerPort()voidlog(String message, Object... params)Logs a message.voidrun(org.junit.runner.notification.RunNotifier notifier)protected voidrunChild(ManagerRestTester.TestInfo testInfo, org.junit.runner.notification.RunNotifier notifier)static voidsetup()Called to setup the test.static voidshutdown()Called at the end of the test.protected static voidstartServer()protected static voidstopServer()protected org.junit.runners.model.StatementwithBeforeClasses(org.junit.runners.model.Statement statement)-
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, classRules, collectInitializationErrors, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, isIgnored, order, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withInterruptIsolation
-
-
-
-
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:
withBeforeClassesin classorg.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
-
getChildren
protected List<ManagerRestTester.TestInfo> getChildren()
- Specified by:
getChildrenin classorg.junit.runners.ParentRunner<ManagerRestTester.TestInfo>- See Also:
ParentRunner.getChildren()
-
run
public void run(org.junit.runner.notification.RunNotifier notifier)
- Overrides:
runin classorg.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:
runChildin classorg.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:
describeChildin classorg.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
-
-