This is an automated email from the ASF dual-hosted git repository.

Claudenw pushed a commit to branch fix-DocumentName-issues
in repository https://gitbox.apache.org/repos/asf/creadur-rat.git


The following commit(s) were added to refs/heads/fix-DocumentName-issues by 
this push:
     new cf81fcff fixed some tests
cf81fcff is described below

commit cf81fcff43ed63c0b96fdb3e14f89092b6101938
Author: Claude Warren <[email protected]>
AuthorDate: Sun Jun 21 17:46:31 2026 +0100

    fixed some tests
---
 .../src/test/java/org/apache/rat/commandline/ArgTests.java        | 8 +++++---
 .../test/java/org/apache/rat/commandline/FileConverterTest.java   | 7 +------
 .../org/apache/rat/config/exclusion/ExclusionProcessorTest.java   | 4 ----
 .../java/org/apache/rat/document/DocumentNameMatcherTest.java     | 6 +++---
 .../src/test/java/org/apache/rat/document/DocumentNameTest.java   | 3 ---
 .../src/test/java/org/apache/rat/document/FSInfoTest.java         | 6 +++---
 6 files changed, 12 insertions(+), 22 deletions(-)

diff --git 
a/apache-rat-core/src/test/java/org/apache/rat/commandline/ArgTests.java 
b/apache-rat-core/src/test/java/org/apache/rat/commandline/ArgTests.java
index ca6fb5e7..742632c5 100644
--- a/apache-rat-core/src/test/java/org/apache/rat/commandline/ArgTests.java
+++ b/apache-rat-core/src/test/java/org/apache/rat/commandline/ArgTests.java
@@ -57,15 +57,17 @@ public class ArgTests {
 
         DocumentName.FSInfo fsInfo = DocumentName.FSInfo.getDefault();
         String fileName = name.replace("/", fsInfo.dirSeparator());
-        Path workingPath = new File(".").getAbsoluteFile().toPath();
+        File localFile = new File(".");
+        DocumentName localFileName = DocumentName.builder(localFile).build();
+        Path workingPath = localFile.getAbsoluteFile().toPath();
         String expected = fsInfo.normalize(workingPath.resolve("./" + 
fileName).toString());
 
         CommandLine commandLine = createCommandLine(new 
String[]{"--output-file", fileName});
         OutputFileConfig configuration = new OutputFileConfig();
-        ArgumentContext ctxt = new ArgumentContext(new File("."), 
configuration, commandLine);
+        ArgumentContext ctxt = new ArgumentContext(localFile, configuration, 
commandLine);
         Arg.processArgs(ctxt, CLIOptionCollection.INSTANCE);
         if (name.equals("/rat.txt")) {
-            
assertThat(fsInfo.normalize(configuration.actual.getAbsolutePath())).isEqualTo(fsInfo.roots()[0]
 + "rat.txt");
+            
assertThat(fsInfo.normalize(configuration.actual.getAbsolutePath())).isEqualTo(localFileName.getRoot()
 + "rat.txt");
         } else {
             
assertThat(fsInfo.normalize(configuration.actual.toString())).isEqualTo(expected);
         }
diff --git 
a/apache-rat-core/src/test/java/org/apache/rat/commandline/FileConverterTest.java
 
b/apache-rat-core/src/test/java/org/apache/rat/commandline/FileConverterTest.java
index 03a8865b..441d3271 100644
--- 
a/apache-rat-core/src/test/java/org/apache/rat/commandline/FileConverterTest.java
+++ 
b/apache-rat-core/src/test/java/org/apache/rat/commandline/FileConverterTest.java
@@ -18,23 +18,18 @@
  */
 package org.apache.rat.commandline;
 
-import com.google.common.jimfs.Configuration;
-import com.google.common.jimfs.Jimfs;
 import org.apache.rat.document.DocumentName;
 import org.apache.rat.document.FSInfoTest;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.Arguments;
 import org.junit.jupiter.params.provider.MethodSource;
 
-import java.io.IOException;
-import java.nio.file.FileSystem;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
-public class FileConverterTest {
+class FileConverterTest {
 
     @ParameterizedTest
     @MethodSource("applyTestData")
diff --git 
a/apache-rat-core/src/test/java/org/apache/rat/config/exclusion/ExclusionProcessorTest.java
 
b/apache-rat-core/src/test/java/org/apache/rat/config/exclusion/ExclusionProcessorTest.java
index 649668a5..19e2e154 100644
--- 
a/apache-rat-core/src/test/java/org/apache/rat/config/exclusion/ExclusionProcessorTest.java
+++ 
b/apache-rat-core/src/test/java/org/apache/rat/config/exclusion/ExclusionProcessorTest.java
@@ -30,7 +30,6 @@ import org.junit.jupiter.api.io.TempDir;
 
 import java.io.File;
 import java.io.IOException;
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
@@ -48,9 +47,6 @@ import static org.junit.jupiter.api.Assertions.fail;
 
 public class ExclusionProcessorTest {
 
-    final private static DocumentNameMatcher TRUE = 
DocumentNameMatcher.MATCHES_ALL;
-    final private static DocumentNameMatcher FALSE = 
DocumentNameMatcher.MATCHES_NONE;
-
     @TempDir
     private static Path tempDir;
 
diff --git 
a/apache-rat-core/src/test/java/org/apache/rat/document/DocumentNameMatcherTest.java
 
b/apache-rat-core/src/test/java/org/apache/rat/document/DocumentNameMatcherTest.java
index 124480d1..c5c616bb 100644
--- 
a/apache-rat-core/src/test/java/org/apache/rat/document/DocumentNameMatcherTest.java
+++ 
b/apache-rat-core/src/test/java/org/apache/rat/document/DocumentNameMatcherTest.java
@@ -51,7 +51,7 @@ public class DocumentNameMatcherTest {
 
     @ParameterizedTest
     @MethodSource("testDocuments")
-    public void orTest(DocumentName testName) {
+    void orTest(DocumentName testName) {
         assertThat(DocumentNameMatcher.or(TRUE, 
FALSE).matches(testName)).as("T,F").isTrue();
         assertThat(DocumentNameMatcher.or(FALSE, 
TRUE).matches(testName)).as("F,T").isTrue();
         assertThat(DocumentNameMatcher.or(TRUE, 
TRUE).matches(testName)).as("T,T").isTrue();
@@ -60,7 +60,7 @@ public class DocumentNameMatcherTest {
 
     @ParameterizedTest
     @MethodSource("testDocuments")
-    public void andTest(DocumentName testName) {
+    void andTest(DocumentName testName) {
         assertThat(DocumentNameMatcher.and(TRUE, 
FALSE).matches(testName)).as("T,F").isFalse();
         assertThat(DocumentNameMatcher.and(FALSE, 
TRUE).matches(testName)).as("F,T").isFalse();
         assertThat(DocumentNameMatcher.and(TRUE, 
TRUE).matches(testName)).as("T,T").isTrue();
@@ -69,7 +69,7 @@ public class DocumentNameMatcherTest {
 
     @ParameterizedTest
     @MethodSource("testDocuments")
-    public void matcherSetTest(DocumentName testName) {
+    void matcherSetTest(DocumentName testName) {
         assertThat(DocumentNameMatcher.matcherSet(TRUE, 
FALSE).matches(testName)).as("T,F").isTrue();
         assertThat(DocumentNameMatcher.matcherSet(FALSE, 
TRUE).matches(testName)).as("F,T").isFalse();
         assertThat(DocumentNameMatcher.matcherSet(TRUE, 
TRUE).matches(testName)).as("T,T").isTrue();
diff --git 
a/apache-rat-core/src/test/java/org/apache/rat/document/DocumentNameTest.java 
b/apache-rat-core/src/test/java/org/apache/rat/document/DocumentNameTest.java
index beb163cf..13c50418 100644
--- 
a/apache-rat-core/src/test/java/org/apache/rat/document/DocumentNameTest.java
+++ 
b/apache-rat-core/src/test/java/org/apache/rat/document/DocumentNameTest.java
@@ -26,15 +26,12 @@ import java.io.FileWriter;
 import java.io.FilenameFilter;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
-import java.nio.file.FileSystem;
 import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.stream.Stream;
 
-import com.google.common.jimfs.Configuration;
-import com.google.common.jimfs.Jimfs;
 import org.apache.rat.config.exclusion.ExclusionUtils;
 import org.apache.rat.document.DocumentName.FSInfo;
 
diff --git 
a/apache-rat-core/src/test/java/org/apache/rat/document/FSInfoTest.java 
b/apache-rat-core/src/test/java/org/apache/rat/document/FSInfoTest.java
index e6796fa6..b0a04329 100644
--- a/apache-rat-core/src/test/java/org/apache/rat/document/FSInfoTest.java
+++ b/apache-rat-core/src/test/java/org/apache/rat/document/FSInfoTest.java
@@ -142,11 +142,11 @@ public class FSInfoTest {
                 String name = String.format("%s with %s ", underTest, 
compareTo);
                 if (i == j) {
                     assertThat(underTest).as(name + 
"equality").isEqualTo(compareTo);
-                    assertThat(underTest.hashCode()).as(name + 
"hashCode").isEqualTo(compareTo.hashCode());
-                    assertThat(underTest.compareTo(compareTo)).as(name + 
"compareTo").isEqualTo(0);
+                    assertThat(underTest.hashCode()).as(name + 
"hashCode").hasSameHashCodeAs(compareTo);
+                    assertThat(underTest.compareTo(compareTo)).as(name + 
"compareTo").isZero();
                 } else {
                     assertThat(underTest).as(name + 
"equality").isNotEqualTo(compareTo);
-                    assertThat(underTest.compareTo(compareTo)).as(name + 
"compareTo").isNotEqualTo(0);
+                    assertThat(underTest.compareTo(compareTo)).as(name + 
"compareTo").isNotZero();
                 }
             }
         }

Reply via email to