public class TestServer extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TestServer.TestAsyncServlet
Use a servlet class to capture requests from the secure client.
|
(package private) class |
TestServer.WaitTask
Thread class for delaying until a servlet request has been made
|
| Constructor and Description |
|---|
TestServer(String host,
int port,
String jks_path,
String jks_password) |
| Modifier and Type | Method and Description |
|---|---|
int |
getPort()
Return the port the server is currently using.
|
RequestRepresenter |
getRequests(String path)
Retrieve the HTTP Servlet Request objects for a registered path
|
void |
registerHandler(String path,
ServerOptions serverOptions)
Create a new ServletContextHandler for the given `path`, and create a shared handler block boolean.
|
void |
shutdown()
Shut down the embedded server.
|
void |
unregisterHandler(String path)
Iterate through the registered ServletContextHandler instances on this server for the first one to
have a mapping matching `path`, and if found then that ServletContextHandler is removed.
|
void |
waitForRequest(String path)
Block the thread until a request is received, or the
timeout is hit.
|
public TestServer(String host, int port, String jks_path, String jks_password) throws Exception
host - String of host interface to bindport - Integer of port to bindjks_path - Path to the Java KeyStorejks_password - Password to unlock the KeyStoreException - for any errors starting the embedded Jetty serverpublic int getPort()
public RequestRepresenter getRequests(String path)
path - String of the path to retrieve from the stored Handlerspublic void registerHandler(String path, ServerOptions serverOptions) throws Exception
path - HTTP path to dynamically add to the embedded serverserverOptions - ServerOptions Object with options for the type of OWS to emulate, will
determine which capabilities document will be presented to the clientException - Exception if context could not be startedpublic void shutdown()
throws Exception
Exception - for any errors shutting down the embedded serverpublic void unregisterHandler(String path) throws org.opengis.cite.servlet.ServletException
path - HTTP path to dynamically remove from the embedded serverorg.opengis.cite.servlet.ServletException - For any errors removing a servlet context handlerpublic void waitForRequest(String path) throws InterruptedException, ExecutionException
path - The unique code associated with the thread created to wait for the servlet activationInterruptedException - For any errors caused by the waiting thread being interruptedExecutionException - For any errors caused by the waiting thread having an exceptionCopyright © 2021 Open Geospatial Consortium. All rights reserved.