Class TestServer

java.lang.Object
org.openhab.core.test.TestServer

@NonNullByDefault public class TestServer extends Object
Embedded jetty server used in the tests.
Author:
Velin Yordanov - Initial contribution, Henning Treu - provide in base test bundle
  • Constructor Details

    • TestServer

      public TestServer(String host, int port, int timeout, org.eclipse.jetty.servlet.ServletHolder servletHolder)
      Creates a new TestServer. The server is started by startServer() and stopped by stopServer(), preferably in the tests setup and tearDown methods.
      Parameters:
      host - the host this server runs on.
      port - the port this server runs on. Use TestPortUtil to find a random free port.
      timeout - the idle timeout when receiving new messages on a connection in milliseconds.
      servletHolder - a ServletHolder which holds the Servlet content will be served from.
  • Method Details