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 581d474b5..3de2faa5a 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 @@ -88,13 +88,13 @@ public void cleanup() { public void testAddIncludedFilter() { DocumentName dirName = DocumentName.builder(tempDir).build(); underTest.addExcludedFilter(DirectoryFileFilter.INSTANCE); - DocumentNameMatcher matcher = underTest.getDocumentExcluder(dirName); + DocumentNameMatcher excluder = underTest.getDocumentExcluder(dirName); - assertThat(matcher.toString()).isEqualTo("not(DirectoryFileFilter)"); - assertThat(matcher.matches(DocumentName.builder(tempDir).build())).isFalse(); + assertThat(excluder.toString()).isEqualTo("not(DirectoryFileFilter)"); + assertThat(excluder.matches(DocumentName.builder(tempDir).build())).isFalse(); File f = new File(tempDir, "foo.txt"); - assertThat(exlcuder.matches(DocumentName.builder(f).build())).isTrue(); + assertThat(excluder.matches(DocumentName.builder(f).build())).isTrue(); } @Test diff --git a/apache-rat-core/src/test/java/org/apache/rat/test/AbstractOptionsProvider.java b/apache-rat-core/src/test/java/org/apache/rat/test/AbstractOptionsProvider.java index 863f32bd0..d508e39f8 100644 --- a/apache-rat-core/src/test/java/org/apache/rat/test/AbstractOptionsProvider.java +++ b/apache-rat-core/src/test/java/org/apache/rat/test/AbstractOptionsProvider.java @@ -266,11 +266,11 @@ private void execExcludeTest(Option option, String[] args) { DocumentNameMatcher excluder = config.getDocumentExcluder(baseName()); for (String fname : notExcluded) { DocumentName docName = mkDocName(fname); - assertThat(excluder.matches(docName)).as(() -> dump(option, fname, matcher, docName)).isTrue(); + assertThat(excluder.matches(docName)).as(() -> dump(option, fname, excluder, docName)).isTrue(); } for (String fname : excluded) { DocumentName docName = mkDocName(fname); - assertThat(excluder.matches(docName)).as(() -> dump(option, fname, matcher, docName)).isFalse(); + assertThat(excluder.matches(docName)).as(() -> dump(option, fname, excluder, docName)).isFalse(); } } catch (IOException e) { fail(e.getMessage()); @@ -308,11 +308,11 @@ protected void inputExcludeStdTest() { DocumentNameMatcher excluder = config.getDocumentExcluder(baseName()); for (String fname : excluded) { DocumentName docName = mkDocName(fname); - assertThat(excluder.matches(docName)).as(() -> dump(option, fname, matcher, docName)).isFalse(); + assertThat(excluder.matches(docName)).as(() -> dump(option, fname, excluder, docName)).isFalse(); } for (String fname : notExcluded) { DocumentName docName = mkDocName(fname); - assertThat(excluder.matches(docName)).as(() -> dump(option, fname, matcher, docName)).isTrue(); + assertThat(excluder.matches(docName)).as(() -> dump(option, fname, excluder, docName)).isTrue(); } } catch (IOException e) { fail(e.getMessage()); @@ -372,11 +372,11 @@ private void inputExcludeSizeTest() { DocumentNameMatcher excluder = config.getDocumentExcluder(baseName()); for (String fname : excluded) { DocumentName docName = mkDocName(fname); - assertThat(excluder.matches(docName)).as(() -> dump(option, fname, matcher, docName)).isFalse(); + assertThat(excluder.matches(docName)).as(() -> dump(option, fname, excluder, docName)).isFalse(); } for (String fname : notExcluded) { DocumentName docName = mkDocName(fname); - assertThat(excluder.matches(docName)).as(() -> dump(option, fname, matcher, docName)).isTrue(); + assertThat(excluder.matches(docName)).as(() -> dump(option, fname, excluder, docName)).isTrue(); } } catch (IOException e) { fail(e.getMessage()); @@ -394,11 +394,11 @@ private void execIncludeTest(Option option, String[] args) { DocumentNameMatcher excluder = config.getDocumentExcluder(baseName()); for (String fname : excluded) { DocumentName docName = mkDocName(fname); - assertThat(excluder.matches(docName)).as(() -> dump(option, fname, matcher, docName)).isFalse(); + assertThat(excluder.matches(docName)).as(() -> dump(option, fname, excluder, docName)).isFalse(); } for (String fname : notExcluded) { DocumentName docName = mkDocName(fname); - assertThat(excluder.matches(docName)).as(() -> dump(option, fname, matcher, docName)).isTrue(); + assertThat(excluder.matches(docName)).as(() -> dump(option, fname, excluder, docName)).isTrue(); } } catch (IOException e) { fail(e.getMessage()); @@ -438,11 +438,11 @@ protected void inputIncludeStdTest() { DocumentNameMatcher excluder = config.getDocumentExcluder(baseName()); for (String fname : excluded) { DocumentName docName = mkDocName(fname); - assertThat(excluder.matches(docName)).as(() -> dump(option, fname, matcher, docName)).isFalse(); + assertThat(excluder.matches(docName)).as(() -> dump(option, fname, excluder, docName)).isFalse(); } for (String fname : notExcluded) { DocumentName docName = mkDocName(fname); - assertThat(excluder.matches(docName)).as(() -> dump(option, fname, matcher, docName)).isTrue(); + assertThat(excluder.matches(docName)).as(() -> dump(option, fname, excluder, docName)).isTrue(); } } catch (IOException e) { fail(e.getMessage()); diff --git a/apache-rat-core/src/test/java/org/apache/rat/testhelpers/TestingDocument.java b/apache-rat-core/src/test/java/org/apache/rat/testhelpers/TestingDocument.java index 532182b8e..1bd66377b 100644 --- a/apache-rat-core/src/test/java/org/apache/rat/testhelpers/TestingDocument.java +++ b/apache-rat-core/src/test/java/org/apache/rat/testhelpers/TestingDocument.java @@ -29,6 +29,7 @@ import org.apache.rat.api.Document; import org.apache.rat.document.DocumentNameMatcher; import org.apache.rat.document.DocumentName; +import org.apache.rat.document.FSInfoTest; public class TestingDocument extends Document { @@ -62,7 +63,7 @@ public TestingDocument(Reader reader, String name) { } public TestingDocument(IOSupplier inputStream, String name) { - super(DocumentName.builder().setName(name).setBaseName("").setDirSeparator("/").setCaseSensitive(true).build(), DocumentNameMatcher.MATCHES_ALL); + super(DocumentName.builder(FSInfoTest.UNIX).setName(name).setBaseName("").build(), DocumentNameMatcher.MATCHES_ALL); this.input = inputStream; this.reader = null; }