Class TestServer

java.lang.Object
io.temporal.testserver.TestServer

public class TestServer extends Object
  • Constructor Details

    • TestServer

      public TestServer()
  • Method Details

    • main

      public static void main(String[] args) throws IOException
      Throws:
      IOException
    • createPortBoundServer

      public static TestServer.PortBoundTestServer createPortBoundServer(int port)
      Creates an out-of-process rather than in-process server, and does not set up a client. Useful, for example, if you want to use the test service from other SDKs.
      Parameters:
      port - the port to listen on
    • createPortBoundServer

      public static TestServer.PortBoundTestServer createPortBoundServer(int port, boolean lockTimeSkipping)
      Creates an out-of-process rather than in-process server, and does not set up a client. Useful, for example, if you want to use the test service from other SDKs.
      Parameters:
      port - the port to listen on
      lockTimeSkipping - true if the time skipping should be locked (disabled) by default after creation of the server. To make test server behave like a real one in respect to time, this flag should be true.
    • createServer

      public static TestServer.InProcessTestServer createServer()
      Returns:
      created in-memory service
    • createServer

      public static TestServer.InProcessTestServer createServer(boolean lockTimeSkipping)
      Parameters:
      lockTimeSkipping - true if the time skipping should be locked (disabled) by default after creation of the server. To make test server behave like a real one in respect to time, this flag should be true.
      Returns:
      created in-memory service
    • createServer

      public static TestServer.InProcessTestServer createServer(boolean lockTimeSkipping, long initialTimeMillis)
      Parameters:
      lockTimeSkipping - true if the time skipping should be locked (disabled) by default after creation of the server
      initialTimeMillis - initial timestamp for the test server, System.currentTimeMillis() will be used if 0.
      Returns:
      created in-memory service