in maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java [1759:1807]
private ProviderConfiguration createProviderConfiguration(RunOrderParameters runOrderParameters)
throws MojoExecutionException, MojoFailureException {
final ReporterConfiguration reporterConfiguration =
new ReporterConfiguration(getReportsDirectory(), isTrimStackTrace());
final Artifact testNgArtifact = getTestNgArtifact();
final boolean isTestNg = testNgArtifact != null;
final TestArtifactInfo testNg =
isTestNg ? new TestArtifactInfo(testNgArtifact.getVersion(), testNgArtifact.getClassifier()) : null;
final TestRequest testSuiteDefinition = new TestRequest(
suiteXmlFiles(), getTestSourceDirectory(), getSpecificTests(), getRerunFailingTestsCount());
final boolean actualFailIfNoTests;
DirectoryScannerParameters directoryScannerParameters = null;
if (hasSuiteXmlFiles() && !isSpecificTestSpecified()) {
actualFailIfNoTests = getFailIfNoTests();
if (!isTestNg) {
throw new MojoExecutionException("suiteXmlFiles is configured, but there is no TestNG dependency");
}
} else {
// @todo remove these three params and use DirectoryScannerParameters to pass into DirectoryScanner only
// @todo or remove it in next major version :: 3.0
// @todo remove deprecated methods in ProviderParameters => included|excluded|specificTests not needed here
List<String> actualIncludes = getIncludeList(); // Collections.emptyList(); behaves same
List<String> actualExcludes = getExcludeList(); // Collections.emptyList(); behaves same
// Collections.emptyList(); behaves same
List<String> specificTests = Collections.emptyList();
directoryScannerParameters = new DirectoryScannerParameters(
getTestClassesDirectory(), actualIncludes, actualExcludes, specificTests, getRunOrder());
}
Map<String, String> providerProperties = toStringProperties(getProperties());
return new ProviderConfiguration(
directoryScannerParameters,
runOrderParameters,
reporterConfiguration,
testNg, // Not really used in provider. Limited to de/serializer.
testSuiteDefinition,
providerProperties,
null,
false,
cli,
getSkipAfterFailureCount(),
Shutdown.parameterOf(getShutdown()),
getForkedProcessExitTimeoutInSeconds());
}