You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@creadur.apache.org by cl...@apache.org on 2026/03/07 15:06:28 UTC
(creadur-rat) 01/04: Cleaned up most integration tests
This is an automated email from the ASF dual-hosted git repository.
claude pushed a commit to branch feature/restructure
in repository https://gitbox.apache.org/repos/asf/creadur-rat.git
commit 57b00a81c5b887e642eaf924096271281c7dbc95
Author: Claude Warren <cl...@xenei.com>
AuthorDate: Fri Mar 6 17:57:06 2026 +0000
Cleaned up most integration tests
---
.../org/apache/rat/ReportConfigurationTest.java | 8 +-
.../src/test/java/org/apache/rat/ReporterTest.java | 4 +-
.../testhelpers/data/AbstractTestDataProvider.java | 74 +-
.../org/apache/rat/testhelpers/data/DataUtils.java | 5 +-
.../testhelpers/data/OptionTestDataProvider.java | 6 +-
.../testhelpers/data/ReportTestDataProvider.java | 406 +++--
.../org/apache/rat/testhelpers/data/TestData.java | 18 +
.../plugin/src/it/CustomLicense/pom.xml | 4 +-
.../plugin/src/it/RAT-168/invoker.properties | 2 +-
.../plugin/src/it/RAT-168/verify.groovy | 4 +-
.../plugin/src/it/RAT-314/invoker.properties | 2 +-
.../plugin/src/it/RAT-314/verify.groovy | 4 +-
.../src/it/RAT-469-default/invoker.properties | 2 +-
.../plugin/src/it/RAT-469-default/pom.xml | 3 +
.../plugin/src/it/RAT-469-default/verify.groovy | 4 +-
.../plugin/src/it/RAT-469/invoker.properties | 2 +-
.../plugin/src/it/RAT-469/verify.groovy | 5 +-
.../src/it/{RAT-168 => RAT-508}/invoker.properties | 2 +-
.../plugin}/src/it/RAT-508/pom.xml | 0
.../plugin}/src/it/RAT-508/verify.groovy | 6 +-
.../src/it/{RAT-168 => RAT-524}/invoker.properties | 2 +-
.../plugin}/src/it/RAT-524/pom.xml | 0
.../plugin}/src/it/RAT-524/verify.groovy | 4 +-
.../plugin/src/it/Unapproved1/verify.groovy | 4 +-
.../plugin/src/it/it1/verify.groovy | 2 +-
.../java/org/apache/rat/maven/MavenTestDynIT.java | 241 +++
.../java/org/apache/rat/maven/MavenTestIT.java | 84 -
.../test/java/org/apache/rat/maven/MavenTestX.java | 1684 --------------------
.../org/apache/rat/maven/RatCheckMojoTest.java | 475 ------
.../java/org/apache/rat/maven/RecordingLogger.java | 117 ++
.../apache/rat/maven/RecordingOutputHandler.java | 26 +
.../java/org/apache/rat/maven/PropertyReader.java | 4 +
.../rat/maven/MavenOptionCollectionTest.java | 52 +
.../java/org/apache/rat/maven/MavenOptionTest.java | 4 -
.../org/apache/rat/maven/PropertyReaderTest.java | 4 +
.../src/it/RAT-508/invoker.properties | 16 -
.../src/it/RAT-524/invoker.properties | 16 -
37 files changed, 802 insertions(+), 2494 deletions(-)
diff --git a/apache-rat-core/src/test/java/org/apache/rat/ReportConfigurationTest.java b/apache-rat-core/src/test/java/org/apache/rat/ReportConfigurationTest.java
index db5f5373..585306f7 100644
--- a/apache-rat-core/src/test/java/org/apache/rat/ReportConfigurationTest.java
+++ b/apache-rat-core/src/test/java/org/apache/rat/ReportConfigurationTest.java
@@ -458,7 +458,7 @@ public class ReportConfigurationTest {
assertThat(underTest.getWriter()).isNotNull();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
- underTest.setOut(() -> stream);
+ underTest.setOut(new ReportConfiguration.IODescriptor<>("outputTest", () -> stream));
assertThat(underTest.getOutput().get()).isEqualTo(stream);
PrintWriter writer = underTest.getWriter().get();
assertThat(writer).isNotNull();
@@ -482,9 +482,9 @@ public class ReportConfigurationTest {
URL url = this.getClass().getResource("ReportConfigurationTestFile");
assertThat(url).isNotNull();
- assertThat(underTest.getStyleSheet()).isNull();
+ assertThat(underTest.getStyleSheetDescriptor()).isNull();
InputStream stream = mock(InputStream.class);
- underTest.setStyleSheet(() -> stream);
+ underTest.setStyleSheet(new ReportConfiguration.IODescriptor<>("stylesheetTest", () -> stream));
assertThat(underTest.getStyleSheet().get()).isEqualTo(stream);
File file = mock(File.class);
@@ -547,7 +547,7 @@ public class ReportConfigurationTest {
public void testSetOut() throws IOException {
ReportConfiguration config = new ReportConfiguration();
try (OutputStreamInterceptor osi = new OutputStreamInterceptor()) {
- config.setOut(() -> osi);
+ config.setOut(new ReportConfiguration.IODescriptor<>("testSetOut", () -> osi));
assertThat(osi.closeCount).isEqualTo(0);
try (OutputStream os = config.getOutput().get()) {
assertThat(os).isNotNull();
diff --git a/apache-rat-core/src/test/java/org/apache/rat/ReporterTest.java b/apache-rat-core/src/test/java/org/apache/rat/ReporterTest.java
index e057c81c..76ed7fa8 100644
--- a/apache-rat-core/src/test/java/org/apache/rat/ReporterTest.java
+++ b/apache-rat-core/src/test/java/org/apache/rat/ReporterTest.java
@@ -466,7 +466,7 @@ public class ReporterTest {
"Generated at: ";
ByteArrayOutputStream out = new ByteArrayOutputStream();
ReportConfiguration configuration = initializeConfiguration();
- configuration.setOut(() -> out);
+ configuration.setOut(new ReportConfiguration.IODescriptor<>("plainReportTest", () -> out));
new Reporter(configuration).execute().format(configuration);
String document = out.toString();
@@ -481,7 +481,7 @@ public class ReporterTest {
public void unapprovedLicensesReportTest() throws Exception {
ByteArrayOutputStream out = new ByteArrayOutputStream();
ReportConfiguration configuration = initializeConfiguration();
- configuration.setOut(() -> out);
+ configuration.setOut(new ReportConfiguration.IODescriptor<>("unapprovedLicensesReportTest", () -> out));
configuration.setStyleSheet(this.getClass().getResource("/org/apache/rat/unapproved-licenses.xsl"));
new Reporter(configuration).execute().format(configuration);
diff --git a/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/AbstractTestDataProvider.java b/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/AbstractTestDataProvider.java
index 8511805b..94b23a35 100644
--- a/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/AbstractTestDataProvider.java
+++ b/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/AbstractTestDataProvider.java
@@ -20,16 +20,20 @@ package org.apache.rat.testhelpers.data;
import com.google.common.collect.ImmutableList;
+import java.util.ArrayList;
import java.util.HashSet;
+import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
+import java.util.stream.Stream;
import org.apache.commons.cli.Option;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.rat.OptionCollectionParser;
import org.apache.rat.commandline.Arg;
import org.apache.rat.ui.AbstractOptionCollection;
+import org.apache.rat.ui.ArgumentTracker;
import org.apache.rat.utils.DefaultLog;
/**
@@ -69,43 +73,45 @@ public abstract class AbstractTestDataProvider {
*/
public final Set<TestData> getOptionTests(final AbstractOptionCollection<?> optionCollection) {
// the optionCollection establishes any changes to the Arg values.
+ List<Option> unsupportedOptions = new ArrayList<>(optionCollection.getUnsupportedOptions().getOptions());
Set<TestData> result = new TreeSet<>();
for (Arg arg : Arg.values()) {
if (!arg.isEmpty()) {
+ Stream<Option> options = arg.group().getOptions().stream().filter(opt -> !unsupportedOptions.contains(opt));
switch (arg) {
- case CONFIGURATION -> arg.group().getOptions().forEach(opt -> configTest(result, opt));
- case CONFIGURATION_NO_DEFAULTS -> arg.group().getOptions().forEach(opt -> configurationNoDefaultsTest(result, opt));
- case COUNTER_MIN -> arg.group().getOptions().forEach(opt -> counterMinTest(result, opt));
- case COUNTER_MAX -> arg.group().getOptions().forEach(opt -> counterMaxTest(result, opt));
- case DRY_RUN -> arg.group().getOptions().forEach(opt -> dryRunTest(result, opt));
- case EDIT_COPYRIGHT -> arg.group().getOptions().forEach(opt -> editCopyrightTest(result, opt));
- case EDIT_ADD -> arg.group().getOptions().forEach(opt -> editLicenseTest(result, opt));
- case EDIT_OVERWRITE -> arg.group().getOptions().forEach(opt -> editOverwriteTest(result, opt));
- case HELP_LICENSES -> arg.group().getOptions().forEach(opt -> helpLicenses(result, opt));
- case EXCLUDE -> arg.group().getOptions().forEach(opt -> inputExcludeTest(result, opt));
- case EXCLUDE_FILE -> arg.group().getOptions().forEach(opt -> inputExcludeFileTest(result, opt));
- case EXCLUDE_PARSE_SCM -> arg.group().getOptions().forEach(opt -> inputExcludeParsedScmTest(result, opt));
- case EXCLUDE_STD -> arg.group().getOptions().forEach(opt -> inputExcludeStdTest(result, opt));
- case EXCLUDE_SIZE -> arg.group().getOptions().forEach(opt -> inputExcludeSizeTest(result, opt));
- case INCLUDE -> arg.group().getOptions().forEach(opt -> inputIncludeTest(result, opt));
- case INCLUDE_FILE -> arg.group().getOptions().forEach(opt -> inputIncludeFileTest(result, opt));
- case INCLUDE_STD -> arg.group().getOptions().forEach(opt -> inputIncludeStdTest(result, opt));
- case SOURCE -> arg.group().getOptions().forEach(opt -> inputSourceTest(result, opt));
- case FAMILIES_APPROVED -> arg.group().getOptions().forEach(opt -> licenseFamiliesApprovedTest(result, opt));
- case FAMILIES_APPROVED_FILE -> arg.group().getOptions().forEach(opt -> licenseFamiliesApprovedFileTest(result, opt));
- case FAMILIES_DENIED -> arg.group().getOptions().forEach(opt -> licenseFamiliesDeniedTest(result, opt));
- case FAMILIES_DENIED_FILE -> arg.group().getOptions().forEach(opt -> licenseFamiliesDeniedFileTest(result, opt));
- case LICENSES_APPROVED -> arg.group().getOptions().forEach(opt -> licensesApprovedTest(result, opt));
- case LICENSES_APPROVED_FILE -> arg.group().getOptions().forEach(opt -> licensesApprovedFileTest(result, opt));
- case LICENSES_DENIED -> arg.group().getOptions().forEach(opt -> licensesDeniedTest(result, opt));
- case LICENSES_DENIED_FILE -> arg.group().getOptions().forEach(opt -> licensesDeniedFileTest(result, opt));
- case LOG_LEVEL -> arg.group().getOptions().forEach(opt -> logLevelTest(result, opt));
- case OUTPUT_ARCHIVE -> arg.group().getOptions().forEach(opt -> outputArchiveTest(result, opt));
- case OUTPUT_FAMILIES -> arg.group().getOptions().forEach(opt -> outputFamiliesTest(result, opt));
- case OUTPUT_FILE -> arg.group().getOptions().forEach(opt -> outputFileTest(result, opt));
- case OUTPUT_LICENSES -> arg.group().getOptions().forEach(opt -> outputLicensesTest(result, opt));
- case OUTPUT_STANDARD -> arg.group().getOptions().forEach(opt -> outputStandardTest(result, opt));
- case OUTPUT_STYLE -> arg.group().getOptions().forEach(opt -> outputStyleTest(result, opt));
+ case CONFIGURATION -> options.forEach(opt -> configTest(result, opt));
+ case CONFIGURATION_NO_DEFAULTS -> options.forEach(opt -> configurationNoDefaultsTest(result, opt));
+ case COUNTER_MIN -> options.forEach(opt -> counterMinTest(result, opt));
+ case COUNTER_MAX -> options.forEach(opt -> counterMaxTest(result, opt));
+ case DRY_RUN -> options.forEach(opt -> dryRunTest(result, opt));
+ case EDIT_COPYRIGHT -> options.forEach(opt -> editCopyrightTest(result, opt));
+ case EDIT_ADD -> options.forEach(opt -> editLicenseTest(result, opt));
+ case EDIT_OVERWRITE -> options.forEach(opt -> editOverwriteTest(result, opt));
+ case HELP_LICENSES -> options.forEach(opt -> helpLicenses(result, opt));
+ case EXCLUDE -> options.forEach(opt -> inputExcludeTest(result, opt));
+ case EXCLUDE_FILE -> options.forEach(opt -> inputExcludeFileTest(result, opt));
+ case EXCLUDE_PARSE_SCM -> options.forEach(opt -> inputExcludeParsedScmTest(result, opt));
+ case EXCLUDE_STD -> options.forEach(opt -> inputExcludeStdTest(result, opt));
+ case EXCLUDE_SIZE -> options.forEach(opt -> inputExcludeSizeTest(result, opt));
+ case INCLUDE -> options.forEach(opt -> inputIncludeTest(result, opt));
+ case INCLUDE_FILE -> options.forEach(opt -> inputIncludeFileTest(result, opt));
+ case INCLUDE_STD -> options.forEach(opt -> inputIncludeStdTest(result, opt));
+ case SOURCE -> options.forEach(opt -> inputSourceTest(result, opt));
+ case FAMILIES_APPROVED -> options.forEach(opt -> licenseFamiliesApprovedTest(result, opt));
+ case FAMILIES_APPROVED_FILE -> options.forEach(opt -> licenseFamiliesApprovedFileTest(result, opt));
+ case FAMILIES_DENIED -> options.forEach(opt -> licenseFamiliesDeniedTest(result, opt));
+ case FAMILIES_DENIED_FILE -> options.forEach(opt -> licenseFamiliesDeniedFileTest(result, opt));
+ case LICENSES_APPROVED -> options.forEach(opt -> licensesApprovedTest(result, opt));
+ case LICENSES_APPROVED_FILE -> options.forEach(opt -> licensesApprovedFileTest(result, opt));
+ case LICENSES_DENIED -> options.forEach(opt -> licensesDeniedTest(result, opt));
+ case LICENSES_DENIED_FILE -> options.forEach(opt -> licensesDeniedFileTest(result, opt));
+ case LOG_LEVEL -> options.forEach(opt -> logLevelTest(result, opt));
+ case OUTPUT_ARCHIVE -> options.forEach(opt -> outputArchiveTest(result, opt));
+ case OUTPUT_FAMILIES -> options.forEach(opt -> outputFamiliesTest(result, opt));
+ case OUTPUT_FILE -> options.forEach(opt -> outputFileTest(result, opt));
+ case OUTPUT_LICENSES -> options.forEach(opt -> outputLicensesTest(result, opt));
+ case OUTPUT_STANDARD -> options.forEach(opt -> outputStandardTest(result, opt));
+ case OUTPUT_STYLE -> options.forEach(opt -> outputStyleTest(result, opt));
}
}
}
@@ -117,7 +123,7 @@ public abstract class AbstractTestDataProvider {
Set<Option> options = new HashSet<>(Arg.getOptions().getOptions());
result.forEach(testData -> options.remove(testData.getOption()));
// TODO fix this once deprecated options are removed
- options.forEach(opt -> DefaultLog.getInstance().warn("Option " + opt.getKey() + " was not tested."));
+ options.forEach(opt -> DefaultLog.getInstance().warn("Option " + ArgumentTracker.extractKey(opt) + " was not tested."));
//assertThat(options).describedAs("All options are not accounted for.").isEmpty();
}
diff --git a/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/DataUtils.java b/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/DataUtils.java
index 63eee64b..11ad8ec8 100644
--- a/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/DataUtils.java
+++ b/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/DataUtils.java
@@ -28,6 +28,7 @@ import java.util.function.Consumer;
import org.apache.commons.cli.Option;
import org.apache.rat.report.xml.writer.XmlWriter;
import org.apache.rat.utils.CasedString;
+import org.apache.rat.utils.DefaultLog;
public class DataUtils {
/**
@@ -58,7 +59,9 @@ public class DataUtils {
/**
* A setup that does nothing.
*/
- public static final Consumer<Path> NO_SETUP = basePath -> {};
+ public static final Consumer<Path> NO_SETUP = basePath -> {
+ DefaultLog.getInstance().warn("no setup for " + basePath);
+ };
public static final Consumer<ValidatorData> NO_VALIDATOR = validatorData -> {};
diff --git a/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/OptionTestDataProvider.java b/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/OptionTestDataProvider.java
index 8c0144dd..d30da3ca 100644
--- a/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/OptionTestDataProvider.java
+++ b/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/OptionTestDataProvider.java
@@ -643,7 +643,7 @@ setup,
result.add(new TestData("", Collections.singletonList(ImmutablePair.of(option, null)),
DataUtils.NO_SETUP,
validatorData -> {
- try (InputStream expected = StyleSheets.XML.getStyleSheet().get();
+ try (InputStream expected = StyleSheets.XML.getStyleSheet().ioSupplier().get();
InputStream actual = validatorData.getConfiguration().getStyleSheet().get()) {
assertThat(IOUtils.contentEquals(expected, actual)).as(() -> String.format("'%s' does not match", StyleSheets.XML)).isTrue();
} catch (IOException e) {
@@ -655,7 +655,7 @@ setup,
result.add(new TestData(sheet.name(), Collections.singletonList(ImmutablePair.of(option, new String[]{sheet.arg()})),
DataUtils.NO_SETUP,
validatorData -> {
- try (InputStream expected = sheet.getStyleSheet().get();
+ try (InputStream expected = sheet.getStyleSheet().ioSupplier().get();
InputStream actual = validatorData.getConfiguration().getStyleSheet().get()) {
assertThat(IOUtils.contentEquals(expected, actual)).as(() -> String.format("'%s' does not match", sheet)).isTrue();
} catch (IOException e) {
@@ -686,7 +686,7 @@ setup,
},
validatorData -> {
- try (InputStream expected = StyleSheets.getStyleSheet("fileStyleSheet.xslt", validatorData.getBaseName()).get();
+ try (InputStream expected = StyleSheets.getStyleSheet("fileStyleSheet.xslt", validatorData.getBaseName()).ioSupplier().get();
InputStream actual = validatorData.getConfiguration().getStyleSheet().get()) {
assertThat(IOUtils.contentEquals(expected, actual)).as(() -> "'fileStyleSheet.xslt' does not match").isTrue();
} catch (IOException e) {
diff --git a/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/ReportTestDataProvider.java b/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/ReportTestDataProvider.java
index bd2e88ae..399ed50d 100644
--- a/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/ReportTestDataProvider.java
+++ b/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/ReportTestDataProvider.java
@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance *
* with the License. You may obtain a copy of the License at *
* *
- * http://www.apache.org/licenses/LICENSE-2.0 *
+ * https://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, *
* software distributed under the License is distributed on an *
@@ -80,6 +80,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
private final XPath xpath = XPathFactory.newInstance().newXPath();
private final Consumer<Path> mkRat = basePath -> {
+ DefaultLog.getInstance().warn("mkRat setup for " + basePath);
File baseDir = basePath.toFile();
File ratDir = new File(baseDir, ".rat");
FileUtils.mkDir(ratDir);
@@ -102,10 +103,15 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
throw new RuntimeException(e);
}
}
+
+ private void assertCounter(ValidatorData data, ClaimStatistic.Counter counter, int count) {
+ assertThat(data.getStatistic().getCounter(counter)).as(counter.name()).isEqualTo(count);
+ }
// exclude tests
private List<TestData> execExcludeTest(final Option option, final Supplier<String[]> args, Consumer<Path> setupFiles) {
Consumer<Path> setup = setupFiles.andThen(mkRat).andThen(basePath -> {
+ DefaultLog.getInstance().warn("execExcludeTest setup for " + basePath);
File baseDir = basePath.toFile();
writeFile(baseDir, "notbaz");
writeFile(baseDir, "well._afile");
@@ -117,9 +123,9 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
TestData test1 = new TestData(DataUtils.asDirName(option), NO_OPTIONS,
setup,
validatorData -> {
- ClaimStatistic claimStatistic = validatorData.getStatistic();
- assertThat(claimStatistic.getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(5);
- assertThat(claimStatistic.getCounter(ClaimStatistic.Counter.IGNORED)).isEqualTo(1);
+ DefaultLog.getInstance().warn("validating execExcludeTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 5);
+ assertCounter(validatorData, ClaimStatistic.Counter.IGNORED, 1);
});
String[] ignored = {"B.bar", "justbaz", "some.foo", ".rat"};
@@ -127,9 +133,10 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
TestData test2 = new TestData("", Collections.singletonList(ImmutablePair.of(option, args.get())),
setup,
validatorData -> {
+ DefaultLog.getInstance().warn("validating execExcludeTest for " + validatorData.getBaseDir());
ClaimStatistic claimStatistic = validatorData.getStatistic();
- assertThat(claimStatistic.getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(standard.length);
- assertThat(claimStatistic.getCounter(ClaimStatistic.Counter.IGNORED)).isEqualTo(ignored.length);
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, standard.length);
+ assertCounter(validatorData, ClaimStatistic.Counter.IGNORED, ignored.length);
for (String fileName : ignored) {
assertIgnoredFile(validatorData.getDocument(), fileName);
}
@@ -151,7 +158,8 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
protected void inputExcludeTest(final Set<TestData> result, final Option option) {
- result.addAll(execExcludeTest(option, () -> AbstractTestDataProvider.EXCLUDE_ARGS, x -> {}));
+ result.addAll(execExcludeTest(option, () -> AbstractTestDataProvider.EXCLUDE_ARGS, x -> {
+ }));
}
protected void inputExcludeStdTest(final Set<TestData> result, final Option option) {
@@ -160,6 +168,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
String[] defaultIncluded = {"afile~more", "what.#afile", "%afile%withMore", "well._afile"};
String mavenFile = "build.log";
Consumer<Path> setup = basePath -> {
+ DefaultLog.getInstance().warn("inputExcludeStdTest setup for " + basePath);
File baseDir = basePath.toFile();
for (String fileName : defaultExcluded) {
writeFile(baseDir, fileName);
@@ -172,23 +181,24 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
result.add(new TestData(DataUtils.asDirName(option), Collections.singletonList(ImmutablePair.nullPair()),
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(defaultIncluded.length + 1);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.IGNORED)).isEqualTo(defaultExcluded.length);
+ DefaultLog.getInstance().warn("validating inputExcludeStdTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, defaultIncluded.length + 1);
+ assertCounter(validatorData, ClaimStatistic.Counter.IGNORED, defaultExcluded.length);
for (String fileName : defaultIncluded) {
assertStandardFile(validatorData.getDocument(), fileName);
}
for (String fileName : defaultExcluded) {
assertIgnoredFile(validatorData.getDocument(), fileName);
}
- assertStandardFile(validatorData.getDocument(), mavenFile);
}));
result.add(new TestData("", Collections.singletonList(ImmutablePair.of(option, args)),
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(defaultIncluded.length);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.IGNORED)).isEqualTo(defaultExcluded.length + 1);
+ DefaultLog.getInstance().warn("validating inputExcludeStdTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, defaultIncluded.length);
+ assertCounter(validatorData, ClaimStatistic.Counter.IGNORED, defaultExcluded.length + 1);
for (String fileName : defaultIncluded) {
assertStandardFile(validatorData.getDocument(), fileName);
}
@@ -201,6 +211,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
protected void inputExcludeParsedScmTest(final Set<TestData> result, final Option option) {
Consumer<Path> setup = basePath -> {
+ DefaultLog.getInstance().warn("inputExcludeParsedScmTest setup for " + basePath);
File baseDir = basePath.toFile();
String[] lines = {
"# somethings",
@@ -239,17 +250,19 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
result.add(new TestData(DataUtils.asDirName(option), Collections.singletonList(ImmutablePair.nullPair()),
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(11);
+ DefaultLog.getInstance().warn("validating inputExcludeParsedScmTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 11);
// .gitignore is ignored by default as it is hidden
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.IGNORED)).isEqualTo(0);
+ assertCounter(validatorData, ClaimStatistic.Counter.IGNORED, 0);
}));
result.add(new TestData("GIT", Collections.singletonList(ImmutablePair.of(option, new String[]{"GIT"})),
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(3);
+ DefaultLog.getInstance().warn("validating inputExcludeParsedScmTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 3);
// .gitignore is ignored by default as it is hidden
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.IGNORED)).isEqualTo(8);
+ assertCounter(validatorData, ClaimStatistic.Counter.IGNORED, 8);
}));
}
@@ -258,6 +271,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
String[] excluded = {"Hi.txt"};
Consumer<Path> setup = basePath -> {
+ DefaultLog.getInstance().warn("inputExcludeSizeTest setup for " + basePath);
File baseDir = basePath.toFile();
writeFile(baseDir, "Hi.txt", Collections.singletonList("Hi"));
writeFile(baseDir, "Hello.txt", Collections.singletonList("Hello"));
@@ -267,8 +281,9 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
result.add(new TestData(DataUtils.asDirName(option), Collections.singletonList(ImmutablePair.of(null, null)),
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(3);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.IGNORED)).isEqualTo(0);
+ DefaultLog.getInstance().warn("validating inputExcludeSizeTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 3);
+ assertCounter(validatorData, ClaimStatistic.Counter.IGNORED, 0);
for (String fname : excluded) {
assertStandardFile(validatorData.getDocument(), fname);
}
@@ -280,8 +295,9 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
result.add(new TestData("", Collections.singletonList(ImmutablePair.of(option, new String[]{"5"})),
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(2);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.IGNORED)).isEqualTo(1);
+ DefaultLog.getInstance().warn("validating inputExcludeSizeTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 2);
+ assertCounter(validatorData, ClaimStatistic.Counter.IGNORED, 1);
for (String fname : excluded) {
assertIgnoredFile(validatorData.getDocument(), fname);
}
@@ -295,6 +311,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
private List<TestData> execIncludeTest(final Option option, String[] args, Consumer<Path> setupFiles) {
Option excludeOption = Arg.EXCLUDE.option();
Consumer<Path> setup = setupFiles.andThen(basePath -> {
+ DefaultLog.getInstance().warn("execIncludeTest setup for " + basePath);
File baseDir = basePath.toFile();
writeFile(baseDir, "notbaz");
writeFile(baseDir, "some.foo");
@@ -306,31 +323,35 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
TestData test1 = new TestData(DataUtils.asDirName(option), NO_OPTIONS,
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(4);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.IGNORED)).isEqualTo(1);
+ DefaultLog.getInstance().warn("validating execIncludeTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 4);
+ assertCounter(validatorData, ClaimStatistic.Counter.IGNORED, 1);
});
// verify exclude removes the files
TestData test2 = new TestData(DataUtils.asDirName(option), Collections.singletonList(ImmutablePair.of(excludeOption, AbstractTestDataProvider.EXCLUDE_ARGS)),
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(1);
+ DefaultLog.getInstance().warn("validating execIncludeTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 1);
// .gitignore is ignored by default as it is hidden but not counted
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.IGNORED)).isEqualTo(4);
+ assertCounter(validatorData, ClaimStatistic.Counter.IGNORED, 4);
});
TestData test3 = new TestData("", Arrays.asList(ImmutablePair.of(option, args), ImmutablePair.of(excludeOption, AbstractTestDataProvider.EXCLUDE_ARGS)),
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(3);
+ DefaultLog.getInstance().warn("validating execIncludeTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 3);
// .gitignore is ignored by default as it is hidden but not counted
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.IGNORED)).isEqualTo(2);
+ assertCounter(validatorData, ClaimStatistic.Counter.IGNORED, 2);
});
return Arrays.asList(test1, test2, test3);
}
protected void inputIncludeFileTest(final Set<TestData> result, final Option option) {
Consumer<Path> setup = mkRat.andThen(basePath -> {
+ DefaultLog.getInstance().warn("inputIncludeFileTest setup for " + basePath);
File dir = basePath.resolve(".rat").toFile();
writeFile(dir, "include.txt", Arrays.asList(AbstractTestDataProvider.INCLUDE_ARGS));
});
@@ -344,6 +365,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
protected void inputIncludeStdTest(final Set<TestData> result, final Option option) {
Consumer<Path> setup = basePath -> {
+ DefaultLog.getInstance().warn("inputIncludeStdTest setup for " + basePath);
File baseDir = basePath.toFile();
writeFile(baseDir, "afile~more");
writeFile(baseDir, "afile~");
@@ -368,8 +390,9 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
result.add(new TestData("includeStdValidation", Collections.singletonList(excludes),
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(4);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.IGNORED)).isEqualTo(6);
+ DefaultLog.getInstance().warn("validating inputIncludeStdTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 4);
+ assertCounter(validatorData, ClaimStatistic.Counter.IGNORED, 6);
}));
if (!option.hasArg()) {
@@ -378,8 +401,9 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
Arrays.asList(ImmutablePair.of(option, null), excludes),
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(5);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.IGNORED)).isEqualTo(5);
+ DefaultLog.getInstance().warn("validating inputIncludeStdTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 5);
+ assertCounter(validatorData, ClaimStatistic.Counter.IGNORED, 5);
assertIgnoredFile(validatorData.getDocument(), "._afile");
assertStandardFile(validatorData.getDocument(), ".hiddenDir/aFile");
}));
@@ -390,19 +414,18 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
result.add(new TestData(StandardCollection.MISC.name().toLowerCase(Locale.ROOT), Arrays.asList(ImmutablePair.of(option, new String[]{StandardCollection.MISC.name()}), excludes),
setup,
validatorData -> {
-
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(8);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.IGNORED)).isEqualTo(2);
+ DefaultLog.getInstance().warn("validating inputIncludeStdTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 8);
+ assertCounter(validatorData, ClaimStatistic.Counter.IGNORED, 2);
}));
result.add(new TestData(StandardCollection.HIDDEN_FILE.name().toLowerCase(Locale.ROOT),
Arrays.asList(ImmutablePair.of(option, new String[]{StandardCollection.HIDDEN_FILE.name()}), excludes),
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS))
- .isEqualTo(6);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.IGNORED))
- .isEqualTo(4);
+ DefaultLog.getInstance().warn("validating inputIncludeStdTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 6);
+ assertCounter(validatorData, ClaimStatistic.Counter.IGNORED, 4);
assertStandardFile(validatorData.getDocument(), "._afile");
assertIgnoredFile(validatorData.getDocument(), ".hiddenDir");
}));
@@ -411,8 +434,9 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
Arrays.asList(ImmutablePair.of(option, new String[]{StandardCollection.HIDDEN_DIR.name()}), excludes),
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(5);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.IGNORED)).isEqualTo(5);
+ DefaultLog.getInstance().warn("validating inputIncludeStdTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 5);
+ assertCounter(validatorData, ClaimStatistic.Counter.IGNORED, 5);
assertIgnoredFile(validatorData.getDocument(), "._afile");
assertStandardFile(validatorData.getDocument(), ".hiddenDir/aFile");
}));
@@ -421,24 +445,27 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
protected void inputSourceTest(final Set<TestData> result, final Option option) {
Consumer<Path> setup = basePath -> {
+ DefaultLog.getInstance().warn("inputSourceTest setup for " + basePath);
File baseDir = basePath.toFile();
- writeFile(baseDir, "codefile");
- writeFile(baseDir, "intput.txt", "codefile");
+ writeFile(baseDir, "codefile", "https://www.apache.org/licenses/LICENSE-2.0");
+ writeFile(baseDir, "input.txt", "codefile");
writeFile(baseDir, "notcodeFile");
};
result.add(new TestData(DataUtils.asDirName(option), NO_OPTIONS,
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(3);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.IGNORED)).isEqualTo(0);
+ DefaultLog.getInstance().warn("validating inputSourceTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 3);
+ assertCounter(validatorData, ClaimStatistic.Counter.IGNORED, 0);
}));
- result.add(new TestData("", Collections.singletonList(ImmutablePair.of(option, new String[]{"intput.txt"})),
+ result.add(new TestData("", Collections.singletonList(ImmutablePair.of(option, new String[]{"input.txt"})),
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(1);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.IGNORED)).isEqualTo(0);
+ DefaultLog.getInstance().warn("validating inputSourceTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 1);
+ assertCounter(validatorData, ClaimStatistic.Counter.IGNORED, 0);
}));
}
@@ -446,6 +473,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
protected List<TestData> execLicensesApprovedTest(final Option option, String[] args, Consumer<Path> extraSetup) {
Consumer<Path> setup = extraSetup.andThen(
basePath -> {
+ DefaultLog.getInstance().warn("execLicensesApprovedTest setup for " + basePath);
File baseDir = basePath.toFile();
writeFile(baseDir, "catz.txt", "SPDX-License-Identifier: catz");
writeFile(baseDir, "apl.txt", "SPDX-License-Identifier: Apache-2.0");
@@ -455,28 +483,34 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
TestData test1 = new TestData(DataUtils.asDirName(option), NO_OPTIONS,
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(2);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.APPROVED)).isEqualTo(1);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.UNAPPROVED)).isEqualTo(1);
+ DefaultLog.getInstance().warn("validating execLicensesApprovedTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 2);
+ assertCounter(validatorData, ClaimStatistic.Counter.APPROVED, 1);
+ assertCounter(validatorData, ClaimStatistic.Counter.UNAPPROVED, 1);
});
TestData test2 = new TestData("withoutLicenseDef", Collections.singletonList(ImmutablePair.of(option, args)),
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(2);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.APPROVED)).isEqualTo(1);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.UNAPPROVED)).isEqualTo(1);
+ DefaultLog.getInstance().warn("validating execLicensesApprovedTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 2);
+ assertCounter(validatorData, ClaimStatistic.Counter.APPROVED, 1);
+ assertCounter(validatorData, ClaimStatistic.Counter.UNAPPROVED, 1);
});
Option configOpt = Arg.CONFIGURATION.option();
TestData test3 = new TestData("withLicenseDef", Arrays.asList(ImmutablePair.of(option, args),
ImmutablePair.of(configOpt, new String[]{".rat/catz.xml"})),
- setup.andThen(mkRat).andThen(
- basePath -> DataUtils.generateSpdxConfig(basePath.resolve(".rat").resolve("catz.xml"), "catz", "catz")),
+ setup.andThen(mkRat).andThen(
+ basePath -> {
+ DefaultLog.getInstance().warn("withLicenseDef setup for " + basePath);
+ DataUtils.generateSpdxConfig(basePath.resolve(".rat").resolve("catz.xml"), "catz", "catz");
+ }),
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(2);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.APPROVED)).isEqualTo(2);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.UNAPPROVED)).isEqualTo(0);
+ DefaultLog.getInstance().warn("validating execLicensesApprovedTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 2);
+ assertCounter(validatorData, ClaimStatistic.Counter.APPROVED, 2);
+ assertCounter(validatorData, ClaimStatistic.Counter.UNAPPROVED, 0);
});
return Arrays.asList(test1, test2, test3);
}
@@ -486,10 +520,14 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream out = new PrintStream(baos);
- result.add( new TestData("stdOut",
+ result.add(new TestData("stdOut",
Collections.singletonList(ImmutablePair.of(option, null)),
- basePath -> System.setOut(out),
+ basePath -> {
+ DefaultLog.getInstance().warn("helpLicenses setup for " + basePath);
+ System.setOut(out);
+ },
validatorData -> {
+ DefaultLog.getInstance().warn("validating helpLicenses for " + validatorData.getBaseDir());
System.setOut(origin);
String txt = baos.toString();
TextUtils.assertContains("====== Licenses ======", txt);
@@ -501,7 +539,10 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
protected void licensesApprovedFileTest(final Set<TestData> result, final Option option) {
result.addAll(execLicensesApprovedTest(option, new String[]{".rat/licensesApproved.txt"},
mkRat.andThen(
- basePath -> writeFile(basePath.resolve(".rat").toFile(), "licensesApproved.txt", List.of("catz")))));
+ basePath -> {
+ DefaultLog.getInstance().warn("licensesApprovedFileTest setup for " + basePath);
+ writeFile(basePath.resolve(".rat").toFile(), "licensesApproved.txt", List.of("catz"));
+ })));
}
protected void licensesApprovedTest(final Set<TestData> result, final Option option) {
@@ -510,6 +551,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
private List<TestData> execLicensesDeniedTest(final Option option, final String[] args, Consumer<Path> setupFiles) {
Consumer<Path> setup = setupFiles.andThen(basePath -> {
+ DefaultLog.getInstance().warn("execLicensesDeniedTest setup for " + basePath);
File baseDir = basePath.toFile();
writeFile(baseDir, "illumousFile.java", "The contents of this file are " +
"subject to the terms of the Common Development and Distribution License (the \"License\") You " +
@@ -518,11 +560,11 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
TestData test1 = new TestData("ILLUMOS", Collections.singletonList(ImmutablePair.of(option, args)),
setup,
validatorData -> {
-
- ClaimStatistic claimStatistic = validatorData.getStatistic();
- ClaimValidator validator = validatorData.getConfiguration().getClaimValidator();
- assertThat(validator.listIssues(claimStatistic)).containsExactly("UNAPPROVED");
- });
+ DefaultLog.getInstance().warn("validating execLicensesDeniedTest for " + validatorData.getBaseDir());
+ ClaimStatistic claimStatistic = validatorData.getStatistic();
+ ClaimValidator validator = validatorData.getConfiguration().getClaimValidator();
+ assertThat(validator.listIssues(claimStatistic)).containsExactly("UNAPPROVED");
+ });
return Collections.singletonList(test1);
}
@@ -538,6 +580,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
private List<TestData> execLicenseFamiliesApprovedTest(final Option option, final String[] args, Consumer<Path> extraSetup) {
Consumer<Path> setup = extraSetup.andThen(
basePath -> {
+ DefaultLog.getInstance().warn("execLicenseFamiliesApprovedTest setup for " + basePath);
File baseDir = basePath.toFile();
writeFile(baseDir, "catz.txt", "SPDX-License-Identifier: catz");
});
@@ -545,38 +588,45 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
TestData test1 = new TestData(DataUtils.asDirName(option), NO_OPTIONS,
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(1);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.APPROVED)).isEqualTo(0);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.UNAPPROVED)).isEqualTo(1);
+ DefaultLog.getInstance().warn("validating execLicenseFamiliesApprovedTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 1);
+ assertCounter(validatorData, ClaimStatistic.Counter.APPROVED, 0);
+ assertCounter(validatorData, ClaimStatistic.Counter.UNAPPROVED, 1);
});
TestData test2 = new TestData("withoutLicenseDef", Collections.singletonList(ImmutablePair.of(option, args)),
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(1);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.APPROVED)).isEqualTo(0);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.UNAPPROVED)).isEqualTo(1);
+ DefaultLog.getInstance().warn("validating execLicenseFamiliesApprovedTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 1);
+ assertCounter(validatorData, ClaimStatistic.Counter.APPROVED, 0);
+ assertCounter(validatorData, ClaimStatistic.Counter.UNAPPROVED, 1);
});
Option configOpt = Arg.CONFIGURATION.option();
TestData test3 = new TestData("withLicenseDef", Arrays.asList(ImmutablePair.of(option, args),
ImmutablePair.of(configOpt, new String[]{".rat/catz.xml"})),
setup.andThen(mkRat).andThen(
basePath -> {
+ DefaultLog.getInstance().warn("withLicenseDef setup for " + basePath);
Path ratDir = basePath.resolve(".rat");
Path catzXml = ratDir.resolve("catz.xml");
DataUtils.generateSpdxConfig(catzXml, "catz", "catz");
}),
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(1);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.APPROVED)).isEqualTo(1);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.UNAPPROVED)).isEqualTo(0);
+ DefaultLog.getInstance().warn("validating execLicenseFamiliesApprovedTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 1);
+ assertCounter(validatorData, ClaimStatistic.Counter.APPROVED, 1);
+ assertCounter(validatorData, ClaimStatistic.Counter.UNAPPROVED, 0);
});
return Arrays.asList(test1, test2, test3);
}
protected void licenseFamiliesApprovedFileTest(final Set<TestData> result, final Option option) {
result.addAll(execLicenseFamiliesApprovedTest(option, new String[]{".rat/familiesApproved.txt"},
- mkRat.andThen( basePath -> writeFile(basePath.resolve(".rat").toFile(), "familiesApproved.txt", Collections.singletonList("catz")))));
+ mkRat.andThen(basePath -> {
+ DefaultLog.getInstance().warn("licenseFamiliesApprovedFileTest setup for " + basePath);
+ writeFile(basePath.resolve(".rat").toFile(), "familiesApproved.txt", Collections.singletonList("catz"));
+ })));
}
protected void licenseFamiliesApprovedTest(final Set<TestData> result, final Option option) {
@@ -586,6 +636,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
private List<TestData> execLicenseFamiliesDeniedTest(final Option option, final String[] args, Consumer<Path> extraSetup) {
Consumer<Path> setup = extraSetup.andThen(
basePath -> {
+ DefaultLog.getInstance().warn("execLicenseFamiliesDeniedTest setup for " + basePath);
File baseDir = basePath.toFile();
writeFile(baseDir, "bsd.txt", "SPDX-License-Identifier: BSD-3-Clause");
});
@@ -593,17 +644,19 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
TestData test1 = new TestData(DataUtils.asDirName(option), NO_OPTIONS,
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(1);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.APPROVED)).isEqualTo(1);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.UNAPPROVED)).isEqualTo(0);
+ DefaultLog.getInstance().warn("validating execLicenseFamiliesDeniedTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 1);
+ assertCounter(validatorData, ClaimStatistic.Counter.APPROVED, 1);
+ assertCounter(validatorData, ClaimStatistic.Counter.UNAPPROVED, 0);
});
TestData test2 = new TestData("", Collections.singletonList(ImmutablePair.of(option, args)),
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(1);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.APPROVED)).isEqualTo(0);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.UNAPPROVED)).isEqualTo(1);
+ DefaultLog.getInstance().warn("validating execLicenseFamiliesDeniedTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 1);
+ assertCounter(validatorData, ClaimStatistic.Counter.APPROVED, 0);
+ assertCounter(validatorData, ClaimStatistic.Counter.UNAPPROVED, 1);
});
return Arrays.asList(test1, test2);
@@ -612,7 +665,10 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
protected void licenseFamiliesDeniedFileTest(final Set<TestData> result, final Option option) {
result.addAll(execLicenseFamiliesDeniedTest(option, new String[]{".rat/familiesDenied.txt"},
mkRat.andThen(
- baseDir -> writeFile(baseDir.resolve(".rat").toFile(), "familiesDenied.txt", Collections.singletonList("BSD-3")))));
+ basePath -> {
+ DefaultLog.getInstance().warn("licenseFamiliesDeniedFileTest setup for " + basePath);
+ writeFile(basePath.resolve(".rat").toFile(), "familiesDenied.txt", Collections.singletonList("BSD-3"));
+ })));
}
protected void licenseFamiliesDeniedTest(final Set<TestData> result, final Option option) {
@@ -620,13 +676,15 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
}
protected void counterMaxTest(final Set<TestData> result, final Option option) {
- result.add(new TestData(DataUtils.asDirName(option), Collections.singletonList(ImmutablePair.of(null, null)),
+ result.add(new TestData(DataUtils.asDirName(option), Collections.singletonList(ImmutablePair.of(null, null)),
basePath -> {
+ DefaultLog.getInstance().warn("counterMaxTest setup for " + basePath);
File baseDir = basePath.toFile();
writeFile(baseDir, "Test.java", Arrays.asList("/*\n", "SPDX-License-Identifier: Unapproved\n",
"*/\n\n", "class Test {}\n"));
},
validatorData -> {
+ DefaultLog.getInstance().warn("validating counterMaxTest for " + validatorData.getBaseDir());
ClaimStatistic claimStatistic = validatorData.getStatistic();
ClaimValidator validator = validatorData.getConfiguration().getClaimValidator();
assertThat(validator.listIssues(claimStatistic)).containsExactly("UNAPPROVED");
@@ -634,11 +692,13 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
result.add(new TestData("Unapproved1", Collections.singletonList(ImmutablePair.of(option, new String[]{"Unapproved:1"})),
basePath -> {
+ DefaultLog.getInstance().warn("counterMaxTest setup for " + basePath);
File baseDir = basePath.toFile();
writeFile(baseDir, "Test.java", Arrays.asList("/*\n", "SPDX-License-Identifier: Unapproved\n",
"*/\n\n", "class Test {}\n"));
},
validatorData -> {
+ DefaultLog.getInstance().warn("validating counterMaxTest for " + validatorData.getBaseDir());
ClaimStatistic claimStatistic = validatorData.getStatistic();
ClaimValidator validator = validatorData.getConfiguration().getClaimValidator();
assertThat(validator.listIssues(claimStatistic)).isEmpty();
@@ -648,11 +708,13 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
protected void counterMinTest(final Set<TestData> result, final Option option) {
result.add(new TestData(DataUtils.asDirName(option), NO_OPTIONS,
basePath -> {
+ DefaultLog.getInstance().warn("counterMinTest setup for " + basePath);
File baseDir = basePath.toFile();
writeFile(baseDir, "Test.java", Arrays.asList("/*\n", "SPDX-License-Identifier: Unapproved\n",
"*/\n\n", "class Test {}\n"));
},
validatorData -> {
+ DefaultLog.getInstance().warn("validating counterMinTest for " + validatorData.getBaseDir());
ClaimStatistic claimStatistic = validatorData.getStatistic();
ClaimValidator validator = validatorData.getConfiguration().getClaimValidator();
assertThat(validator.listIssues(claimStatistic)).containsExactly("UNAPPROVED");
@@ -660,11 +722,13 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
result.add(new TestData("", Collections.singletonList(ImmutablePair.of(option, new String[]{"Unapproved:1"})),
basePath -> {
+ DefaultLog.getInstance().warn("counterMinTest setup for " + basePath);
File baseDir = basePath.toFile();
writeFile(baseDir, "Test.java", Arrays.asList("/*\n", "SPDX-License-Identifier: Unapproved\n",
"*/\n\n", "class Test {}\n"));
},
validatorData -> {
+ DefaultLog.getInstance().warn("validating counterMinTest for " + validatorData.getBaseDir());
ClaimStatistic claimStatistic = validatorData.getStatistic();
ClaimValidator validator = validatorData.getConfiguration().getClaimValidator();
assertThat(validator.listIssues(claimStatistic)).isEmpty();
@@ -673,11 +737,13 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
/**
* Add results to the result list.
+ *
* @param result the result list.
* @param option configuration option we are testing.
*/
protected void configTest(final Set<TestData> result, final Option option) {
- Consumer<Path> setup = mkRat.andThen( basePath -> {
+ Consumer<Path> setup = mkRat.andThen(basePath -> {
+ DefaultLog.getInstance().warn("configTest setup for " + basePath);
Path ratDir = basePath.resolve(".rat");
Path oneXml = ratDir.resolve("One.xml");
DataUtils.generateTextConfig(oneXml, "ONE", "one");
@@ -687,7 +753,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
File baseDir = basePath.toFile();
writeFile(baseDir, "bsd.txt", "SPDX-License-Identifier: BSD-3-Clause");
- writeFile(baseDir, "one.txt", "one is the lonelest number");
+ writeFile(baseDir, "one.txt", "one is the loneliest number");
});
String[] args = {".rat/One.xml", ".rat/Two.xml"};
@@ -696,27 +762,31 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
result.add(new TestData(DataUtils.asDirName(option), NO_OPTIONS,
setup,
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(2);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.APPROVED)).isEqualTo(1);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.UNAPPROVED)).isEqualTo(1);
+ DefaultLog.getInstance().warn("validating configTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 2);
+ assertCounter(validatorData, ClaimStatistic.Counter.APPROVED, 1);
+ assertCounter(validatorData, ClaimStatistic.Counter.UNAPPROVED, 1);
}));
result.add(new TestData("withDefaults", Collections.singletonList(underTest),
- setup,
- validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(2);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.APPROVED)).isEqualTo(2);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.UNAPPROVED)).isEqualTo(0);
- }));
+ setup,
+ validatorData -> {
+ DefaultLog.getInstance().warn("validating configTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 2);
+ assertCounter(validatorData, ClaimStatistic.Counter.APPROVED, 2);
+ assertCounter(validatorData, ClaimStatistic.Counter.UNAPPROVED, 0);
+ }));
if (!Arg.CONFIGURATION_NO_DEFAULTS.isEmpty()) {
result.add(new TestData("noDefaults", Arrays.asList(underTest,
ImmutablePair.of(Arg.CONFIGURATION_NO_DEFAULTS.find("configuration-no-defaults"), null)),
setup,
+ /** Make validator data a structure with counter countes and file checks. */
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(2);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.APPROVED)).isEqualTo(1);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.UNAPPROVED)).isEqualTo(1);
+ DefaultLog.getInstance().warn("validating configTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 2);
+ assertCounter(validatorData, ClaimStatistic.Counter.APPROVED, 1);
+ assertCounter(validatorData, ClaimStatistic.Counter.UNAPPROVED, 1);
}));
}
}
@@ -724,11 +794,15 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
protected void configurationNoDefaultsTest(final Set<TestData> result, final Option option) {
TestData test1 = new TestData("", Collections.singletonList(ImmutablePair.of(option, null)),
basePath -> {
+ DefaultLog.getInstance().warn("configurationNoDefaultsTest setup for " + basePath);
File baseDir = basePath.toFile();
writeFile(baseDir, "Test.java", Arrays.asList("/*\n", "SPDX-License-Identifier: Apache-2.0\n",
"*/\n\n", "class Test {}\n"));
},
- validatorData -> assertThat(validatorData.getConfiguration().getLicenses(LicenseSetFactory.LicenseFilter.ALL)).isEmpty());
+ validatorData -> {
+ DefaultLog.getInstance().warn("validating configurationNoDefaultsTest for " + validatorData.getBaseDir());
+ assertThat(validatorData.getConfiguration().getLicenses(LicenseSetFactory.LicenseFilter.ALL)).isEmpty();
+ });
test1.setException(NO_LICENSES_EXCEPTION);
result.add(test1);
}
@@ -736,15 +810,22 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
protected void dryRunTest(final Set<TestData> result, final Option option) {
result.add(new TestData("stdRun", Collections.singletonList(ImmutablePair.of(option, null)),
NO_SETUP,
- validatorData -> assertThat(validatorData.getConfiguration().isDryRun()).isTrue()));
+ validatorData -> {
+ DefaultLog.getInstance().warn("validating dryRunTest for " + validatorData.getBaseDir());
+ assertThat(validatorData.getConfiguration().isDryRun()).as("testing getConfiguration().isDryRun() flag").isTrue();
+ }));
result.add(new TestData(DataUtils.asDirName(option), NO_OPTIONS,
NO_SETUP,
- validatorData -> assertThat(validatorData.getConfiguration().isDryRun()).isFalse()));
+ validatorData -> {
+ DefaultLog.getInstance().warn("validating dryRunTest for " + validatorData.getBaseDir());
+ assertThat(validatorData.getConfiguration().isDryRun()).as("testing getConfiguration().isDryRun() flag").isFalse();
+ }));
}
protected void editCopyrightTest(final Set<TestData> result, final Option option) {
Consumer<Path> setup = basePath -> {
+ DefaultLog.getInstance().warn("editCopyrightTest setup for " + basePath);
File baseDir = basePath.toFile();
writeFile(baseDir, "Missing.java", Arrays.asList("/* no license */\n\n", "class Test {}\n"));
};
@@ -757,6 +838,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
result.add(new TestData("noEditLicense", Collections.singletonList(copyright),
setup,
validatorData -> {
+ DefaultLog.getInstance().warn("validating editCopyrightTest for " + validatorData.getBaseDir());
try {
String actualText = TextUtils.readFile(validatorData.getBaseDir().resolve("Missing.java").toFile());
TextUtils.assertNotContains("MyCopyright", actualText);
@@ -768,6 +850,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
result.add(new TestData(DataUtils.asDirName(editLicense.getLeft()), Arrays.asList(copyright, editLicense),
setup,
validatorData -> {
+ DefaultLog.getInstance().warn("validating editCopyrightTest for " + validatorData.getBaseDir());
try {
String actualText = TextUtils.readFile(validatorData.getBaseDir().resolve("Missing.java").toFile());
TextUtils.assertNotContains("MyCopyright", actualText);
@@ -785,6 +868,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
Arrays.asList(copyright, ImmutablePair.of(dryRun, null), editLicense),
setup,
validatorData -> {
+ DefaultLog.getInstance().warn("validating editCopyrightTest for " + validatorData.getBaseDir());
try {
String actualText = TextUtils.readFile(validatorData.getBaseDir().resolve("Missing.java").toFile());
TextUtils.assertNotContains("MyCopyright", actualText);
@@ -800,6 +884,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
result.add(new TestData(DataUtils.asDirName(overwrite), Arrays.asList(copyright, editLicense, ImmutablePair.of(overwrite, null)),
setup,
validatorData -> {
+ DefaultLog.getInstance().warn("validating editCopyrightTest for " + validatorData.getBaseDir());
try {
String actualText = TextUtils.readFile(validatorData.getBaseDir().resolve("Missing.java").toFile());
TextUtils.assertContains("MyCopyright", actualText);
@@ -813,57 +898,66 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
protected void editLicenseTest(final Set<TestData> result, final Option option) {
result.add(new TestData("", Collections.singletonList(ImmutablePair.of(option, null)),
- basePath -> {
- File baseDir = basePath.toFile();
- writeFile(baseDir, "NoLicense.java", "class NoLicense {}");
- },
+ basePath -> {
+ DefaultLog.getInstance().warn("editLicenseTest setup for " + basePath);
+ File baseDir = basePath.toFile();
+ writeFile(baseDir, "NoLicense.java", "class NoLicense {}");
+ },
validatorData -> {
- try {
- assertThat(validatorData.getStatistic()).isNotNull();
- File javaFile = validatorData.getBaseDir().resolve("NoLicense.java").toFile();
- String contents = String.join("\n", IOUtils.readLines(new FileReader(javaFile)));
- assertThat(contents).isEqualTo("class NoLicense {}");
- File resultFile = validatorData.getBaseDir().resolve("NoLicense.java.new").toFile();
- assertThat(resultFile).exists();
- contents = String.join("\n", IOUtils.readLines(new FileReader(resultFile)));
- assertThat(contents).isEqualTo("""
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *\s
- * http://www.apache.org/licenses/LICENSE-2.0
- *\s
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
- class NoLicense {}""");
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
+ DefaultLog.getInstance().warn("validating editLicenseTest for " + validatorData.getBaseDir());
+ try {
+ assertThat(validatorData.getStatistic()).isNotNull();
+ File javaFile = validatorData.getBaseDir().resolve("NoLicense.java").toFile();
+ String contents = String.join("\n", IOUtils.readLines(new FileReader(javaFile)));
+ assertThat(contents).isEqualTo("class NoLicense {}");
+ File resultFile = validatorData.getBaseDir().resolve("NoLicense.java.new").toFile();
+ assertThat(resultFile).exists();
+ contents = String.join("\n", IOUtils.readLines(new FileReader(resultFile)));
+ assertThat(contents).isEqualTo("""
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *\s
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *\s
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+ class NoLicense {}""");
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
}));
}
protected void editOverwriteTest(final Set<TestData> result, final Option option) {
result.add(new TestData("noEditLicense", Collections.singletonList(ImmutablePair.of(option, null)),
NO_SETUP,
- validatorData -> assertThat(validatorData.getConfiguration().isAddingLicensesForced())
- .describedAs("Without edit-license should be false").isFalse()));
+ validatorData -> {
+ DefaultLog.getInstance().warn("validating editOverwriteTest for " + validatorData.getBaseDir());
+ assertThat(validatorData.getConfiguration().isAddingLicensesForced())
+ .describedAs("Without edit-license should be false").isFalse();
+ }));
if (!Arg.EDIT_ADD.isEmpty()) {
result.add(new TestData("", Arrays.asList(ImmutablePair.of(option, null),
ImmutablePair.of(Arg.EDIT_ADD.find("edit-license"), null)),
NO_SETUP,
- validatorData -> assertThat(validatorData.getConfiguration().isAddingLicensesForced()).isTrue()));
+ validatorData -> {
+ DefaultLog.getInstance().warn("validating editOverwriteTest for " + validatorData.getBaseDir());
+ assertThat(validatorData.getConfiguration().isAddingLicensesForced())
+ .as("testing getConfiguration().isAddingLicensesForced() flag").isTrue();
+ }));
}
}
@@ -871,6 +965,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
final TestingLog testingLog = new TestingLog();
Consumer<Path> setup = basePath -> {
+ DefaultLog.getInstance().warn("logLevelTest setup for " + basePath);
DefaultLog.setInstance(testingLog);
testingLog.clear();
};
@@ -879,6 +974,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
Collections.singletonList(ImmutablePair.of(option, new String[]{Log.Level.INFO.name()})),
setup,
validatorData -> {
+ DefaultLog.getInstance().warn("validating logLevelTest for " + validatorData.getBaseDir());
try {
testingLog.assertNotContains("DEBUG");
} finally {
@@ -890,6 +986,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
Collections.singletonList(ImmutablePair.of(option, new String[]{Log.Level.DEBUG.name()})),
setup,
validatorData -> {
+ DefaultLog.getInstance().warn("validating logLevelTest for " + validatorData.getBaseDir());
try {
testingLog.assertContains("DEBUG");
} finally {
@@ -903,6 +1000,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
result.add(new TestData(processing.name().toLowerCase(Locale.ROOT),
Collections.singletonList(ImmutablePair.of(option, new String[]{processing.name()})),
basePath -> {
+ DefaultLog.getInstance().warn("outputArchiveTest setup for " + basePath);
File localArchive = new File(basePath.toFile(), "dummy.jar");
try (InputStream in = ReportTestDataProvider.class.getResourceAsStream("/tikaFiles/archive/dummy.jar");
OutputStream out = Files.newOutputStream(localArchive.toPath())) {
@@ -913,6 +1011,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
}
},
validatorData -> {
+ DefaultLog.getInstance().warn("validating outputArchiveTest for " + validatorData.getBaseDir());
Document document = validatorData.getDocument();
try {
XmlUtils.assertIsPresent(processing.name(), document, xpath, "/rat-report/resource[@name='/dummy.jar']");
@@ -946,6 +1045,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
Collections.singletonList(ImmutablePair.of(option, new String[]{filter.name()})),
NO_SETUP,
validatorData -> {
+ DefaultLog.getInstance().warn("validating outputFamiliesTest for " + validatorData.getBaseDir());
Document document = validatorData.getDocument();
try {
switch (filter) {
@@ -975,19 +1075,21 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
protected void outputFileTest(final Set<TestData> result, final Option option) {
result.add(new TestData("", Collections.singletonList(ImmutablePair.of(option, new String[]{"outexample"})),
basePath -> {
+ DefaultLog.getInstance().warn("outputFileTest setup for " + basePath);
File baseDir = basePath.toFile();
writeFile(baseDir, "apl.txt", "SPDX-License-Identifier: Apache-2.0");
},
validatorData -> {
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.STANDARDS)).isEqualTo(1);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.APPROVED)).isEqualTo(1);
- assertThat(validatorData.getStatistic().getCounter(ClaimStatistic.Counter.UNAPPROVED)).isEqualTo(0);
+ DefaultLog.getInstance().warn("validating outputFamiliesTest for " + validatorData.getBaseDir());
+ assertCounter(validatorData, ClaimStatistic.Counter.STANDARDS, 1);
+ assertCounter(validatorData, ClaimStatistic.Counter.APPROVED, 1);
+ assertCounter(validatorData, ClaimStatistic.Counter.UNAPPROVED, 0);
File outFile = validatorData.getBaseDir().resolve("outexample").toFile();
try {
String actualText = TextUtils.readFile(outFile);
- TextUtils.assertContainsExactly(1, "Apache License 2.0: 1 ", actualText);
- TextUtils.assertContainsExactly(1, "STANDARD: 1 ", actualText);
+ TextUtils.assertPatternInTarget("Apache License 2.0: \\d", actualText);
+ TextUtils.assertPatternInTarget("STANDARD:\\s+\\d", actualText);
} catch (IOException e) {
throw new RuntimeException(e);
}
@@ -1000,6 +1102,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
result.add(new TestData(filter.name(), Collections.singletonList(ImmutablePair.of(option, new String[]{filter.name()})),
NO_SETUP,
validatorData -> {
+ DefaultLog.getInstance().warn("validating outputLicensesTest for " + validatorData.getBaseDir());
Document document = validatorData.getDocument();
try {
switch (filter) {
@@ -1030,12 +1133,14 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
for (ReportConfiguration.Processing proc : ReportConfiguration.Processing.values()) {
result.add(new TestData(proc.name().toLowerCase(Locale.ROOT), Collections.singletonList(ImmutablePair.of(option, new String[]{proc.name()})),
basePath -> {
+ DefaultLog.getInstance().warn("outputStandardTest setup for " + basePath);
File baseDir = basePath.toFile();
writeFile(baseDir, "Test.java", Arrays.asList("/*\n", "SPDX-License-Identifier: Apache-2.0\n",
"*/\n\n", "class Test {}\n"));
writeFile(baseDir, "Missing.java", Arrays.asList("/* no license */\n\n", "class Test {}\n"));
},
validatorData -> {
+ DefaultLog.getInstance().warn("validating outputStandardTest for " + validatorData.getBaseDir());
Document document = validatorData.getDocument();
String testDoc = "/rat-report/resource[@name='/Test.java']";
String missingDoc = "/rat-report/resource[@name='/Missing.java']";
@@ -1069,6 +1174,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
protected void outputStyleTest(final Set<TestData> result, final Option option) {
Consumer<Path> createFile = basePath -> {
+ DefaultLog.getInstance().warn("outputStyleTest setup for " + basePath);
File baseDir = basePath.toFile();
writeFile(baseDir, "Test.java", Arrays.asList("/*\n", "SPDX-License-Identifier: Apache-2.0\n",
"*/\n\n", "class Test {}\n"));
@@ -1081,7 +1187,8 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
result.add(new TestData("", Collections.singletonList(ImmutablePair.of(option, null)),
createFile,
validatorData -> {
- try (InputStream expected = StyleSheets.XML.getStyleSheet().get();
+ DefaultLog.getInstance().warn("validating outputStyleTest for " + validatorData.getBaseDir());
+ try (InputStream expected = StyleSheets.XML.getStyleSheet().ioSupplier().get();
InputStream actual = validatorData.getConfiguration().getStyleSheet().get()) {
assertThat(IOUtils.contentEquals(expected, actual)).as(() -> String.format("'%s' does not match", StyleSheets.XML)).isTrue();
baos.reset();
@@ -1099,7 +1206,8 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
result.add(new TestData(sheet.name().toLowerCase(Locale.ROOT), Collections.singletonList(ImmutablePair.of(option, new String[]{sheet.arg()})),
createFile,
validatorData -> {
- try (InputStream expected = sheet.getStyleSheet().get();
+ DefaultLog.getInstance().warn("validating outputStyleTest for " + validatorData.getBaseDir());
+ try (InputStream expected = sheet.getStyleSheet().ioSupplier().get();
InputStream actual = validatorData.getConfiguration().getStyleSheet().get()) {
assertThat(IOUtils.contentEquals(expected, actual)).as(() -> String.format("'%s' does not match", sheet)).isTrue();
baos.reset();
@@ -1122,7 +1230,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
TextUtils.assertContainsExactly(1, "Files with unapproved licenses:" + System.lineSeparator() + " /Missing.java", actualText);
break;
case XHTML5:
- TextUtils.assertPatternInTarget("<td>Approved<\\/td>\\s+<td>1<\\/td>\\s+<td>A count of approved licenses.<\\/td>", actualText);
+ TextUtils.assertPatternInTarget("<td>Approved<\\/td>\\s+<td>\\d+<\\/td>\\s+<td>A count of approved licenses.<\\/td>", actualText);
break;
default:
fail("No test for stylesheet " + sheet);
@@ -1137,6 +1245,7 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
result.add(new TestData("fileStyleSheet",
Collections.singletonList(ImmutablePair.of(option, new String[]{"fileStyleSheet.xslt"})),
basePath -> {
+ DefaultLog.getInstance().warn("outputStyleTest setup for " + basePath);
DocumentName name = DocumentName.builder().setName("fileStyleSheet.xslt")
.setBaseName(basePath.toString()).build();
try (FileWriter fileWriter = new FileWriter(new File(name.getBaseName(), name.getName()));
@@ -1156,7 +1265,8 @@ public class ReportTestDataProvider extends AbstractTestDataProvider {
},
validatorData -> {
- try (InputStream expected = StyleSheets.getStyleSheet("fileStyleSheet.xslt", validatorData.getBaseName()).get();
+ DefaultLog.getInstance().warn("validating outputStyleTest for " + validatorData.getBaseDir());
+ try (InputStream expected = StyleSheets.getStyleSheet("fileStyleSheet.xslt", validatorData.getBaseName()).ioSupplier().get();
InputStream actual = validatorData.getConfiguration().getStyleSheet().get()) {
assertThat(IOUtils.contentEquals(expected, actual)).as(() -> "'fileStyleSheet.xslt' does not match").isTrue();
baos.reset();
diff --git a/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/TestData.java b/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/TestData.java
index 22157f55..c1fcefdb 100644
--- a/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/TestData.java
+++ b/apache-rat-core/src/test/java/org/apache/rat/testhelpers/data/TestData.java
@@ -21,15 +21,26 @@ package org.apache.rat.testhelpers.data;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
+import java.util.Set;
import java.util.function.Consumer;
+import javax.xml.xpath.XPathExpressionException;
import org.apache.commons.cli.Option;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.commons.text.WordUtils;
+import org.apache.rat.report.claim.ClaimStatistic;
+import org.apache.rat.testhelpers.XmlUtils;
import org.apache.rat.ui.ArgumentTracker;
import org.apache.rat.utils.CasedString;
+import org.apache.rat.utils.FileUtils;
+import org.w3c.dom.Document;
+
+import static org.assertj.core.api.Assertions.assertThat;
/**
* The definition of a test.
@@ -74,6 +85,11 @@ public final class TestData implements Comparable<TestData> {
this.expectedException = null;
}
+ @Override
+ public String toString() {
+ return getTestName();
+ }
+
/**
* Sets the exception expected from this test.
* @param expectedException the expected exception.
@@ -180,6 +196,7 @@ public final class TestData implements Comparable<TestData> {
* to this path.
*/
public void setupFiles(Path path) {
+ FileUtils.mkDir(path.toFile());
setupFiles.accept(path);
}
@@ -221,4 +238,5 @@ public final class TestData implements Comparable<TestData> {
public int compareTo(TestData other) {
return getTestName().compareTo(other.getTestName());
}
+
}
diff --git a/apache-rat-maven-parent/plugin/src/it/CustomLicense/pom.xml b/apache-rat-maven-parent/plugin/src/it/CustomLicense/pom.xml
index 47487212..3f263b26 100644
--- a/apache-rat-maven-parent/plugin/src/it/CustomLicense/pom.xml
+++ b/apache-rat-maven-parent/plugin/src/it/CustomLicense/pom.xml
@@ -28,7 +28,9 @@
<version>@pom.version@</version>
<configuration>
<outputStyle>xml</outputStyle>
- <config>.rat/customConfig.xml</config>
+ <configs>
+ <config>.rat/customConfig.xml</config>
+ </configs>
<inputExcludes>
<exclude>.rat/**</exclude>
<exclude>pom.xml</exclude>
diff --git a/apache-rat-maven-parent/plugin/src/it/RAT-168/invoker.properties b/apache-rat-maven-parent/plugin/src/it/RAT-168/invoker.properties
index 1c089b46..1ed6b12b 100644
--- a/apache-rat-maven-parent/plugin/src/it/RAT-168/invoker.properties
+++ b/apache-rat-maven-parent/plugin/src/it/RAT-168/invoker.properties
@@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-invoker.goals = clean -X apache-rat:rat
+invoker.goals = clean -X apache-rat:check
diff --git a/apache-rat-maven-parent/plugin/src/it/RAT-168/verify.groovy b/apache-rat-maven-parent/plugin/src/it/RAT-168/verify.groovy
index 33e535e7..1bddd2af 100644
--- a/apache-rat-maven-parent/plugin/src/it/RAT-168/verify.groovy
+++ b/apache-rat-maven-parent/plugin/src/it/RAT-168/verify.groovy
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import TextUtils
+import org.apache.rat.testhelpers.TextUtils
content = new File(basedir, 'build.log').text
@@ -22,6 +22,6 @@ assert content.contains('BUILD SUCCESS')
assert ! content.contains('[WARNING] No resources included')
-report = new File(basedir, 'target/site/rat-report.html').text
+report = new File(basedir, 'target/rat.txt').text
assert TextUtils.isMatching("^ /pom.xml\\s+S ", report)
assert report.contains('AL AL2.0 Apache License 2.0')
diff --git a/apache-rat-maven-parent/plugin/src/it/RAT-314/invoker.properties b/apache-rat-maven-parent/plugin/src/it/RAT-314/invoker.properties
index 6486eb1d..6e8c3479 100644
--- a/apache-rat-maven-parent/plugin/src/it/RAT-314/invoker.properties
+++ b/apache-rat-maven-parent/plugin/src/it/RAT-314/invoker.properties
@@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-invoker.goals = clean apache-rat:rat
+invoker.goals = clean apache-rat:check
diff --git a/apache-rat-maven-parent/plugin/src/it/RAT-314/verify.groovy b/apache-rat-maven-parent/plugin/src/it/RAT-314/verify.groovy
index 5548318c..622fbe5b 100644
--- a/apache-rat-maven-parent/plugin/src/it/RAT-314/verify.groovy
+++ b/apache-rat-maven-parent/plugin/src/it/RAT-314/verify.groovy
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import TextUtils
+import org.apache.rat.testhelpers.TextUtils
content = new File(basedir, 'build.log').text
@@ -22,7 +22,7 @@ assert content.contains('BUILD SUCCESS')
assert ! content.contains('[WARNING] No resources included')
-report = new File(basedir, 'target/site/rat-report.html').text
+report = new File(basedir, 'target/rat.txt').text
assert !report.contains('Unknown License')
assert TextUtils.isMatching("^ /pom.xml\\s+S ", report)
diff --git a/apache-rat-maven-parent/plugin/src/it/RAT-469-default/invoker.properties b/apache-rat-maven-parent/plugin/src/it/RAT-469-default/invoker.properties
index 6486eb1d..1ed6b12b 100644
--- a/apache-rat-maven-parent/plugin/src/it/RAT-469-default/invoker.properties
+++ b/apache-rat-maven-parent/plugin/src/it/RAT-469-default/invoker.properties
@@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-invoker.goals = clean apache-rat:rat
+invoker.goals = clean -X apache-rat:check
diff --git a/apache-rat-maven-parent/plugin/src/it/RAT-469-default/pom.xml b/apache-rat-maven-parent/plugin/src/it/RAT-469-default/pom.xml
index a962f9da..1165186a 100644
--- a/apache-rat-maven-parent/plugin/src/it/RAT-469-default/pom.xml
+++ b/apache-rat-maven-parent/plugin/src/it/RAT-469-default/pom.xml
@@ -40,6 +40,9 @@
<exclude>MAVEN</exclude>
<exclude>IDEA</exclude>
</inputExcludeStds>
+ <counterMaxs>
+ <counterPattern>Unapproved:1</counterPattern>
+ </counterMaxs>
</configuration>
</plugin>
</plugins>
diff --git a/apache-rat-maven-parent/plugin/src/it/RAT-469-default/verify.groovy b/apache-rat-maven-parent/plugin/src/it/RAT-469-default/verify.groovy
index 609f5b0e..823a1b9b 100644
--- a/apache-rat-maven-parent/plugin/src/it/RAT-469-default/verify.groovy
+++ b/apache-rat-maven-parent/plugin/src/it/RAT-469-default/verify.groovy
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import TextUtils
+import org.apache.rat.testhelpers.TextUtils
content = new File(basedir, 'build.log').text
@@ -25,7 +25,7 @@ assert content.contains('[DEBUG] Processing exclude file from STANDARD_SCMS.') /
assert ! content.contains('[WARNING] No resources included')
// Report is in apache-rat-plugin/target/invoker-reports
-report = new File(basedir, 'target/site/rat-report.html').text
+report = new File(basedir, 'target/rat.txt').text
assert TextUtils.isMatching("^ /verify.groovy\\s+S ", report)
assert TextUtils.isMatching("^! /pom.xml\\s+S ", report)
diff --git a/apache-rat-maven-parent/plugin/src/it/RAT-469/invoker.properties b/apache-rat-maven-parent/plugin/src/it/RAT-469/invoker.properties
index 6486eb1d..6e8c3479 100644
--- a/apache-rat-maven-parent/plugin/src/it/RAT-469/invoker.properties
+++ b/apache-rat-maven-parent/plugin/src/it/RAT-469/invoker.properties
@@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-invoker.goals = clean apache-rat:rat
+invoker.goals = clean apache-rat:check
diff --git a/apache-rat-maven-parent/plugin/src/it/RAT-469/verify.groovy b/apache-rat-maven-parent/plugin/src/it/RAT-469/verify.groovy
index 2790c4ea..d09abe52 100644
--- a/apache-rat-maven-parent/plugin/src/it/RAT-469/verify.groovy
+++ b/apache-rat-maven-parent/plugin/src/it/RAT-469/verify.groovy
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import TextUtils
+import org.apache.rat.testhelpers.TextUtils
content = new File(basedir, 'build.log').text
@@ -22,7 +22,8 @@ assert content.contains('BUILD SUCCESS')
assert ! content.contains('[WARNING] No resources included')
// Report is in apache-rat-plugin/target/invoker-reports
-report = new File(basedir, 'target/site/rat-report.html').text
+report = new File(basedir, 'target/rat.txt').text
+
assert TextUtils.isMatching("^ /verify.groovy\\s+S ", report)
assert TextUtils.isMatching("^ /pom.xml\\s+S ", report)
diff --git a/apache-rat-maven-parent/plugin/src/it/RAT-168/invoker.properties b/apache-rat-maven-parent/plugin/src/it/RAT-508/invoker.properties
similarity index 94%
copy from apache-rat-maven-parent/plugin/src/it/RAT-168/invoker.properties
copy to apache-rat-maven-parent/plugin/src/it/RAT-508/invoker.properties
index 1c089b46..1ed6b12b 100644
--- a/apache-rat-maven-parent/plugin/src/it/RAT-168/invoker.properties
+++ b/apache-rat-maven-parent/plugin/src/it/RAT-508/invoker.properties
@@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-invoker.goals = clean -X apache-rat:rat
+invoker.goals = clean -X apache-rat:check
diff --git a/apache-rat-plugin/src/it/RAT-508/pom.xml b/apache-rat-maven-parent/plugin/src/it/RAT-508/pom.xml
similarity index 100%
rename from apache-rat-plugin/src/it/RAT-508/pom.xml
rename to apache-rat-maven-parent/plugin/src/it/RAT-508/pom.xml
diff --git a/apache-rat-plugin/src/it/RAT-508/verify.groovy b/apache-rat-maven-parent/plugin/src/it/RAT-508/verify.groovy
similarity index 89%
rename from apache-rat-plugin/src/it/RAT-508/verify.groovy
rename to apache-rat-maven-parent/plugin/src/it/RAT-508/verify.groovy
index 3e801af3..7c2fb4ed 100644
--- a/apache-rat-plugin/src/it/RAT-508/verify.groovy
+++ b/apache-rat-maven-parent/plugin/src/it/RAT-508/verify.groovy
@@ -19,8 +19,8 @@ import org.apache.rat.testhelpers.TextUtils
content = new File(basedir, 'build.log').text
// verify debug output
-assert content.contains('input-exclude-std ALL')
-assert content.contains('Adding [MAVEN] to input-exclude-std')
+assert content.contains('input-exclude-std MAVEN, ALL')
+assert content.contains('Adding [ALL] to input-exclude-std')
assert content.contains('Including patterns: pom.xml')
assert content.contains('BUILD SUCCESS')
@@ -28,7 +28,7 @@ assert ! content.contains('[WARNING] No resources included')
// Report is in apache-rat-plugin/target/invoker-reports
// Make sure that report is generated completely
-report = new File(basedir, 'target/site/rat-report.html').text
+report = new File(basedir, 'target/rat.txt').text
assert TextUtils.isMatching("^ /verify.groovy\\s+S ", report)
assert TextUtils.isMatching("^ /pom.xml\\s+S ", report)
diff --git a/apache-rat-maven-parent/plugin/src/it/RAT-168/invoker.properties b/apache-rat-maven-parent/plugin/src/it/RAT-524/invoker.properties
similarity index 94%
copy from apache-rat-maven-parent/plugin/src/it/RAT-168/invoker.properties
copy to apache-rat-maven-parent/plugin/src/it/RAT-524/invoker.properties
index 1c089b46..1ed6b12b 100644
--- a/apache-rat-maven-parent/plugin/src/it/RAT-168/invoker.properties
+++ b/apache-rat-maven-parent/plugin/src/it/RAT-524/invoker.properties
@@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-invoker.goals = clean -X apache-rat:rat
+invoker.goals = clean -X apache-rat:check
diff --git a/apache-rat-plugin/src/it/RAT-524/pom.xml b/apache-rat-maven-parent/plugin/src/it/RAT-524/pom.xml
similarity index 100%
rename from apache-rat-plugin/src/it/RAT-524/pom.xml
rename to apache-rat-maven-parent/plugin/src/it/RAT-524/pom.xml
diff --git a/apache-rat-plugin/src/it/RAT-524/verify.groovy b/apache-rat-maven-parent/plugin/src/it/RAT-524/verify.groovy
similarity index 92%
rename from apache-rat-plugin/src/it/RAT-524/verify.groovy
rename to apache-rat-maven-parent/plugin/src/it/RAT-524/verify.groovy
index 51b03a62..7fe3459a 100644
--- a/apache-rat-plugin/src/it/RAT-524/verify.groovy
+++ b/apache-rat-maven-parent/plugin/src/it/RAT-524/verify.groovy
@@ -21,12 +21,12 @@ content = new File(basedir, 'build.log').text
// verify debug output
assert content.contains('BUILD SUCCESS')
assert ! content.contains('[WARNING] No resources included')
-assert content.contains('Adding [MAVEN] to input-exclude-std')
+assert content.contains('input-exclude-std MAVEN')
assert content.contains('Excluding MAVEN collection.')
// Report is in apache-rat-plugin/target/invoker-reports
// Make sure that report is generated completely
-report = new File(basedir, 'target/site/rat-report.html').text
+report = new File(basedir, 'target/rat.txt').text
assert TextUtils.isMatching("^ /verify.groovy\\s+S ", report)
assert TextUtils.isMatching("^ /pom.xml\\s+S ", report)
assert TextUtils.isMatching("^ /target\\s+I\\s+application/octet-stream\\s+\\(directory\\)", report)
diff --git a/apache-rat-maven-parent/plugin/src/it/Unapproved1/verify.groovy b/apache-rat-maven-parent/plugin/src/it/Unapproved1/verify.groovy
index fa2b8c0e..291f4d69 100644
--- a/apache-rat-maven-parent/plugin/src/it/Unapproved1/verify.groovy
+++ b/apache-rat-maven-parent/plugin/src/it/Unapproved1/verify.groovy
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import org.apache.rat.core.Reporter;
+import org.apache.rat.Reporter;
import org.apache.rat.testhelpers.data.ValidatorData;
documentFile = new File(basedir, "target/RAT/rat.xml")
@@ -38,7 +38,7 @@ assert content.contains('[DEBUG] Processing exclude file from STANDARD_SCMS.') /
assert ! content.contains('[WARNING] No resources included')
// Report is in apache-rat-plugin/target/invoker-reports
-report = new File(basedir, 'target/site/rat-report.html').text
+report = new File(basedir, 'target/rat.txt').text
assert TextUtils.isMatching("^ /verify.groovy\\s+S ", report)
assert TextUtils.isMatching("^! /pom.xml\\s+S ", report)
diff --git a/apache-rat-maven-parent/plugin/src/it/it1/verify.groovy b/apache-rat-maven-parent/plugin/src/it/it1/verify.groovy
index 434d2446..3f0d20bc 100644
--- a/apache-rat-maven-parent/plugin/src/it/it1/verify.groovy
+++ b/apache-rat-maven-parent/plugin/src/it/it1/verify.groovy
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import XmlUtils
+import org.apache.rat.testhelpers.XmlUtils
import org.w3c.dom.Document
import javax.xml.xpath.XPath
diff --git a/apache-rat-maven-parent/plugin/src/test/java/org/apache/rat/maven/MavenTestDynIT.java b/apache-rat-maven-parent/plugin/src/test/java/org/apache/rat/maven/MavenTestDynIT.java
new file mode 100644
index 00000000..235d2676
--- /dev/null
+++ b/apache-rat-maven-parent/plugin/src/test/java/org/apache/rat/maven/MavenTestDynIT.java
@@ -0,0 +1,241 @@
+package org.apache.rat.maven;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.Consumer;
+import org.apache.commons.cli.Option;
+import org.apache.maven.shared.invoker.DefaultInvocationRequest;
+import org.apache.maven.shared.invoker.DefaultInvoker;
+import org.apache.maven.shared.invoker.InvocationOutputHandler;
+import org.apache.maven.shared.invoker.InvocationRequest;
+import org.apache.maven.shared.invoker.InvocationResult;
+import org.apache.maven.shared.invoker.Invoker;
+import org.apache.maven.shared.invoker.InvokerLogger;
+import org.apache.maven.shared.invoker.MavenInvocationException;
+import org.apache.rat.Reporter;
+import org.apache.rat.api.RatException;
+import org.apache.rat.commandline.StyleSheets;
+import org.apache.rat.document.DocumentName;
+import org.apache.rat.maven.tools.TestGenerator;
+import org.apache.rat.report.claim.ClaimStatistic;
+import org.apache.rat.testhelpers.data.ReportTestDataProvider;
+import org.apache.rat.testhelpers.data.TestData;
+import org.apache.rat.testhelpers.data.ValidatorData;
+import org.junit.jupiter.api.io.TempDir;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class MavenTestDynIT {
+
+
+ private final TestGenerator testGenerator;
+ private final MavenOptionCollection optionCollection;
+ private List<TestData> testDataList;
+ private final Map<String, Consumer<ValidatorData>> validatorEditors;
+
+ public MavenTestDynIT() throws IOException {
+ testGenerator = new TestGenerator();
+ optionCollection = new MavenOptionCollection();
+ validatorEditors = new HashMap<>();
+ Set<TestData> testDataList = new ReportTestDataProvider().getOptionTests(optionCollection);
+ populateValidatorEditors();
+ }
+
+ /**
+ * Maven testing adds
+ * <ul>
+ * <li>a pom.xml with Apache 2 license to the root directory</li>
+ * <li>a .rat directory in the root directory</li>
+ * <li>one or more files in the .rat directory.</li>
+ * <li>a target directory</li>
+ * <li>a rat.txt file to the target directory</li>
+ * <li>a RAT directory to the target directory</li>
+ * <li>3 xml files in the RAT directory.</li>
+ * </ul>
+ * These have to be accounted for in the counters.
+ */
+ private void populateValidatorEditors() {
+ /* In the changes below there are overcounts verses the expected
+ counts for commandline. The changes are to decrements the counted
+ files so that they match what is expected for the command line.
+ The comment before each block of changes describes why they are changed.
+ */
+
+ // Decrements standards and approved by 1
+ Consumer<ValidatorData> stdApproved = data -> {
+ data.getStatistic().incCounter(ClaimStatistic.Counter.STANDARDS, -1);
+ data.getStatistic().incCounter(ClaimStatistic.Counter.APPROVED, -1);
+ };
+
+ // Decrements standards and ignored by 1
+ Consumer<ValidatorData> stdIgnored = data -> {
+ data.getStatistic().incCounter(ClaimStatistic.Counter.STANDARDS, -1);
+ data.getStatistic().incCounter(ClaimStatistic.Counter.IGNORED, -1);
+ };
+
+ /* POM is a standard file not found in the non-Maven test case
+ so we have to modify the STANDARD count in these cases to
+ account for it. The POM also contains the tag for ONE so
+ there is an APPROVED is also modified.
+ */
+ validatorEditors.put("config/noDefaults", stdApproved);
+ validatorEditors.put("config/withDefaults", data -> {
+ data.getStatistic().incCounter(ClaimStatistic.Counter.STANDARDS, -1);
+ // with defaults POM has 2 approved licenses
+ data.getStatistic().incCounter(ClaimStatistic.Counter.APPROVED, -2);
+ });
+ validatorEditors.put("config_DefaultTest", stdApproved);
+
+//
+// //validatorEditors.put("configuration-no-defaults", )
+
+ /* "/target" is excluded by default so the IGNORED count needs to be modified */
+ validatorEditors.put("exclude", stdIgnored);
+ validatorEditors.put("exclude-file", stdIgnored);
+ validatorEditors.put("excludeFile_DefaultTest", stdIgnored);
+ validatorEditors.put("exclude_DefaultTest", stdIgnored);
+// //validatorEditors.put("help-licenses/stdOut", )
+ validatorEditors.put("include", stdIgnored);
+ validatorEditors.put("include_DefaultTest", stdIgnored);
+ validatorEditors.put("includes-file", stdIgnored);
+ validatorEditors.put("includesFile_DefaultTest", stdIgnored);
+ validatorEditors.put("input-exclude", stdIgnored);
+ validatorEditors.put("input-exclude-file", stdIgnored);
+ validatorEditors.put("input-exclude-parsed-scm/GIT", stdIgnored);
+ validatorEditors.put("input-exclude-size", stdIgnored);
+ validatorEditors.put("input-exclude-std", stdIgnored);
+ validatorEditors.put("input-exclude/include", stdIgnored);
+ validatorEditors.put("input-exclude/includeStdValidation", stdIgnored);
+ validatorEditors.put("input-exclude/includesFile", stdIgnored);
+ validatorEditors.put("input-exclude/inputInclude", stdIgnored);
+ validatorEditors.put("input-exclude/inputIncludeFile", stdIgnored);
+ validatorEditors.put("input-include", stdIgnored);
+ validatorEditors.put("input-include-file", stdIgnored);
+ validatorEditors.put("input-include-std/hidden_dir", stdIgnored);
+ validatorEditors.put("input-include-std/hidden_file", stdIgnored);
+ validatorEditors.put("input-include-std/misc", stdIgnored);
+ //validatorEditors.put("input-source", stdIgnored);
+ validatorEditors.put("inputExcludeFile_DefaultTest", stdIgnored);
+ validatorEditors.put("inputExcludeParsedScm_DefaultTest", stdIgnored);
+ validatorEditors.put("inputExcludeSize_DefaultTest", stdIgnored);
+ // maven automatically ignores target and build.log
+ validatorEditors.put("inputExcludeStd_DefaultTest", data -> {
+ data.getStatistic().incCounter(ClaimStatistic.Counter.IGNORED, -2);
+ });
+ validatorEditors.put("inputExclude_DefaultTest", stdIgnored);
+ validatorEditors.put("inputInclude_DefaultTest", stdIgnored);
+ validatorEditors.put("inputIncludeFile_DefaultTest", stdIgnored);
+ validatorEditors.put("inputSource_DefaultTest", stdIgnored);
+
+ validatorEditors.put("license-families-approved-file/withLicenseDef", stdApproved);
+ validatorEditors.put("license-families-approved-file/withoutLicenseDef", stdApproved);
+ validatorEditors.put("license-families-approved/withLicenseDef", stdApproved);
+ validatorEditors.put("license-families-approved/withoutLicenseDef", stdApproved);
+
+ validatorEditors.put("license-families-denied", stdApproved);
+ validatorEditors.put("license-families-denied-file", stdApproved);
+ validatorEditors.put("licenseFamiliesApprovedFile_DefaultTest", stdApproved);
+ validatorEditors.put("licenseFamiliesApproved_DefaultTest", stdApproved);
+ validatorEditors.put("licenseFamiliesDeniedFile_DefaultTest", stdApproved);
+ validatorEditors.put("licenseFamiliesDenied_DefaultTest", stdApproved);
+
+ validatorEditors.put("licenses-approved-file/withLicenseDef", stdApproved);
+ validatorEditors.put("licenses-approved-file/withoutLicenseDef", stdApproved);
+ validatorEditors.put("licenses-approved/withLicenseDef", stdApproved);
+ validatorEditors.put("licenses-approved/withoutLicenseDef", stdApproved);
+
+ validatorEditors.put("licenses/noDefaults", stdApproved);
+ validatorEditors.put("licenses/withDefaults", data -> {
+ data.getStatistic().incCounter(ClaimStatistic.Counter.STANDARDS, -1);
+ // with defaults POM has 2 approved licenses
+ data.getStatistic().incCounter(ClaimStatistic.Counter.APPROVED, -2);
+ });
+ validatorEditors.put("licensesApprovedFile_DefaultTest", stdApproved);
+ validatorEditors.put("licensesApproved_DefaultTest", stdApproved);
+ validatorEditors.put("licenses_DefaultTest", stdApproved);
+
+ validatorEditors.put("out", stdApproved);
+ validatorEditors.put("output-file", stdApproved);
+
+
+ validatorEditors.put("scan-hidden-directories", stdIgnored);
+
+
+ }
+
+ private List<TestData> testsFor(Option option) {
+ return testDataList.stream().filter(td -> td.getOption() == null ? option == null : td.getOption().equals(option)).toList();
+ }
+
+ @ParameterizedTest
+ @MethodSource("testData")
+ void optionTest(TestData testData, @TempDir Path testPath) throws IOException, MavenInvocationException, RatException {
+
+ Path baseDir = testPath.resolve(testData.getTestName());
+ String pomText = testGenerator.buildPom(optionCollection, testData);
+ System.out.println(pomText);
+ testData.setupFiles(baseDir);
+ File pomFile = baseDir.resolve("pom.xml").toFile();
+ try (FileOutputStream fos = new FileOutputStream(pomFile)) {
+ fos.write(pomText.getBytes(StandardCharsets.UTF_8));
+ }
+ RecordingOutputHandler[] recordingOutputHandler = {null};
+
+ InvocationRequest request = new DefaultInvocationRequest() {
+ @Override
+ public InvocationOutputHandler getOutputHandler(InvocationOutputHandler defaultHandler) {
+ recordingOutputHandler[0] = new RecordingOutputHandler(defaultHandler);
+ return super.getOutputHandler(recordingOutputHandler[0]);
+ }
+ };
+ request.setDebug(true);
+ request.setBatchMode(true);
+ request.setBaseDirectory(baseDir.toFile());
+ request.setPomFile(pomFile);
+ request.addArg("apache-rat:check");
+
+ Invoker invoker = new DefaultInvoker();
+ InvocationResult result = invoker.execute(request);
+ if (testData.expectingException()) {
+ assertThat(result.getExitCode()).as("Result of Maven execution").isEqualTo(1);
+ List<String> entries = recordingOutputHandler[0].getLines().filter(s -> s.contains(testData.getExpectedException().getMessage()))
+ .filter(s -> s.contains("[ERROR]")).toList();
+ assertThat(entries).hasSize(1);
+ } else {
+ //assertThat(result.getExitCode()).as("Result of Maven execution").isEqualTo(0);
+ Path ratPath = baseDir.resolve("target/RAT");
+ DocumentName baseName = DocumentName.builder(baseDir.toFile()).build();
+ Reporter.Output output = Reporter.Output.builder()
+ .configuration("target/RAT/configuration.xml", baseName)
+ .document("target/RAT/rat.xml", baseName)
+ .statistic("target/RAT/claimStatistic.xml", baseName)
+ .build();
+
+ ValidatorData validatorData = new ValidatorData(output, baseDir.toString());
+ Consumer<ValidatorData> editor = validatorEditors.get(testData.toString());
+ if (editor != null) {
+ editor.accept(validatorData);
+ }
+ output.format(StyleSheets.PLAIN.getStyleSheet().ioSupplier(), output.getConfiguration().getOutput() );
+ testData.getValidator().accept(validatorData);
+ }
+ }
+
+ static Collection<TestData> testData() {
+ MavenOptionCollection optionCollection = new MavenOptionCollection();
+ List<TestData> lst = new ArrayList<>(new ReportTestDataProvider().getOptionTests(optionCollection));
+ return lst.subList(53, lst.size());
+ // return new ReportTestDataProvider().getOptionTests(optionCollection);
+ }
+}
diff --git a/apache-rat-maven-parent/plugin/src/test/java/org/apache/rat/maven/MavenTestIT.java b/apache-rat-maven-parent/plugin/src/test/java/org/apache/rat/maven/MavenTestIT.java
deleted file mode 100644
index 27a567d4..00000000
--- a/apache-rat-maven-parent/plugin/src/test/java/org/apache/rat/maven/MavenTestIT.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rat.maven;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.PrintStream;
-import java.util.Map;
-import org.apache.maven.cli.MavenCli;
-import org.apache.rat.Reporter;
-import org.apache.rat.testhelpers.data.ReportTestDataProvider;
-import org.apache.rat.testhelpers.data.TestData;
-import org.apache.rat.testhelpers.data.ValidatorData;
-import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.EnabledOnOs;
-import org.junit.jupiter.api.condition.OS;
-
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.Mockito.mock;
-
-/**
- * Tests extracted from {@link ReportTestDataProvider}.
- * DO NOT EDIT - GENERATED FILE
- */
-
-public class MavenTestIT {
-
- static ReportTestDataProvider reportTestDataProvider = new ReportTestDataProvider();
-
- final Map<String, TestData> testDataMap = reportTestDataProvider.getOptionTestMap(MavenOption.UNSUPPORTED_SET);
-
- @AfterAll
- @EnabledOnOs(OS.WINDOWS)
- static void cleanup() {
- System.gc(); // hacky workaround for windows bug.
- }
-
-
-
-/**
- * Generated test for edit-copyright/editOverwrite
- */
-@Test
-public void editCopyrightEditOverwriteTest() {
- final String MVN_HOME = "maven.multiModuleProjectDirectory";
-
- String baseDir = "target/test-classes/org/apache/rat/maven/stubs/edit-copyright/editOverwrite";
- ByteArrayOutputStream stdOut = new ByteArrayOutputStream();
- ByteArrayOutputStream stdErr = new ByteArrayOutputStream();
- MavenCli cli = new MavenCli();
- System.setProperty(MVN_HOME, baseDir);
-
- try (PrintStream stdOutStream = new PrintStream(stdOut);
- PrintStream stdErrStream = new PrintStream(stdErr)) {
- cli.doMain(new String[]{"apache-rat-plugin:check"}, baseDir, stdOutStream, stdErrStream);
- }
-
- Reporter.Output.Builder builder = Reporter.Output.builder().configuration(new File("/home/claude/apache/creadur-rat/apache-rat-maven-parent/impl/target/test-classes/org/apache/rat/maven/stubs/edit-copyright/editOverwrite/target/RAT/configuration.xml"))
- .document(new File("/home/claude/apache/creadur-rat/apache-rat-maven-parent/impl/target/test-classes/org/apache/rat/maven/stubs/edit-copyright/editOverwrite/target/RAT/rat.xml"))
- .statistic(new File("/home/claude/apache/creadur-rat/apache-rat-maven-parent/impl/target/test-classes/org/apache/rat/maven/stubs/edit-copyright/editOverwrite/target/RAT/claimStatistic.xml"));
-
-
- ValidatorData validatorData = new ValidatorData(builder.build(), baseDir);
- System.out.println(validatorData);
- //testData.getValidator().accept(validatorData2);
-}
-
-
-}
diff --git a/apache-rat-maven-parent/plugin/src/test/java/org/apache/rat/maven/MavenTestX.java b/apache-rat-maven-parent/plugin/src/test/java/org/apache/rat/maven/MavenTestX.java
deleted file mode 100644
index 8e6e3686..00000000
--- a/apache-rat-maven-parent/plugin/src/test/java/org/apache/rat/maven/MavenTestX.java
+++ /dev/null
@@ -1,1684 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.rat.maven;
-
-import java.io.File;
-import java.nio.file.Paths;
-import java.util.Map;
-import org.apache.maven.api.plugin.testing.Basedir;
-import org.apache.maven.api.plugin.testing.InjectMojo;
-import org.apache.maven.api.plugin.testing.MojoTest;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.rat.Reporter;
-import org.apache.rat.testhelpers.data.ReportTestDataProvider;
-import org.apache.rat.testhelpers.data.TestData;
-import org.apache.rat.testhelpers.data.ValidatorData;
-import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.EnabledOnOs;
-import org.junit.jupiter.api.condition.OS;
-
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-/**
- * Tests extracted from {@link ReportTestDataProvider}.
- * DO NOT EDIT - GENERATED FILE
- */
-@MojoTest
-public class MavenTestX {
-
- static ReportTestDataProvider reportTestDataProvider = new ReportTestDataProvider();
-
- final Map<String, TestData> testDataMap = reportTestDataProvider.getOptionTestMap(MavenOption.UNSUPPORTED_SET);
-
- @AfterAll
- @EnabledOnOs(OS.WINDOWS)
- static void cleanup() {
- System.gc(); // hacky workaround for windows bug.
- }
-
-
-///**
-// * Generated test for config/noDefaults
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/config/noDefaults")
-//public void configNoDefaultsTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/config/noDefaults";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("config/noDefaults");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for config/withDefaults
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/config/withDefaults")
-//public void configWithDefaultsTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/config/withDefaults";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("config/withDefaults");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for config_DefaultTest
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/config_DefaultTest")
-//public void config_DefaultTestTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/config_DefaultTest";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("config_DefaultTest");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for configuration-no-defaults
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/configuration-no-defaults")
-//public void configurationNoDefaultsTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/configuration-no-defaults";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("configuration-no-defaults");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for counter-max/Unapproved1
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/counter-max/Unapproved1")
-//public void counterMaxUnapproved1Test(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/counter-max/Unapproved1";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("counter-max/Unapproved1");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for counter-min
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/counter-min")
-//public void counterMinTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/counter-min";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("counter-min");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for counterMax_DefaultTest
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/counterMax_DefaultTest")
-//void counterMax_DefaultTestTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/counterMax_DefaultTest";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("counterMax_DefaultTest");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for counterMin_DefaultTest
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/counterMin_DefaultTest")
-//public void counterMin_DefaultTestTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/counterMin_DefaultTest";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("counterMin_DefaultTest");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for dry-run/stdRun
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/dry-run/stdRun")
-//public void dryRunStdRunTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/dry-run/stdRun";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("dry-run/stdRun");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for dryRun_DefaultTest
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/dryRun_DefaultTest")
-//public void dryRun_DefaultTestTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/dryRun_DefaultTest";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("dryRun_DefaultTest");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for edit-copyright/dryRun
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/edit-copyright/dryRun")
-//public void editCopyrightDryRunTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/edit-copyright/dryRun";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("edit-copyright/dryRun");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for edit-copyright/editLicense
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/edit-copyright/editLicense")
-//public void editCopyrightEditLicenseTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/edit-copyright/editLicense";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("edit-copyright/editLicense");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-
-/**
- * Generated test for edit-copyright/editOverwrite
- */
-@Test
-@InjectMojo(goal = "check")
-@Basedir("target/test-classes/org/apache/rat/maven/stubs/edit-copyright/editOverwrite")
-public void editCopyrightEditOverwriteTest(RatCheckMojo mojo) throws MojoExecutionException {
- String baseDir = "target/test-classes/org/apache/rat/maven/stubs/edit-copyright/editOverwrite";
- when(mojo.project.getBuild()).thenReturn(mock());
- when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
- TestData testData = testDataMap.get("edit-copyright/editOverwrite");
- testData.setupFiles(Paths.get(baseDir));
- if (testData.getExpectedException() != null) {
- assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
- } else {
- try {
- mojo.execute();
- ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
- } finally {
-
- Reporter.Output.Builder builder = Reporter.Output.builder().configuration(new File("/home/claude/apache/creadur-rat/apache-rat-maven-parent/impl/target/test-classes/org/apache/rat/maven/stubs/edit-copyright/editOverwrite/target/RAT/configuration.xml"))
- .document(new File("/home/claude/apache/creadur-rat/apache-rat-maven-parent/impl/target/test-classes/org/apache/rat/maven/stubs/edit-copyright/editOverwrite/target/RAT/rat.xml"))
- .statistic(new File("/home/claude/apache/creadur-rat/apache-rat-maven-parent/impl/target/test-classes/org/apache/rat/maven/stubs/edit-copyright/editOverwrite/target/RAT/claimStatistic.xml"));
-
-
- ValidatorData validatorData2 = new ValidatorData(builder.build(), baseDir);
- testData.getValidator().accept(validatorData2);
- }
- }
-}
-//
-///**
-// * Generated test for edit-copyright/noEditLicense
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/edit-copyright/noEditLicense")
-//public void editCopyrightNoEditLicenseTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/edit-copyright/noEditLicense";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("edit-copyright/noEditLicense");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for edit-license
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/edit-license")
-//public void editLicenseTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/edit-license";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("edit-license");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for edit-overwrite
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/edit-overwrite")
-//public void editOverwriteTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/edit-overwrite";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("edit-overwrite");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for edit-overwrite/noEditLicense
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/edit-overwrite/noEditLicense")
-//public void editOverwriteNoEditLicenseTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/edit-overwrite/noEditLicense";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("edit-overwrite/noEditLicense");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for help-licenses/stdOut
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/help-licenses/stdOut")
-//public void helpLicensesStdOutTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/help-licenses/stdOut";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("help-licenses/stdOut");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for input-exclude
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/input-exclude")
-//public void inputExcludeTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/input-exclude";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("input-exclude");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for input-exclude-file
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/input-exclude-file")
-//public void inputExcludeFileTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/input-exclude-file";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("input-exclude-file");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for input-exclude-parsed-scm/GIT
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/input-exclude-parsed-scm/GIT")
-//public void inputExcludeParsedScmGITTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/input-exclude-parsed-scm/GIT";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("input-exclude-parsed-scm/GIT");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for input-exclude-size
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/input-exclude-size")
-//public void inputExcludeSizeTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/input-exclude-size";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("input-exclude-size");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for input-exclude-std
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/input-exclude-std")
-//public void inputExcludeStdTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/input-exclude-std";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("input-exclude-std");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for input-exclude/includeStdValidation
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/input-exclude/includeStdValidation")
-//public void inputExcludeIncludeStdValidationTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/input-exclude/includeStdValidation";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("input-exclude/includeStdValidation");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for input-exclude/inputInclude
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/input-exclude/inputInclude")
-//public void inputExcludeInputIncludeTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/input-exclude/inputInclude";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("input-exclude/inputInclude");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for input-exclude/inputIncludeFile
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/input-exclude/inputIncludeFile")
-//public void inputExcludeInputIncludeFileTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/input-exclude/inputIncludeFile";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("input-exclude/inputIncludeFile");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for input-include
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/input-include")
-//public void inputIncludeTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/input-include";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("input-include");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for input-include-file
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/input-include-file")
-//public void inputIncludeFileTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/input-include-file";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("input-include-file");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for input-include-std/hidden_dir
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/input-include-std/hidden_dir")
-//public void inputIncludeStdHidden_dirTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/input-include-std/hidden_dir";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("input-include-std/hidden_dir");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for input-include-std/hidden_file
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/input-include-std/hidden_file")
-//public void inputIncludeStdHidden_fileTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/input-include-std/hidden_file";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("input-include-std/hidden_file");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for input-include-std/misc
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/input-include-std/misc")
-//public void inputIncludeStdMiscTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/input-include-std/misc";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("input-include-std/misc");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for input-source
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/input-source")
-//public void inputSourceTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/input-source";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("input-source");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for inputExcludeFile_DefaultTest
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/inputExcludeFile_DefaultTest")
-//public void inputExcludeFile_DefaultTestTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/inputExcludeFile_DefaultTest";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("inputExcludeFile_DefaultTest");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for inputExcludeParsedScm_DefaultTest
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/inputExcludeParsedScm_DefaultTest")
-//public void inputExcludeParsedScm_DefaultTestTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/inputExcludeParsedScm_DefaultTest";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("inputExcludeParsedScm_DefaultTest");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for inputExcludeSize_DefaultTest
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/inputExcludeSize_DefaultTest")
-//public void inputExcludeSize_DefaultTestTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/inputExcludeSize_DefaultTest";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("inputExcludeSize_DefaultTest");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for inputExcludeStd_DefaultTest
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/inputExcludeStd_DefaultTest")
-//public void inputExcludeStd_DefaultTestTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/inputExcludeStd_DefaultTest";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("inputExcludeStd_DefaultTest");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for inputExclude_DefaultTest
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/inputExclude_DefaultTest")
-//public void inputExclude_DefaultTestTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/inputExclude_DefaultTest";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("inputExclude_DefaultTest");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for inputIncludeFile_DefaultTest
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/inputIncludeFile_DefaultTest")
-//public void inputIncludeFile_DefaultTestTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/inputIncludeFile_DefaultTest";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("inputIncludeFile_DefaultTest");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for inputInclude_DefaultTest
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/inputInclude_DefaultTest")
-//public void inputInclude_DefaultTestTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/inputInclude_DefaultTest";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("inputInclude_DefaultTest");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for inputSource_DefaultTest
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/inputSource_DefaultTest")
-//public void inputSource_DefaultTestTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/inputSource_DefaultTest";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("inputSource_DefaultTest");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for license-families-approved-file/withLicenseDef
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/license-families-approved-file/withLicenseDef")
-//public void licenseFamiliesApprovedFileWithLicenseDefTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/license-families-approved-file/withLicenseDef";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("license-families-approved-file/withLicenseDef");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for license-families-approved-file/withoutLicenseDef
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/license-families-approved-file/withoutLicenseDef")
-//public void licenseFamiliesApprovedFileWithoutLicenseDefTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/license-families-approved-file/withoutLicenseDef";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("license-families-approved-file/withoutLicenseDef");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for license-families-approved/withLicenseDef
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/license-families-approved/withLicenseDef")
-//public void licenseFamiliesApprovedWithLicenseDefTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/license-families-approved/withLicenseDef";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("license-families-approved/withLicenseDef");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for license-families-approved/withoutLicenseDef
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/license-families-approved/withoutLicenseDef")
-//public void licenseFamiliesApprovedWithoutLicenseDefTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/license-families-approved/withoutLicenseDef";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("license-families-approved/withoutLicenseDef");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for license-families-denied
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/license-families-denied")
-//public void licenseFamiliesDeniedTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/license-families-denied";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("license-families-denied");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for license-families-denied-file
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/license-families-denied-file")
-//public void licenseFamiliesDeniedFileTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/license-families-denied-file";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("license-families-denied-file");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for licenseFamiliesApprovedFile_DefaultTest
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/licenseFamiliesApprovedFile_DefaultTest")
-//public void licenseFamiliesApprovedFile_DefaultTestTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/licenseFamiliesApprovedFile_DefaultTest";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("licenseFamiliesApprovedFile_DefaultTest");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for licenseFamiliesApproved_DefaultTest
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/licenseFamiliesApproved_DefaultTest")
-//public void licenseFamiliesApproved_DefaultTestTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/licenseFamiliesApproved_DefaultTest";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("licenseFamiliesApproved_DefaultTest");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for licenseFamiliesDeniedFile_DefaultTest
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/licenseFamiliesDeniedFile_DefaultTest")
-//public void licenseFamiliesDeniedFile_DefaultTestTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/licenseFamiliesDeniedFile_DefaultTest";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("licenseFamiliesDeniedFile_DefaultTest");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for licenseFamiliesDenied_DefaultTest
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/licenseFamiliesDenied_DefaultTest")
-//public void licenseFamiliesDenied_DefaultTestTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/licenseFamiliesDenied_DefaultTest";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("licenseFamiliesDenied_DefaultTest");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for licenses-approved-file/withLicenseDef
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/licenses-approved-file/withLicenseDef")
-//public void licensesApprovedFileWithLicenseDefTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/licenses-approved-file/withLicenseDef";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("licenses-approved-file/withLicenseDef");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for licenses-approved-file/withoutLicenseDef
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/licenses-approved-file/withoutLicenseDef")
-//public void licensesApprovedFileWithoutLicenseDefTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/licenses-approved-file/withoutLicenseDef";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("licenses-approved-file/withoutLicenseDef");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for licenses-approved/withLicenseDef
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/licenses-approved/withLicenseDef")
-//public void licensesApprovedWithLicenseDefTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/licenses-approved/withLicenseDef";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("licenses-approved/withLicenseDef");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for licenses-approved/withoutLicenseDef
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/licenses-approved/withoutLicenseDef")
-//public void licensesApprovedWithoutLicenseDefTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/licenses-approved/withoutLicenseDef";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("licenses-approved/withoutLicenseDef");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for licenses-denied-file/ILLUMOS
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/licenses-denied-file/ILLUMOS")
-//public void licensesDeniedFileILLUMOSTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/licenses-denied-file/ILLUMOS";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("licenses-denied-file/ILLUMOS");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for licenses-denied/ILLUMOS
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/licenses-denied/ILLUMOS")
-//public void licensesDeniedILLUMOSTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/licenses-denied/ILLUMOS";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("licenses-denied/ILLUMOS");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for licensesApprovedFile_DefaultTest
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/licensesApprovedFile_DefaultTest")
-//public void licensesApprovedFile_DefaultTestTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/licensesApprovedFile_DefaultTest";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("licensesApprovedFile_DefaultTest");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for licensesApproved_DefaultTest
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/licensesApproved_DefaultTest")
-//public void licensesApproved_DefaultTestTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/licensesApproved_DefaultTest";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("licensesApproved_DefaultTest");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-archive/absence
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-archive/absence")
-//public void outputArchiveAbsenceTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-archive/absence";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-archive/absence");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-archive/notification
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-archive/notification")
-//public void outputArchiveNotificationTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-archive/notification";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-archive/notification");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-archive/presence
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-archive/presence")
-//public void outputArchivePresenceTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-archive/presence";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-archive/presence");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-families/all
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-families/all")
-//public void outputFamiliesAllTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-families/all";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-families/all");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-families/approved
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-families/approved")
-//public void outputFamiliesApprovedTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-families/approved";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-families/approved");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-families/none
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-families/none")
-//public void outputFamiliesNoneTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-families/none";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-families/none");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-file
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-file")
-//public void outputFileTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-file";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-file");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-licenses/ALL
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-licenses/ALL")
-//public void outputLicensesALLTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-licenses/ALL";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-licenses/ALL");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-licenses/APPROVED
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-licenses/APPROVED")
-//public void outputLicensesAPPROVEDTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-licenses/APPROVED";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-licenses/APPROVED");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-licenses/NONE
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-licenses/NONE")
-//public void outputLicensesNONETest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-licenses/NONE";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-licenses/NONE");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-standard/absence
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-standard/absence")
-//public void outputStandardAbsenceTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-standard/absence";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-standard/absence");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-standard/notification
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-standard/notification")
-//public void outputStandardNotificationTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-standard/notification";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-standard/notification");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-standard/presence
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-standard/presence")
-//public void outputStandardPresenceTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-standard/presence";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-standard/presence");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-style/fileStyleSheet
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-style/fileStyleSheet")
-//public void outputStyleFileStyleSheetTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-style/fileStyleSheet";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-style/fileStyleSheet");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-style/missing_headers
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-style/missing_headers")
-//public void outputStyleMissing_headersTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-style/missing_headers";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-style/missing_headers");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-style/plain
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-style/plain")
-//public void outputStylePlainTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-style/plain";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-style/plain");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-style/unapproved_licenses
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-style/unapproved_licenses")
-//public void outputStyleUnapproved_licensesTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-style/unapproved_licenses";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-style/unapproved_licenses");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-style/xhtml5
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-style/xhtml5")
-//public void outputStyleXhtml5Test(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-style/xhtml5";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-style/xhtml5");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-//
-///**
-// * Generated test for output-style/xml
-// */
-//@Test
-//@InjectMojo(goal = "check")
-//@Basedir("target/test-classes/org/apache/rat/maven/stubs/output-style/xml")
-//public void outputStyleXmlTest(RatCheckMojo mojo) throws MojoExecutionException {
-// String baseDir = "target/test-classes/org/apache/rat/maven/stubs/output-style/xml";
-// when(mojo.project.getBuild()).thenReturn(mock());
-// when(mojo.project.getBuild().getDirectory()).thenReturn(baseDir + "/target");
-// TestData testData = testDataMap.get("output-style/xml");
-// testData.setupFiles(Paths.get(baseDir));
-// if (testData.getExpectedException() != null) {
-// assertThatThrownBy(mojo::execute).hasMessageContaining(testData.getExpectedException().getMessage());
-// } else {
-// mojo.execute();
-// ValidatorData validatorData = new ValidatorData(mojo.getOutput(), baseDir);
-// testData.getValidator().accept(validatorData);
-// }
-//}
-
-}
diff --git a/apache-rat-maven-parent/plugin/src/test/java/org/apache/rat/maven/RatCheckMojoTest.java b/apache-rat-maven-parent/plugin/src/test/java/org/apache/rat/maven/RatCheckMojoTest.java
deleted file mode 100644
index 9abbaac0..00000000
--- a/apache-rat-maven-parent/plugin/src/test/java/org/apache/rat/maven/RatCheckMojoTest.java
+++ /dev/null
@@ -1,475 +0,0 @@
-///*
-// * Licensed to the Apache Software Foundation (ASF) under one or more
-// * contributor license agreements. See the NOTICE file distributed with
-// * this work for additional information regarding copyright ownership.
-// * The ASF licenses this file to You under the Apache License, Version 2.0
-// * (the "License"); you may not use this file except in compliance with
-// * the License. You may obtain a copy of the License at
-// *
-// * http://www.apache.org/licenses/LICENSE-2.0
-// *
-// * Unless required by applicable law or agreed to in writing, software
-// * distributed under the License is distributed on an "AS IS" BASIS,
-// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// * See the License for the specific language governing permissions and
-// * limitations under the License.
-// */
-//package org.apache.rat.maven;
-//
-//import static java.lang.String.format;
-//import static java.nio.charset.StandardCharsets.UTF_8;
-//import static org.apache.rat.mp.RatTestHelpers.ensureRatReportIsCorrect;
-//import static org.assertj.core.api.Assertions.assertThat;
-//import static org.assertj.core.api.Fail.fail;
-//
-//import java.io.File;
-//
-//import java.io.IOException;
-//import java.nio.file.Files;
-//import java.nio.file.Path;
-//import java.util.ArrayList;
-//import java.util.Arrays;
-//import java.util.HashMap;
-//import java.util.List;
-//import java.util.Map;
-//import javax.xml.xpath.XPath;
-//import javax.xml.xpath.XPathFactory;
-//import org.apache.commons.io.FileUtils;
-//import org.apache.rat.ReportConfiguration;
-//import org.apache.rat.ReportConfigurationTest;
-//import org.apache.rat.ReporterTestUtils;
-//import org.apache.rat.api.Document;
-//import org.apache.rat.commandline.Arg;
-//import org.apache.rat.license.ILicenseFamily;
-//import org.apache.rat.license.LicenseSetFactory;
-//import org.apache.rat.license.LicenseSetFactory.LicenseFilter;
-//import org.apache.rat.mp.OptionMojoTest;
-//import org.apache.rat.report.claim.ClaimStatistic;
-//import org.apache.rat.test.utils.Resources;
-//import org.apache.rat.testhelpers.TextUtils;
-//import org.apache.rat.testhelpers.XmlUtils;
-//import org.junit.jupiter.api.AfterAll;
-//import org.junit.jupiter.api.Assertions;
-//import org.junit.jupiter.api.Test;
-//import org.junit.jupiter.api.condition.EnabledOnOs;
-//import org.junit.jupiter.api.condition.OS;
-//import org.junit.jupiter.api.io.TempDir;
-//import org.w3c.dom.NamedNodeMap;
-//import org.w3c.dom.NodeList;
-//
-///**
-// * Test case for the {@link RatCheckMojo} and {@link RatReportMojo}.
-// */
-//public class RatCheckMojoTest {
-//
-// @TempDir
-// static Path tempDir;
-//
-// private final static XPath xPath = XPathFactory.newInstance().newXPath();
-//
-// @AfterAll
-// @EnabledOnOs(OS.WINDOWS)
-// static void cleanup() {
-// System.gc(); // hacky workaround for windows bug.
-// }
-//
-// private RatCheckMojo getMojo(File pomFile) throws IOException {
-// try {
-// final RatCheckMojo mojo = new OptionMojoTest.SimpleMojoTestcase() {
-// }.getMojo(pomFile);
-// Assertions.assertNotNull(mojo);
-// return mojo;
-// } catch (IOException e) {
-// throw e;
-// } catch (Exception e) {
-// throw new IOException(format("Unable to generate mojo for %s", pomFile), e);
-// }
-// }
-//
-// /**
-// * Creates a new instance of {@link AbstractRatMojo}.
-// *
-// * @param testDir The directory, where to look for a pom.xml file.
-// * copy location.
-// * @return The configured Mojo.
-// * @throws Exception An error occurred while creating the Mojo.
-// */
-// private RatCheckMojo newRatMojo(String testDir) throws Exception {
-// Arg.reset();
-// final File sourceDir = Resources.getResourceDirectory(format("unit/%s", testDir));
-// final File baseDir = tempDir.resolve(testDir).toFile();
-// FileUtils.copyDirectory(sourceDir, baseDir);
-// final File pomFile = new File(baseDir, "pom.xml");
-// RatCheckMojo mojo = getMojo(pomFile);
-// assertThat(mojo).isNotNull();
-// assertThat(mojo.getProject())
-// .as("The mojo is missing its MavenProject, which will result in an NPE during RAT runs.")
-// .isNotNull();
-//
-// File buildDirectory = new File(baseDir, "target");
-// assertThat(buildDirectory.mkdirs()).isTrue();
-// final File ratTxtFile = new File(buildDirectory, "rat.txt");
-// FileUtils.write(ratTxtFile, "", UTF_8); // Ensure the output file exists and is empty (rerunning the test will append)
-// mojo.setOutputFile(ratTxtFile.getAbsolutePath());
-// return mojo;
-// }
-//
-// /**
-// * Runs a check, which should expose no problems.
-// *
-// * @throws Exception The test failed.
-// */
-// @Test
-// void it1() throws Exception {
-// final RatCheckMojo mojo = newRatMojo("it1");
-// final File ratTxtFile = mojo.getRatTxtFile();
-//
-// ReportConfiguration config = mojo.getConfiguration();
-// ReportConfigurationTest.validateDefault(config);
-//
-// mojo.execute();
-// Map<ClaimStatistic.Counter, String> data = new HashMap<>();
-// data.put(ClaimStatistic.Counter.ARCHIVES, "0");
-// data.put(ClaimStatistic.Counter.APPROVED, "1");
-// data.put(ClaimStatistic.Counter.BINARIES, "0");
-// data.put(ClaimStatistic.Counter.DOCUMENT_TYPES, "2");
-// data.put(ClaimStatistic.Counter.IGNORED, "2");
-// data.put(ClaimStatistic.Counter.LICENSE_CATEGORIES, "1");
-// data.put(ClaimStatistic.Counter.LICENSE_NAMES, "1");
-// data.put(ClaimStatistic.Counter.NOTICES, "0");
-// data.put(ClaimStatistic.Counter.STANDARDS, "1");
-// data.put(ClaimStatistic.Counter.UNAPPROVED, "0");
-// data.put(ClaimStatistic.Counter.UNKNOWN, "0");
-//
-// org.w3c.dom.Document document = XmlUtils.toDom(Files.newInputStream(ratTxtFile.toPath()));
-// XPath xPath = XPathFactory.newInstance().newXPath();
-//
-// for (ClaimStatistic.Counter counter : ClaimStatistic.Counter.values()) {
-// String xpath = String.format("/rat-report/statistics/statistic[@name='%s']", counter.displayName());
-// Map<String, String> map = mapOf("approval", "true", "count", data.get(counter),
-// "description", counter.getDescription());
-// XmlUtils.assertAttributes(document, xPath, xpath, map);
-// }
-//
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/resource[@name='/.bzrignore']",
-// mapOf("mediaType", "application/octet-stream", "type", "IGNORED"));
-//
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/resource[@name='/pom.xml']",
-// mapOf("mediaType", "application/xml", "type", "STANDARD", "encoding", "ISO-8859-1"));
-// }
-//
-// private static Map<String, String> mapOf(String... parts) {
-// Map<String, String> map = new HashMap<>();
-// for (int i = 0; i < parts.length; i += 2) {
-// map.put(parts[i], parts[i + 1]);
-// }
-// return map;
-// }
-//
-// /**
-// * Runs a check, which should detect a problem.
-// *
-// * @throws Exception The test failed.
-// */
-// @Test
-// void it2() throws Exception {
-// final RatCheckMojo mojo = newRatMojo("it2");
-// final File ratTxtFile = mojo.getRatTxtFile();
-// final String[] expected = {
-// "^Files with unapproved licenses\\s+\\*+\\s+\\Q/src.txt\\E\\s+",
-// ReporterTestUtils.counterText(ClaimStatistic.Counter.NOTICES, 0, false),
-// ReporterTestUtils.counterText(ClaimStatistic.Counter.BINARIES, 0, false),
-// ReporterTestUtils.counterText(ClaimStatistic.Counter.ARCHIVES, 0, false),
-// ReporterTestUtils.counterText(ClaimStatistic.Counter.STANDARDS, 2, false),
-// ReporterTestUtils.counterText(ClaimStatistic.Counter.IGNORED, 1, false),
-// ReporterTestUtils.apacheLicenseVersion2(1),
-// ReporterTestUtils.unknownLicense(1),
-// ReporterTestUtils.documentOut(false, Document.Type.STANDARD, "/src.txt") +
-// ReporterTestUtils.UNKNOWN_LICENSE,
-// ReporterTestUtils.documentOut(true, Document.Type.STANDARD, "/pom.xml") +
-// ReporterTestUtils.APACHE_LICENSE
-// };
-// try {
-// mojo.execute();
-// fail("Expected RatCheckException");
-// } catch (RatCheckException e) {
-// final String msg = e.getMessage();
-// assertThat(msg.contains(ratTxtFile.getName())).as(() -> format("report filename was not contained in '%s'", msg))
-// .isTrue();
-// assertThat(msg.toUpperCase()).contains("UNAPPROVED EXCEEDED MINIMUM");
-//
-// ensureRatReportIsCorrect(ratTxtFile, expected, TextUtils.EMPTY);
-// }
-// }
-//
-// /**
-// * Tests adding license headers.
-// */
-// @Test
-// void it3() throws Exception {
-// final RatCheckMojo mojo = newRatMojo("it3");
-// final File ratTxtFile = mojo.getRatTxtFile();
-//
-// ReportConfiguration config = mojo.getConfiguration();
-// assertThat(config.isAddingLicenses()).as("should be adding licenses").isTrue();
-// mojo.execute();
-// org.w3c.dom.Document document = XmlUtils.toDom(Files.newInputStream(ratTxtFile.toPath()));
-//
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/resource[@name='/pom.xml']", "type",
-// "STANDARD");
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/resource[@name='/src.apt']", "type",
-// "STANDARD");
-// XmlUtils.assertIsPresent(document, xPath, "/rat-report/resource[@name='/src.apt']/license[@approval='false']");
-//
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/resource[@name='/src.apt']", "type",
-// "STANDARD");
-//
-// for (Document.Type type : Document.Type.values()) {
-// if (type == Document.Type.STANDARD) {
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/statistics/documentType[@name='STANDARD']", "count",
-// "2");
-// } else if (type == Document.Type.IGNORED) {
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/statistics/documentType[@name='IGNORED']", "count",
-// "1");
-// } else {
-// XmlUtils.assertIsNotPresent(document, xPath, format("/rat-report/statistics/documentType[@name='%s']", type));
-// }
-// }
-// }
-//
-// /**
-// * Tests defining licenses in configuration
-// */
-// @Test
-// void it5() throws Exception {
-// final RatCheckMojo mojo = newRatMojo("it5");
-// final File ratTxtFile = mojo.getRatTxtFile();
-//
-// ReportConfiguration config = mojo.getConfiguration();
-// assertThat(config.isAddingLicenses()).as("Should not be adding licenses").isFalse();
-// assertThat(config.isAddingLicensesForced()).as("Should not be forcing licenses").isFalse();
-//
-// ReportConfigurationTest.validateDefaultApprovedLicenses(config, 1);
-// assertThat(config.getLicenseCategories(LicenseFilter.APPROVED)).doesNotContain(ILicenseFamily.makeCategory("YAL"))
-// .contains(ILicenseFamily.makeCategory("CC"));
-// ReportConfigurationTest.validateDefaultLicenseFamilies(config, "YAL", "CC");
-// assertThat(LicenseSetFactory.familySearch("YAL", config.getLicenseFamilies(LicenseFilter.APPROVED))).isNull();
-// assertThat(LicenseSetFactory.familySearch("YAL", config.getLicenseFamilies(LicenseFilter.ALL))).isNotNull();
-// assertThat(LicenseSetFactory.familySearch("CC", config.getLicenseFamilies(LicenseFilter.APPROVED))).isNotNull();
-// assertThat(LicenseSetFactory.familySearch("CC", config.getLicenseFamilies(LicenseFilter.ALL))).isNotNull();
-//
-// ReportConfigurationTest.validateDefaultLicenses(config, "CC-BY-NC-ND", "YAL");
-// assertThat(LicenseSetFactory.search("YAL", "YAL", config.getLicenses(LicenseFilter.ALL))).isPresent();
-//
-// mojo.execute();
-//
-// Map<ClaimStatistic.Counter, String> data = new HashMap<>();
-// data.put(ClaimStatistic.Counter.APPROVED, "1");
-// data.put(ClaimStatistic.Counter.ARCHIVES, "0");
-// data.put(ClaimStatistic.Counter.BINARIES, "0");
-// data.put(ClaimStatistic.Counter.DOCUMENT_TYPES, "2");
-// data.put(ClaimStatistic.Counter.IGNORED, "3");
-// data.put(ClaimStatistic.Counter.LICENSE_CATEGORIES, "1");
-// data.put(ClaimStatistic.Counter.LICENSE_NAMES, "1");
-// data.put(ClaimStatistic.Counter.NOTICES, "0");
-// data.put(ClaimStatistic.Counter.STANDARDS, "1");
-// data.put(ClaimStatistic.Counter.UNAPPROVED, "0");
-// data.put(ClaimStatistic.Counter.UNKNOWN, "0");
-//
-// org.w3c.dom.Document document = XmlUtils.toDom(Files.newInputStream(ratTxtFile.toPath()));
-// XPath xPath = XPathFactory.newInstance().newXPath();
-//
-// for (ClaimStatistic.Counter counter : ClaimStatistic.Counter.values()) {
-// String xpath = String.format("/rat-report/statistics/statistic[@name='%s']", counter.displayName());
-// Map<String, String> map = mapOf("approval",
-// "true",
-// "count", data.get(counter),
-// "description", counter.getDescription());
-// XmlUtils.assertAttributes(document, xPath, xpath, map);
-// }
-//
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/resource[@name='/.rat']",
-// "mediaType", "application/octet-stream", "type", "IGNORED", "isDirectory", "true");
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/resource[@name='/pom.xml']",
-// "mediaType", "application/xml", "type", "IGNORED", "isDirectory", "false");
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/resource[@name='/src/main/java/nl/basjes/something/Something.java']",
-// "mediaType", "text/x-java-source", "type", "STANDARD", "encoding", "ISO-8859-1");
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/resource[@name='/src/main/java/nl/basjes/something/Something.java']/license",
-// "approval", "true", "family", ILicenseFamily.makeCategory("CC"), "id", "CC-BY-NC-ND", "name",
-// "Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International");
-// }
-//
-// /**
-// * Runs a check, which should expose no problems.
-// *
-// * @throws Exception The test failed.
-// */
-// @Test
-// void rat343() throws Exception {
-// final RatCheckMojo mojo = newRatMojo("RAT-343");
-// final File ratTxtFile = mojo.getRatTxtFile();
-// // POM reports AL, BSD and CC BYas BSD because it contains the BSD and CC BY strings
-// final String[] expected = {
-// ReporterTestUtils.documentOut(false, Document.Type.STANDARD, "/pom.xml") +
-// ReporterTestUtils.APACHE_LICENSE +
-// ReporterTestUtils.licenseOut("BSD", "BSD") +
-// ReporterTestUtils.licenseOut("CC BY", "Creative Commons Attribution (Unapproved)"),
-// ReporterTestUtils.counterText(ClaimStatistic.Counter.NOTICES, 0, false),
-// ReporterTestUtils.counterText(ClaimStatistic.Counter.BINARIES, 0, false),
-// ReporterTestUtils.counterText(ClaimStatistic.Counter.ARCHIVES, 0, false),
-// ReporterTestUtils.counterText(ClaimStatistic.Counter.STANDARDS, 1, false),
-// ReporterTestUtils.counterText(ClaimStatistic.Counter.IGNORED, 1, false),
-// ReporterTestUtils.apacheLicenseVersion2(1),
-// "^BSD: 1 ",
-// "^Creative Commons Attribution: 1 ",
-// };
-// final String[] notExpected = {
-// "^Unknown License:"
-// };
-//
-// ReportConfiguration config = mojo.getConfiguration();
-// // validate configuration
-// assertThat(config.isAddingLicenses()).isFalse();
-// assertThat(config.isAddingLicensesForced()).isFalse();
-// assertThat(config.getCopyrightMessage()).isNull();
-// assertThat(config.getStyleSheet()).withFailMessage("Stylesheet should not be null").isNotNull();
-//
-// ReportConfigurationTest.validateDefaultApprovedLicenses(config, 1);
-// ReportConfigurationTest.validateDefaultLicenseFamilies(config, "BSD", "CC BY");
-// ReportConfigurationTest.validateDefaultLicenses(config, "BSD", "CC BY");
-//
-// mojo.execute();
-// ensureRatReportIsCorrect(ratTxtFile, expected, notExpected);
-// }
-//
-// /**
-// * Tests verifying gitignore parsing
-// */
-// @Test
-// void rat335() throws Exception {
-// final RatCheckMojo mojo = newRatMojo("RAT-335");
-// final File ratTxtFile = mojo.getRatTxtFile();
-// try {
-// mojo.execute();
-// fail("Expected RatCheckException");
-// } catch (RatCheckException e) {
-// final String msg = e.getMessage();
-// assertThat(msg).contains(ratTxtFile.getName());
-// assertThat(msg).contains("UNAPPROVED exceeded minimum");
-//
-// Map<ClaimStatistic.Counter, String> data = new HashMap<>();
-// data.put(ClaimStatistic.Counter.APPROVED, "1");
-// data.put(ClaimStatistic.Counter.ARCHIVES, "0");
-// data.put(ClaimStatistic.Counter.BINARIES, "0");
-// data.put(ClaimStatistic.Counter.DOCUMENT_TYPES, "3");
-// data.put(ClaimStatistic.Counter.IGNORED, "6");
-// data.put(ClaimStatistic.Counter.LICENSE_CATEGORIES, "2");
-// data.put(ClaimStatistic.Counter.LICENSE_NAMES, "2");
-// data.put(ClaimStatistic.Counter.NOTICES, "1");
-// data.put(ClaimStatistic.Counter.STANDARDS, "5");
-// data.put(ClaimStatistic.Counter.UNAPPROVED, "4");
-// data.put(ClaimStatistic.Counter.UNKNOWN, "4");
-//
-// org.w3c.dom.Document document = XmlUtils.toDom(Files.newInputStream(ratTxtFile.toPath()));
-//
-// for (ClaimStatistic.Counter counter : ClaimStatistic.Counter.values()) {
-// String xpath = String.format("/rat-report/statistics/statistic[@name='%s']", counter.displayName());
-// Map<String, String> map = mapOf("approval",
-// counter == ClaimStatistic.Counter.UNAPPROVED ? "false" : "true",
-// "count", data.get(counter),
-// "description", counter.getDescription());
-// XmlUtils.assertAttributes(document, xPath, xpath, map);
-// }
-//
-// // license categories
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/statistics/licenseCategory[@name='?????']",
-// mapOf("count", "4"));
-//
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/statistics/licenseCategory[@name='AL ']",
-// mapOf("count", "1"));
-//
-// // license names
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/statistics/licenseName[@name='Apache License 2.0']",
-// mapOf("count", "1"));
-//
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/statistics/licenseName[@name='Unknown license']",
-// mapOf("count", "4"));
-//
-// // Document types
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/statistics/documentType[@name='IGNORED']",
-// mapOf("count", "6"));
-//
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/statistics/documentType[@name='NOTICE']",
-// mapOf("count", "1"));
-//
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/statistics/documentType[@name='STANDARD']",
-// mapOf("count", "5"));
-//
-// List<String> ignoredFiles = new ArrayList<>(Arrays.asList(
-// "/dir1/dir1.txt",
-// "/dir1/.gitignore",
-// "/dir2/dir2.md",
-// "/dir3/dir3.log",
-// "/.gitignore",
-// "/root.md"));
-//
-// NodeList nodeList = XmlUtils.getNodeList(document, xPath, "/rat-report/resource[@type='IGNORED']");
-// for (int i = 0; i < nodeList.getLength(); i++) {
-// NamedNodeMap attr = nodeList.item(i).getAttributes();
-// String s = attr.getNamedItem("name").getNodeValue();
-// assertThat(ignoredFiles).contains(s);
-// ignoredFiles.remove(s);
-// }
-// assertThat(ignoredFiles).isEmpty();
-// }
-// }
-//
-// /**
-// * Tests verifying gitignore parsing under a special edge case condition
-// * The problem occurs when '/foo.md' is to be ignored and a file with that name exists
-// * in a directory which is the project base directory twice concatenated.
-// * So for this test we must create such a file which is specific for the current
-// * working directory.
-// */
-// @Test
-// void rat362() throws Exception {
-// final RatCheckMojo mojo = newRatMojo("RAT-362");
-// final File ratTxtFile = mojo.getRatTxtFile();
-// try {
-// mojo.execute();
-// fail("Expected RatCheckException");
-// } catch (RatCheckException e) {
-// final String msg = e.getMessage();
-// assertThat(msg).contains(ratTxtFile.getName());
-// assertThat(msg).contains("UNAPPROVED exceeded minimum");
-//
-// org.w3c.dom.Document document = XmlUtils.toDom(Files.newInputStream(ratTxtFile.toPath()));
-// // Document types
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/statistics/documentType[@name='IGNORED']",
-// "count", "3");
-//
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/resource[@name='/bar.md']",
-// "type", "STANDARD");
-// XmlUtils.assertAttributes(document, xPath, "/rat-report/resource[@name='/foo.md']",
-// "type", "IGNORED");
-// }
-// }
-//
-// /**
-// * Tests implicit excludes apply to submodules too
-// */
-// @Test
-// void rat107() throws Exception {
-// final RatCheckMojo mojo = newRatMojo("RAT-107");
-// final File ratTxtFile = mojo.getRatTxtFile();
-// final String[] expected = {};
-// final String[] notExpected = {};
-// //setVariableValueToObject(mojo, "excludeSubProjects", Boolean.FALSE);
-// mojo.setInputExcludeParsedScm("MAVEN");
-// mojo.setInputExcludeParsedScm("idea");
-// mojo.setInputExcludeParsedScm("eclipse");
-// mojo.execute();
-//
-// ensureRatReportIsCorrect(ratTxtFile, expected, notExpected);
-// }
-//}
diff --git a/apache-rat-maven-parent/plugin/src/test/java/org/apache/rat/maven/RecordingLogger.java b/apache-rat-maven-parent/plugin/src/test/java/org/apache/rat/maven/RecordingLogger.java
new file mode 100644
index 00000000..9614f498
--- /dev/null
+++ b/apache-rat-maven-parent/plugin/src/test/java/org/apache/rat/maven/RecordingLogger.java
@@ -0,0 +1,117 @@
+package org.apache.rat.maven;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Stream;
+import org.apache.maven.shared.invoker.InvokerLogger;
+import org.apache.rat.utils.Log;
+
+public class RecordingLogger implements InvokerLogger {
+ public record LogEntry(Log.Level level, String message, Throwable exception) {}
+
+ private final List<LogEntry> entries = new ArrayList<>();
+ private final InvokerLogger delegate;
+
+ public RecordingLogger(InvokerLogger delegate) {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public void debug(String message) {
+ entries.add(new LogEntry(Log.Level.DEBUG, message, null));
+ delegate.debug(message);
+ }
+
+ @Override
+ public void debug(String message, Throwable throwable) {
+ entries.add(new LogEntry(Log.Level.DEBUG, message, throwable));
+ delegate.debug(message, throwable);
+ }
+
+ @Override
+ public boolean isDebugEnabled() {
+ return delegate.isDebugEnabled();
+ }
+
+ @Override
+ public void info(String message) {
+ entries.add(new LogEntry(Log.Level.INFO, message, null));
+ delegate.info(message);
+ }
+
+ @Override
+ public void info(String message, Throwable throwable) {
+ entries.add(new LogEntry(Log.Level.INFO, message, throwable));
+ delegate.info(message, throwable);
+ }
+
+ @Override
+ public boolean isInfoEnabled() {
+ return delegate.isInfoEnabled();
+ }
+
+ @Override
+ public void warn(String message) {
+ entries.add(new LogEntry(Log.Level.WARN, message, null));
+ delegate.warn(message);
+ }
+
+ @Override
+ public void warn(String message, Throwable throwable) {
+ entries.add(new LogEntry(Log.Level.WARN, message, throwable));
+ delegate.warn(message, throwable);
+ }
+
+ @Override
+ public boolean isWarnEnabled() {
+ return delegate.isWarnEnabled();
+ }
+
+ @Override
+ public void error(String message) {
+ entries.add(new LogEntry(Log.Level.ERROR, message, null));
+ delegate.error(message);
+ }
+
+ @Override
+ public void error(String message, Throwable throwable) {
+ entries.add(new LogEntry(Log.Level.ERROR, message, throwable));
+ delegate.error(message, throwable);
+ }
+
+ @Override
+ public boolean isErrorEnabled() {
+ return delegate.isErrorEnabled();
+ }
+
+ @Override
+ public void fatalError(String message) {
+ entries.add(new LogEntry(Log.Level.ERROR, message, null));
+ delegate.fatalError(message);
+ }
+
+ @Override
+ public void fatalError(String message, Throwable throwable) {
+ entries.add(new LogEntry(Log.Level.ERROR, message, throwable));
+ delegate.fatalError(message);
+ }
+
+ @Override
+ public boolean isFatalErrorEnabled() {
+ return delegate.isFatalErrorEnabled();
+ }
+
+ @Override
+ public void setThreshold(int threshold) {
+ delegate.setThreshold(threshold);
+ }
+
+ @Override
+ public int getThreshold() {
+ return delegate.getThreshold();
+ }
+
+ public Stream<RecordingLogger.LogEntry> getEntries() {
+ return entries.stream();
+ }
+}
diff --git a/apache-rat-maven-parent/plugin/src/test/java/org/apache/rat/maven/RecordingOutputHandler.java b/apache-rat-maven-parent/plugin/src/test/java/org/apache/rat/maven/RecordingOutputHandler.java
new file mode 100644
index 00000000..c7bf1389
--- /dev/null
+++ b/apache-rat-maven-parent/plugin/src/test/java/org/apache/rat/maven/RecordingOutputHandler.java
@@ -0,0 +1,26 @@
+package org.apache.rat.maven;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Stream;
+import org.apache.maven.shared.invoker.InvocationOutputHandler;
+
+public class RecordingOutputHandler implements InvocationOutputHandler {
+ private final InvocationOutputHandler delegate;
+ private final List<String> lines = new ArrayList<String>();
+
+ RecordingOutputHandler(final InvocationOutputHandler delegate) {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public void consumeLine(String line) throws IOException {
+ lines.add(line);
+ delegate.consumeLine(line);
+ }
+
+ public Stream<String> getLines() {
+ return lines.stream();
+ }
+}
diff --git a/apache-rat-maven-parent/tools/src/main/java/org/apache/rat/maven/PropertyReader.java b/apache-rat-maven-parent/tools/src/main/java/org/apache/rat/maven/PropertyReader.java
new file mode 100644
index 00000000..2e3cea96
--- /dev/null
+++ b/apache-rat-maven-parent/tools/src/main/java/org/apache/rat/maven/PropertyReader.java
@@ -0,0 +1,4 @@
+package org.apache.rat.maven;
+
+public class PropertyReader {
+}
diff --git a/apache-rat-maven-parent/tools/src/test/java/org/apache/rat/maven/MavenOptionCollectionTest.java b/apache-rat-maven-parent/tools/src/test/java/org/apache/rat/maven/MavenOptionCollectionTest.java
new file mode 100644
index 00000000..3eaf0667
--- /dev/null
+++ b/apache-rat-maven-parent/tools/src/test/java/org/apache/rat/maven/MavenOptionCollectionTest.java
@@ -0,0 +1,52 @@
+package org.apache.rat.maven;
+
+import java.util.Collection;
+import org.apache.commons.cli.DeprecatedAttributes;
+import org.apache.commons.cli.Option;
+import org.apache.rat.commandline.Arg;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class MavenOptionTest {
+
+ @Test
+ void deprecatedTest() {
+ final MavenOptionCollection mavenOptionCollection = new MavenOptionCollection();
+ MavenOption opt = mavenOptionCollection.getMappedOption(Arg.EDIT_COPYRIGHT.find("copyright"));
+
+ assertThat(opt.getDeprecated()).contains("<editCopyright>");
+
+ Option deprecatedOption = Option.builder().longOpt("dep-opt")
+ .deprecated(DeprecatedAttributes.builder()
+ .setDescription("Yep it is deprecated use --other-opt instead")
+ .setForRemoval(true)
+ .setSince("1.0")
+ .get())
+ .desc("This is the --dep-opt description that talks about --other-opt.")
+ .build();
+
+
+ try {
+ mavenOptionCollection.additionalOptions().addOption(deprecatedOption);
+ Option otherOpt = Option.builder().longOpt("other-opt")
+ .desc("this is the --other-opt description.").build();
+ mavenOptionCollection.additionalOptions().addOption(otherOpt);
+
+ Collection<Option> opts = mavenOptionCollection.getOptions().getOptions();
+ assertThat(opts).contains(otherOpt);
+ assertThat(opts).contains(deprecatedOption);
+
+ MavenOption depMaven = mavenOptionCollection.getMappedOption(deprecatedOption);
+ MavenOption otherMaven = mavenOptionCollection.getMappedOption(otherOpt);
+
+ assertThat(depMaven.getDeprecated()).contains("<otherOpt>");
+ assertThat(depMaven.getMethodName()).isEqualTo("setDepOpt");
+ assertThat(depMaven.getDescription()).isEqualTo("This is the <depOpt> description that talks about <otherOpt>.");
+ assertThat(depMaven.getName()).isEqualTo("depOpt");
+ } finally {
+ assertThat(new MavenOptionCollection().additionalOptions().getOptions()).isEmpty();
+ }
+
+ }
+}
diff --git a/apache-rat-maven-parent/tools/src/test/java/org/apache/rat/maven/MavenOptionTest.java b/apache-rat-maven-parent/tools/src/test/java/org/apache/rat/maven/MavenOptionTest.java
deleted file mode 100644
index 8eacb73e..00000000
--- a/apache-rat-maven-parent/tools/src/test/java/org/apache/rat/maven/MavenOptionTest.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package org.apache.rat.maven.tools;
-
-public class MavenOptionTest {
-}
diff --git a/apache-rat-maven-parent/tools/src/test/java/org/apache/rat/maven/PropertyReaderTest.java b/apache-rat-maven-parent/tools/src/test/java/org/apache/rat/maven/PropertyReaderTest.java
new file mode 100644
index 00000000..fc7f65dd
--- /dev/null
+++ b/apache-rat-maven-parent/tools/src/test/java/org/apache/rat/maven/PropertyReaderTest.java
@@ -0,0 +1,4 @@
+package org.apache.rat.maven;
+
+public class PropertyReaderTest {
+}
diff --git a/apache-rat-plugin/src/it/RAT-508/invoker.properties b/apache-rat-plugin/src/it/RAT-508/invoker.properties
deleted file mode 100644
index 1c089b46..00000000
--- a/apache-rat-plugin/src/it/RAT-508/invoker.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-invoker.goals = clean -X apache-rat:rat
diff --git a/apache-rat-plugin/src/it/RAT-524/invoker.properties b/apache-rat-plugin/src/it/RAT-524/invoker.properties
deleted file mode 100644
index 1c089b46..00000000
--- a/apache-rat-plugin/src/it/RAT-524/invoker.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-invoker.goals = clean -X apache-rat:rat