code: public static void waitForStandalone(final Process process, final ModelControllerClient client, final long startupTimeout)
              throws InterruptedException, RuntimeException, TimeoutException {
          Assert.checkNotNullParam("client", client);
          long timeout = startupTimeout * 1000;
          final long sleep = 100L;
          while (timeout > 0) {
              long before = System.currentTimeMillis();
              if (isStandaloneRunning(client))
                  break;
              timeout -= (System.currentTimeMillis() - before);
              if (process != null && !process.isAlive()) {
                  throw new RuntimeException(String.format("The process has unexpectedly exited with code %d", process.exitValue()));
              }
              TimeUnit.MILLISECONDS.sleep(sleep);
              timeout -= sleep;
          }
          if (timeout <= 0) {
              if (process != null) {
                  process.destroy();
              }
              throw new TimeoutException(String.format("The server did not start within %s seconds.", startupTimeout));
          }
      }
docs: Waits the given amount of time in seconds for a standalone server to start.
  <p>
  If the {@code process} is not {@code null} and a timeout occurs the process will be
  {@linkplain Process#destroy() destroyed}.
  </p>
  
  @param process        the Java process can be {@code null} if no process is available
  @param client         the client used to communicate with the server
  @param startupTimeout the time, in seconds, to wait for the server start
  
  @throws InterruptedException if interrupted while waiting for the server to start
  @throws RuntimeException     if the process has died
  @throws TimeoutException     if the timeout has been reached and the server is still not started