Package io.apiman.manager.api.micro
Class ManagerApiMicroService
- java.lang.Object
-
- io.apiman.manager.api.micro.ManagerApiMicroService
-
public class ManagerApiMicroService extends Object
This class starts up an embedded Jetty test server so that integration tests can be performed.- Author:
- eric.wittmann@redhat.com
-
-
Constructor Summary
Constructors Constructor Description ManagerApiMicroService()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddAuthFilter(org.eclipse.jetty.servlet.ServletContextHandler apiManServer)protected voidaddModulesToJetty(org.eclipse.jetty.server.handler.HandlerCollection handlers)Configure the web application(s).protected voidaddSecurityHandler(org.eclipse.jetty.servlet.ServletContextHandler apiManServer)protected org.eclipse.jetty.security.SecurityHandlercreateSecurityHandler()Creates a basic auth security handler.protected org.eclipse.jetty.util.resource.ResourcegetConfigResource(String path)protected org.eclipse.jetty.util.resource.ResourcegetTranslationsResource(String path)voidjoin()intserverPort()voidstart()Start/run the server.voidstop()Stop the server.
-
-
-
Method Detail
-
start
public void start() throws ExceptionStart/run the server.- Throws:
Exception- when any exception occurs
-
stop
public void stop() throws ExceptionStop the server.- Throws:
Exception- when any exception occurs
-
serverPort
public int serverPort()
- Returns:
- the server port.
-
addModulesToJetty
protected void addModulesToJetty(org.eclipse.jetty.server.handler.HandlerCollection handlers) throws ExceptionConfigure the web application(s).- Parameters:
handlers-- Throws:
Exception
-
getTranslationsResource
protected org.eclipse.jetty.util.resource.Resource getTranslationsResource(String path)
- Returns:
- a resource representing the translations.js file
-
getConfigResource
protected org.eclipse.jetty.util.resource.Resource getConfigResource(String path)
- Returns:
- a resource representing the config.js file
-
addSecurityHandler
protected void addSecurityHandler(org.eclipse.jetty.servlet.ServletContextHandler apiManServer) throws Exception- Parameters:
apiManServer-- Throws:
Exception
-
addAuthFilter
protected void addAuthFilter(org.eclipse.jetty.servlet.ServletContextHandler apiManServer)
- Parameters:
apiManServer-
-
createSecurityHandler
protected org.eclipse.jetty.security.SecurityHandler createSecurityHandler() throws ExceptionCreates a basic auth security handler.- Throws:
Exception
-
join
public void join() throws InterruptedException- Throws:
InterruptedException- when interrupted
-
-