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

bodewig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ant.git


The following commit(s) were added to refs/heads/master by this push:
     new 9fea2afdb Jenkins has lower case drive letters?
9fea2afdb is described below

commit 9fea2afdb508be761fbc35ccb454b0979d8a780c
Author: Stefan Bodewig <[email protected]>
AuthorDate: Sun Mar 1 18:38:01 2026 +0100

    Jenkins has lower case drive letters?
---
 .../org/apache/tools/ant/util/FileUtilsTest.java   | 26 +++++++++++++++-------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java 
b/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
index 2d9bd0b1d..b513187cf 100644
--- a/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
@@ -887,7 +887,7 @@ public class FileUtilsTest {
     public void getResolvedPathWorksForNormalFilesThatExist() throws 
IOException {
         File f = folder.newFile();
         String resolvedPath = getFileUtils().getResolvedPath(f);
-        assertEquals(f.getAbsolutePath(), resolvedPath);
+        assertEqualsIgnoreDriveCaseGeneric(f.getAbsolutePath(), resolvedPath);
     }
 
     @Test
@@ -895,7 +895,7 @@ public class FileUtilsTest {
         File missingDir = new File(folder.getRoot(), "foo");
         File f = new File(missingDir, "foo");
         String resolvedPath = getFileUtils().getResolvedPath(f);
-        assertEquals(f.getAbsolutePath(), resolvedPath);
+        assertEqualsIgnoreDriveCaseGeneric(f.getAbsolutePath(), resolvedPath);
     }
 
     @Test
@@ -906,7 +906,7 @@ public class FileUtilsTest {
         File f = new File(folder.getRoot(), "foo");
         Files.createSymbolicLink(f.toPath(), existingDir.toPath());
         String resolvedPath = getFileUtils().getResolvedPath(f);
-        assertEquals(existingDir.getAbsolutePath(), resolvedPath);
+        assertEqualsIgnoreDriveCaseGeneric(existingDir.getAbsolutePath(), 
resolvedPath);
     }
 
     @Test
@@ -917,7 +917,7 @@ public class FileUtilsTest {
         File f = new File(folder.getRoot(), "bar");
         Files.createSymbolicLink(f.toPath(), missingDir.toPath());
         String resolvedPath = getFileUtils().getResolvedPath(f);
-        assertEquals(f.getAbsolutePath(), resolvedPath);
+        assertEqualsIgnoreDriveCaseGeneric(f.getAbsolutePath(), resolvedPath);
     }
 
     @Test
@@ -930,7 +930,8 @@ public class FileUtilsTest {
         File level2 = new File(link, "bar");
         File f = new File(level2, "baz");
         String resolvedPath = getFileUtils().getResolvedPath(f);
-        assertEquals(new File(new File(existingDir, "bar"), 
"baz").getAbsolutePath(), resolvedPath);
+        assertEqualsIgnoreDriveCaseGeneric(new File(new File(existingDir, 
"bar"), "baz").getAbsolutePath(),
+                                           resolvedPath);
     }
 
     @Test
@@ -941,7 +942,7 @@ public class FileUtilsTest {
         File f = new File(folder.getRoot(), "foo");
         createJunction(f, existingDir);
         String resolvedPath = getFileUtils().getResolvedPath(f);
-        assertEquals(existingDir.getAbsolutePath(), resolvedPath);
+        assertEqualsIgnoreDriveCaseGeneric(existingDir.getAbsolutePath(), 
resolvedPath);
     }
 
     @Test
@@ -953,7 +954,7 @@ public class FileUtilsTest {
         createJunction(f, missingDir);
         assertTrue("failed to delete target directory", missingDir.delete());
         String resolvedPath = getFileUtils().getResolvedPath(f);
-        assertEquals(f.getAbsolutePath(), resolvedPath);
+        assertEqualsIgnoreDriveCaseGeneric(f.getAbsolutePath(), resolvedPath);
     }
 
     @Test
@@ -966,7 +967,8 @@ public class FileUtilsTest {
         File level2 = new File(link, "bar");
         File f = new File(level2, "baz");
         String resolvedPath = getFileUtils().getResolvedPath(f);
-        assertEquals(new File(new File(existingDir, "bar"), 
"baz").getAbsolutePath(), resolvedPath);
+        assertEqualsIgnoreDriveCaseGeneric(new File(new File(existingDir, 
"bar"), "baz").getAbsolutePath(),
+                                           resolvedPath);
     }
 
     /**
@@ -996,6 +998,14 @@ public class FileUtilsTest {
         }
     }
 
+    private void assertEqualsIgnoreDriveCaseGeneric(String s1, String s2) {
+        if (Os.isFamily("dos") || Os.isFamily("netware")) {
+            assertEqualsIgnoreDriveCase(s1, s2);
+        } else {
+            assertEquals(s1, s2);
+        }
+    }
+
     private static void createJunction(File junction, File junctionTarget) {
         Mklink mklink = new Mklink();
         mklink.setProject(new Project());

Reply via email to