Interface ForkedProcessTimeoutContext
-
public interface ForkedProcessTimeoutContextInformation about a forked Surefire test JVM that has reached its configured timeout, passed toForkedProcessTimeoutExtensioncallbacks.- Since:
- 3.6.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description org.apache.maven.plugin.surefire.log.api.ConsoleLoggergetConsoleLogger()Logger that extensions should use for diagnostic output to the Maven console.default java.util.Map<java.lang.String,java.lang.String>getExtensionContext()User-supplied extension configuration, as provided by theforkedProcessTimeoutExtensionContextMojo parameter.intgetForkNumber()The fork channel id (1-based) assigned by Surefire to this forked JVM.java.io.FilegetJavaExecutable()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).java.io.FilegetReportsDirectory()The Surefire reports directory configured for the current run.intgetTimeoutSeconds()The configuredforkedProcessTimeoutInSeconds.
-
-
-
Method Detail
-
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
java.io.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
java.io.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
org.apache.maven.plugin.surefire.log.api.ConsoleLogger getConsoleLogger()
Logger that extensions should use for diagnostic output to the Maven console.- Returns:
- the console logger; never
null
-
getExtensionContext
default java.util.Map<java.lang.String,java.lang.String> 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
-
-