This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new 7844fe32f1 Make test platform neutral
7844fe32f1 is described below
commit 7844fe32f1d73119919b432257a3078b095be40d
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]