Class TestWebServer
- java.lang.Object
-
- org.opendaylight.infrautils.testutils.web.TestWebServer
-
- All Implemented Interfaces:
AutoCloseable
public class TestWebServer extends Object implements AutoCloseable
Simple Web server for easily testingServlet
s. This is a simplified version of org.opendaylight.aaa.web.jetty.JettyWebServer, and useful for web tests in infrautils. Other projects than infrautils are free to use this for their tests as well, but may prefer to use the full JettyWebServer instead.- Author:
- Michael Vorburger.ch
-
-
Constructor Summary
Constructors Constructor Description TestWebServer()
TestWebServer(String host, int httpPort, String testContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
String
getTestContextURL()
void
registerServlet(javax.servlet.Servlet servlet, String urlPattern)
-
-
-
Method Detail
-
close
public void close() throws javax.servlet.ServletException
- Specified by:
close
in interfaceAutoCloseable
- Throws:
javax.servlet.ServletException
-
getTestContextURL
public String getTestContextURL()
-
registerServlet
public void registerServlet(javax.servlet.Servlet servlet, String urlPattern) throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
-
-