Interface ForkedProcessTimeoutContext


public interface ForkedProcessTimeoutContext
Information about a forked Surefire test JVM that has reached its configured timeout, passed to ForkedProcessTimeoutExtension callbacks.
Since:
3.6.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Logger that extensions should use for diagnostic output to the Maven console.
    default Map<String,String>
    User-supplied extension configuration, as provided by the forkedProcessTimeoutExtensionContext Mojo parameter.
    int
    The fork channel id (1-based) assigned by Surefire to this forked JVM.
    The java executable used to launch the forked JVM, or null when it cannot be determined.
    long
    The operating-system PID of the forked JVM, or -1 when the PID cannot be determined (for instance on Java 8 where the ProcessHandle API is unavailable).
    The Surefire reports directory configured for the current run.
    int
    The configured forkedProcessTimeoutInSeconds.
  • Method Details

    • getPid

      long getPid()
      The operating-system PID of the forked JVM, or -1 when the PID cannot be determined (for instance on Java 8 where the ProcessHandle API is unavailable).
      Returns:
      the forked process PID, or -1 if unknown
    • getForkNumber

      int getForkNumber()
      The fork channel id (1-based) assigned by Surefire to this forked JVM.
      Returns:
      the fork number
    • getJavaExecutable

      File getJavaExecutable()
      The java executable used to launch the forked JVM, or null when it cannot be determined.
      Returns:
      the java executable used by the fork, or null
    • getReportsDirectory

      File getReportsDirectory()
      The Surefire reports directory configured for the current run. Extensions may use this directory to write diagnostic output (thread dumps, etc.).
      Returns:
      the reports directory; never null
    • getTimeoutSeconds

      int getTimeoutSeconds()
      The configured forkedProcessTimeoutInSeconds.
      Returns:
      the configured timeout in seconds (always greater than 0)
    • getConsoleLogger

      ConsoleLogger getConsoleLogger()
      Logger that extensions should use for diagnostic output to the Maven console.
      Returns:
      the console logger; never null
    • getExtensionContext

      default Map<String,String> getExtensionContext()
      User-supplied extension configuration, as provided by the forkedProcessTimeoutExtensionContext Mojo parameter. Extensions may read implementation-specific keys from this map (for instance the built-in jstack extension reads jstack.output.location).

      The map is never null but may be empty. Implementations should treat it as read-only.

      Returns:
      user-supplied extension configuration; never null