Package org.apache.maven.surefire.testng
Class TestNGExecutor
- java.lang.Object
-
- org.apache.maven.surefire.testng.TestNGExecutor
-
final class TestNGExecutor extends java.lang.Object
Contains utility methods for executing TestNG.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
TestNGExecutor.SuiteAndNamedTests
private static class
TestNGExecutor.TestMetadata
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
DEFAULT_SUREFIRE_SUITE_NAME
The default name for a suite launched from the maven surefire pluginprivate static java.lang.String
DEFAULT_SUREFIRE_TEST_NAME
The default name for a test launched from the maven surefire pluginprivate static boolean
HAS_TEST_ANNOTATION_ON_CLASSPATH
-
Constructor Summary
Constructors Modifier Constructor Description private
TestNGExecutor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
addSelector(org.testng.xml.XmlTest xmlTest, org.testng.xml.XmlMethodSelector selector)
private static org.testng.xml.XmlMethodSelector
createGroupMatchingSelector(java.util.Map<java.lang.String,java.lang.String> options)
private static org.testng.xml.XmlMethodSelector
createMethodNameFilteringSelector(TestListResolver methodFilter)
private static Stoppable
createStoppable(RunListener reportManager, int skipAfterFailureCount)
private static TestNGReporter
createTestNGReporter(RunListener reportManager)
private static int
extractVerboseLevel(java.util.Map<java.lang.String,java.lang.String> options)
private static <T extends java.lang.annotation.Annotation>
TfindAnnotation(java.lang.Class<?> clazz, java.lang.Class<T> annotationType)
private static TestNGExecutor.TestMetadata
findTestMetadata(java.lang.Class<?> testClass)
private static Configurator
getConfigurator(java.lang.String className)
private static boolean
isCliDebugOrShowErrors(java.util.List<CommandLineOption> mainCliOptions)
private static void
postConfigure(org.testng.TestNG testNG, java.lang.String sourcePath, RunListener reportManager, java.io.File reportsDirectory, int skipAfterFailureCount, int verboseLevel)
(package private) static void
run(java.lang.Iterable<java.lang.Class<?>> testClasses, java.lang.String testSourceDirectory, java.util.Map<java.lang.String,java.lang.String> options, RunListener reportManager, java.io.File reportsDirectory, TestListResolver methodFilter, java.util.List<CommandLineOption> mainCliOptions, int skipAfterFailureCount)
(package private) 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)
-
-
-
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
-
-
Method Detail
-
run
static void run(java.lang.Iterable<java.lang.Class<?>> testClasses, java.lang.String testSourceDirectory, java.util.Map<java.lang.String,java.lang.String> options, RunListener reportManager, java.io.File reportsDirectory, TestListResolver methodFilter, java.util.List<CommandLineOption> mainCliOptions, int skipAfterFailureCount) throws TestSetFailedException
- Throws:
TestSetFailedException
-
isCliDebugOrShowErrors
private static boolean isCliDebugOrShowErrors(java.util.List<CommandLineOption> mainCliOptions)
-
findTestMetadata
private static TestNGExecutor.TestMetadata findTestMetadata(java.lang.Class<?> testClass)
-
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)
-
createMethodNameFilteringSelector
private static org.testng.xml.XmlMethodSelector createMethodNameFilteringSelector(TestListResolver methodFilter) throws TestSetFailedException
- Throws:
TestSetFailedException
-
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)
-
createTestNGReporter
private static TestNGReporter createTestNGReporter(RunListener reportManager)
-
extractVerboseLevel
private static int extractVerboseLevel(java.util.Map<java.lang.String,java.lang.String> options) throws TestSetFailedException
- Throws:
TestSetFailedException
-
-