Class LauncherUtil

java.lang.Object
io.quarkus.test.common.LauncherUtil

public final class LauncherUtil extends Object
  • Field Details

  • Method Details

    • generateTestUrl

      static String generateTestUrl()
      Generates the value of test.url to pass as an argument to integration tests launchers.

      Ideally, we shouldn't be using the configuration system to discover the url. We are keeping this for compatibility reasons, and it should be reworked with #45915.

      Returns:
      a String with the test.url value to be evaluated by the running Quarkus Config instance.
    • launchProcessAndDrainIO

      static Process launchProcessAndDrainIO(List<String> args, Map<String,String> env) throws IOException
      Launches a process using the supplied arguments and makes sure the process's output is drained to standard out

      Implementation detail: Avoid using ProcessBuilder's redirect here because it causes problems with Maven Failsafe as can be seen in here

      Throws:
      IOException
    • launchProcess

      static Process launchProcess(List<String> args, Map<String,String> env) throws IOException
      Launches a process using the supplied arguments but does not drain the IO
      Throws:
      IOException
    • waitForCapturedListeningData

      static Optional<ListeningAddress> waitForCapturedListeningData(Process quarkusProcess, Path logFile, long waitTimeSeconds)
      Waits (for a maximum of seconds) until the launched process indicates the address it is listening on. If the wait time is exceeded an IllegalStateException is thrown.
    • destroyProcess

      static void destroyProcess(Process quarkusProcess)
      Try to destroy the process normally a few times and resort to forceful destruction if necessary
    • destroyProcess

      static void destroyProcess(ProcessHandle quarkusProcess)
    • destroyProcess

      static void destroyProcess(Process process, boolean children)
    • createStartedFunction

    • waitForStartedFunction

      static IntegrationTestStartedNotifier.Result waitForStartedFunction(Function<IntegrationTestStartedNotifier.Context,IntegrationTestStartedNotifier.Result> startedFunction, Process quarkusProcess, long waitTimeSeconds, Path logFile)
      Waits for to indicate that the application has started.
      Returns:
      the IntegrationTestStartedNotifier.Result indicating a successful start
      Throws:
      RuntimeException - if no successful start was indicated by
    • toStdOut

      static void toStdOut(Path log)