Static Public Member Functions | |
| static void | runWebApp (String resourceBase, int port) throws Exception |
| static Server | startWebApp (String resourceBase, int port) throws Exception |
| static int | boundPort (Server server) |
| Returns the local TCP port the server's first connector is actually listening on. | |
| static void | stopAndJoin (Server server) throws Exception |
| Stops the server and blocks until it has fully terminated, ensuring the listening socket is released before the method returns. | |
| static void | runServlet (String contextPath, int port, Class<? extends Servlet > servlet, Map< String, String > initParams) throws Exception |
| static Server | startServlet (String contextPath, int port, Class<? extends Servlet > servlet, Map< String, String > initParams) throws Exception |
Member Function Documentation
◆ boundPort()
|
static |
Returns the local TCP port the server's first connector is actually listening on.
When the server is started with port 0 the OS assigns a free ephemeral port; tests should read it back via this method rather than assuming a fixed port.
- Parameters
-
server a started Jetty server
- Returns
- the bound local port
◆ stopAndJoin()
|
static |
Stops the server and blocks until it has fully terminated, ensuring the listening socket is released before the method returns.
- Parameters
-
server the server to stop (ignored if null)
