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 TypeMethodDescriptionLogger that extensions should use for diagnostic output to the Maven console.User-supplied extension configuration, as provided by theforkedProcessTimeoutExtensionContextMojo parameter.intThe fork channel id (1-based) assigned by Surefire to this forked JVM.Thejavaexecutable used to launch the forked JVM, ornullwhen it cannot be determined.longgetPid()The operating-system PID of the forked JVM, or-1when the PID cannot be determined (for instance on Java 8 where theProcessHandleAPI is unavailable).The Surefire reports directory configured for the current run.intThe configuredforkedProcessTimeoutInSeconds.
-
Method Details
-
getPid
long getPid()The operating-system PID of the forked JVM, or-1when the PID cannot be determined (for instance on Java 8 where theProcessHandleAPI is unavailable).- Returns:
- the forked process PID, or
-1if unknown
-
getForkNumber
int getForkNumber()The fork channel id (1-based) assigned by Surefire to this forked JVM.- Returns:
- the fork number
-
getJavaExecutable
File getJavaExecutable()Thejavaexecutable used to launch the forked JVM, ornullwhen 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 configuredforkedProcessTimeoutInSeconds.- 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
User-supplied extension configuration, as provided by theforkedProcessTimeoutExtensionContextMojo parameter. Extensions may read implementation-specific keys from this map (for instance the built-in jstack extension readsjstack.output.location).The map is never
nullbut may be empty. Implementations should treat it as read-only.- Returns:
- user-supplied extension configuration; never
null
-