Class TestNGExecutor


  • final class TestNGExecutor
    extends java.lang.Object
    Contains utility methods for executing TestNG.
    • Field Detail

      • DEFAULT_SUREFIRE_SUITE_NAME

        private static final java.lang.String DEFAULT_SUREFIRE_SUITE_NAME
        The default name for a suite launched from the maven surefire plugin
        See Also:
        Constant Field Values
      • DEFAULT_SUREFIRE_TEST_NAME

        private static final java.lang.String DEFAULT_SUREFIRE_TEST_NAME
        The default name for a test launched from the maven surefire plugin
        See Also:
        Constant Field Values
      • HAS_TEST_ANNOTATION_ON_CLASSPATH

        private static final boolean HAS_TEST_ANNOTATION_ON_CLASSPATH
    • Constructor Detail

      • TestNGExecutor

        private TestNGExecutor()
    • Method Detail

      • isCliDebugOrShowErrors

        private static boolean isCliDebugOrShowErrors​(java.util.List<CommandLineOption> mainCliOptions)
      • findAnnotation

        private static <T extends java.lang.annotation.Annotation> T findAnnotation​(java.lang.Class<?> clazz,
                                                                                    java.lang.Class<T> annotationType)
      • addSelector

        private static void addSelector​(org.testng.xml.XmlTest xmlTest,
                                        org.testng.xml.XmlMethodSelector selector)
      • createGroupMatchingSelector

        private static org.testng.xml.XmlMethodSelector createGroupMatchingSelector​(java.util.Map<java.lang.String,​java.lang.String> options)
                                                                             throws TestSetFailedException
        Throws:
        TestSetFailedException
      • run

        static void run​(java.util.List<java.lang.String> suiteFiles,
                        java.lang.String testSourceDirectory,
                        java.util.Map<java.lang.String,​java.lang.String> options,
                        RunListener reportManager,
                        java.io.File reportsDirectory,
                        int skipAfterFailureCount)
                 throws TestSetFailedException
        Throws:
        TestSetFailedException
      • getConfigurator

        private static Configurator getConfigurator​(java.lang.String className)
      • postConfigure

        private static void postConfigure​(org.testng.TestNG testNG,
                                          java.lang.String sourcePath,
                                          RunListener reportManager,
                                          java.io.File reportsDirectory,
                                          int skipAfterFailureCount,
                                          int verboseLevel)
      • createStoppable

        private static Stoppable createStoppable​(RunListener reportManager,
                                                 int skipAfterFailureCount)