Class SurefireHelper


  • public final class SurefireHelper
    extends Object
    Helper class for surefire plugins
    • Field Detail

      • DUMP_FILE_PREFIX

        public static final String DUMP_FILE_PREFIX
      • DUMP_FILENAME_FORMATTER

        public static final String DUMP_FILENAME_FORMATTER
      • DUMPSTREAM_FILENAME_FORMATTER

        public static final String DUMPSTREAM_FILENAME_FORMATTER
      • DUMPSTREAM_FILENAME

        public static final String DUMPSTREAM_FILENAME
      • DUMP_FILENAME

        public static final String DUMP_FILENAME
      • EVENTS_BINARY_DUMP_FILENAME_FORMATTER

        public static final String EVENTS_BINARY_DUMP_FILENAME_FORMATTER
    • Method Detail

      • replaceThreadNumberPlaceholders

        @Nonnull
        public static String replaceThreadNumberPlaceholders​(@Nonnull
                                                             String argLine,
                                                             int threadNumber)
      • replaceForkThreadsInPath

        public static File replaceForkThreadsInPath​(File path,
                                                    int replacement)
      • getDumpFilesToPrint

        public static String[] 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
      • escapeToPlatformPath

        public static String escapeToPlatformPath​(String path)
        Escape file path for Windows when the path is too long; otherwise returns path.
        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