This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new ca18aa7a01 Make test platform neutral
ca18aa7a01 is described below
commit ca18aa7a01dc7adb5badae6b7cb4305e1d35155f
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Oct 22 15:37:24 2026 +0100
Make test platform neutral
---
test/org/apache/tomcat/util/scan/TestJarFileUrlNestedJar.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/test/org/apache/tomcat/util/scan/TestJarFileUrlNestedJar.java
b/test/org/apache/tomcat/util/scan/TestJarFileUrlNestedJar.java
index 1ef26d247a..8f08c4aa83 100644
--- a/test/org/apache/tomcat/util/scan/TestJarFileUrlNestedJar.java
+++ b/test/org/apache/tomcat/util/scan/TestJarFileUrlNestedJar.java
@@ -100,7 +100,7 @@ public class TestJarFileUrlNestedJar {
File war = createWar(nestedPath);
try (Jar jar =
- new JarFileUrlNestedJar(new URI("jar:file:" +
war.getAbsolutePath() + "!/" + nestedPath).toURL())) {
+ new JarFileUrlNestedJar(new URI("jar:" +
war.toURI().toString() + "!/" + nestedPath).toURL())) {
Assert.assertTrue(jar.exists(TEST_ENTRY));
Assert.assertArrayEquals(TEST_CONTENT, readJar(jar));
}
@@ -116,7 +116,7 @@ public class TestJarFileUrlNestedJar {
File war = createWar("WEB-INF/lib/my jar.jar");
try (Jar jar = new JarFileUrlNestedJar(
- new URI("jar:file:" + war.getAbsolutePath() +
"!/WEB-INF/lib/my%20jar.jar").toURL())) {
+ new URI("jar:" + war.toURI().toString() +
"!/WEB-INF/lib/my%20jar.jar").toURL())) {
Assert.assertTrue(jar.exists(TEST_ENTRY));
Assert.assertArrayEquals(TEST_CONTENT, readJar(jar));
}
@@ -132,7 +132,7 @@ public class TestJarFileUrlNestedJar {
File war = createWar("WEB-INF/lib/nested.jar");
Assert.assertThrows(IOException.class, () -> new JarFileUrlNestedJar(
- new URI("jar:file:" + war.getAbsolutePath() +
"!/WEB-INF/lib/missing.jar").toURL()));
+ new URI("jar:" + war.toURI().toString() +
"!/WEB-INF/lib/missing.jar").toURL()));
}
@@ -146,7 +146,7 @@ public class TestJarFileUrlNestedJar {
File war = createWar("WEB-INF/lib/nested.jar");
Assert.assertThrows(FileNotFoundException.class,
- () -> new JarFileUrlNestedJar(new URI("jar:file:" +
war.getAbsolutePath() + "!/").toURL()));
+ () -> new JarFileUrlNestedJar(new URI("jar:" +
war.toURI().toString() + "!/").toURL()));
}
@@ -160,6 +160,6 @@ public class TestJarFileUrlNestedJar {
File war = createWar("WEB-INF/lib/nested.jar");
Assert.assertThrows(IOException.class,
- () -> new JarFileUrlNestedJar(new URI("jar:file:" +
war.getAbsolutePath() + "!x").toURL()));
+ () -> new JarFileUrlNestedJar(new URI("jar:" +
war.toURI().toString() + "!x").toURL()));
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]