Package org.apache.maven.plugin.surefire
Class SurefireHelper
java.lang.Object
org.apache.maven.plugin.surefire.SurefireHelper
Helper class for surefire plugins
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
static final String
static final String
static final String
private static final String[]
static final String
static final String
static final String
private static final String
The placeholder that is replaced by the executing fork's running number.private static final int
The maximum path that does not require long path prefix on Windows.
Seesun/nio/fs/WindowsPath
in OpenJDK and MSDN article.private static final String
The placeholder that is replaced by the executing thread's running number. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<CommandLineOption>
commandLineOptions
(org.apache.maven.execution.MavenSession session, PluginConsoleLogger log) private static String
createErrorMessage
(SurefireReportParameters reportParameters, RunResult result, Exception firstForkException) static String
escapeToPlatformPath
(String path) Escape file path for Windows when the path is too long; otherwise returnspath
.private static boolean
failIfNoTests
(SurefireReportParameters reportParameters) static String[]
private static boolean
private static boolean
isTooFlaky
(RunResult result, SurefireReportParameters reportParameters) static void
static File
replaceForkThreadsInPath
(File path, int replacement) static String
replaceThreadNumberPlaceholders
(String argLine, int threadNumber) static void
reportExecution
(SurefireReportParameters reportParameters, RunResult result, PluginConsoleLogger log, Exception firstForkException) private static void
throwException
(SurefireReportParameters reportParameters, RunResult result, Exception firstForkException)
-
Field Details
-
DUMP_FILE_DATE
-
DUMP_FILE_PREFIX
-
DUMP_FILENAME_FORMATTER
-
DUMPSTREAM_FILENAME_FORMATTER
-
DUMPSTREAM_FILENAME
-
DUMP_FILENAME
-
EVENTS_BINARY_DUMP_FILENAME_FORMATTER
-
MAX_PATH_LENGTH_WINDOWS
private static final int MAX_PATH_LENGTH_WINDOWSThe maximum path that does not require long path prefix on Windows.
Seesun/nio/fs/WindowsPath
in OpenJDK and MSDN article.
The maximum path is 260 minus 1 (NUL) but for directories it is 260 minus 12 minus 1 (to allow for the creation of a 8.3 file in the directory).- See Also:
-
DUMP_FILES_PRINT
-
THREAD_NUMBER_PLACEHOLDER
The placeholder that is replaced by the executing thread's running number. The thread number range starts with 1 Deprecated.- See Also:
-
FORK_NUMBER_PLACEHOLDER
The placeholder that is replaced by the executing fork's running number. The fork number range starts with 1- See Also:
-
-
Constructor Details
-
SurefireHelper
private SurefireHelper()Do not instantiate.
-
-
Method Details
-
replaceThreadNumberPlaceholders
-
replaceForkThreadsInPath
-
getDumpFilesToPrint
-
reportExecution
public static void reportExecution(SurefireReportParameters reportParameters, RunResult result, PluginConsoleLogger log, Exception firstForkException) throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
-
commandLineOptions
public static List<CommandLineOption> commandLineOptions(org.apache.maven.execution.MavenSession session, PluginConsoleLogger log) -
logDebugOrCliShowErrors
public static void logDebugOrCliShowErrors(String s, PluginConsoleLogger log, Collection<CommandLineOption> cli) -
escapeToPlatformPath
Escape file path for Windows when the path is too long; otherwise returnspath
.
See sun/nio/fs/WindowsPath for "long path" value explanation (=247), and MSDN article for detailed escaping strategy explanation: in short,\\?\
prefix for path with drive letter or\\?\UNC\
for UNC path.- Parameters:
path
- source path- Returns:
- escaped to platform path
-
failIfNoTests
-
isFatal
-
throwException
private static void throwException(SurefireReportParameters reportParameters, RunResult result, Exception firstForkException) throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
-
createErrorMessage
private static String createErrorMessage(SurefireReportParameters reportParameters, RunResult result, Exception firstForkException) -
isTooFlaky
-