Class TestServer


  • public class TestServer
    extends java.lang.Object
    • Constructor Detail

      • TestServer

        public TestServer()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException
        Throws:
        java.io.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:
        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.
        port - the port to listen on
      • 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