Class SurefireHelper


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

      • DUMP_FILE_DATE

        private static final java.lang.String DUMP_FILE_DATE
      • DUMP_FILE_PREFIX

        public static final java.lang.String DUMP_FILE_PREFIX
      • DUMPSTREAM_FILENAME_FORMATTER

        public static final java.lang.String DUMPSTREAM_FILENAME_FORMATTER
      • MAX_PATH_LENGTH_WINDOWS

        private static final int MAX_PATH_LENGTH_WINDOWS
        The maximum path that does not require long path prefix on Windows.
        See sun/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:
        Constant Field Values
      • DUMP_FILES_PRINT

        private static final java.lang.String[] DUMP_FILES_PRINT
    • Constructor Detail

      • SurefireHelper

        private SurefireHelper()
        Do not instantiate.
    • Method Detail

      • getDumpFilesToPrint

        public static java.lang.String[] getDumpFilesToPrint()
      • reportExecution

        public static void reportExecution​(SurefireReportParameters reportParameters,
                                           RunResult result,
                                           PluginConsoleLogger log,
                                           java.lang.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 java.lang.String escapeToPlatformPath​(java.lang.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
      • getFailureBehavior

        private static java.lang.String getFailureBehavior​(org.apache.maven.execution.MavenExecutionRequest request)
                                                    throws java.lang.NoSuchMethodException,
                                                           java.lang.reflect.InvocationTargetException,
                                                           java.lang.IllegalAccessException
        Throws:
        java.lang.NoSuchMethodException
        java.lang.reflect.InvocationTargetException
        java.lang.IllegalAccessException
      • isFatal

        private static boolean isFatal​(java.lang.Exception firstForkException)
      • throwException

        private static void throwException​(SurefireReportParameters reportParameters,
                                           RunResult result,
                                           java.lang.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 java.lang.String createErrorMessage​(SurefireReportParameters reportParameters,
                                                           RunResult result,
                                                           java.lang.Exception firstForkException)