8253761: Wrong URI syntax printed by jar --describe-module
Reviewed-by: alanb
This commit is contained in:
parent
b29e1086ac
commit
f2f77f7b14
@ -1737,7 +1737,7 @@ public class Main {
|
|||||||
/** Returns an optional containing the effective URI. */
|
/** Returns an optional containing the effective URI. */
|
||||||
@Override public Optional<String> uriString() {
|
@Override public Optional<String> uriString() {
|
||||||
String uri = (Paths.get(zipFile.getName())).toUri().toString();
|
String uri = (Paths.get(zipFile.getName())).toUri().toString();
|
||||||
uri = "jar:" + uri + "/!" + entry.getName();
|
uri = "jar:" + uri + "!/" + entry.getName();
|
||||||
return Optional.of(uri);
|
return Optional.of(uri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -269,7 +269,7 @@ public class Basic {
|
|||||||
jar("-d --file mr.jar");
|
jar("-d --file mr.jar");
|
||||||
|
|
||||||
String uri = (Paths.get("mr.jar")).toUri().toString();
|
String uri = (Paths.get("mr.jar")).toUri().toString();
|
||||||
uri = "jar:" + uri + "/!module-info.class";
|
uri = "jar:" + uri + "!/module-info.class";
|
||||||
|
|
||||||
actual = lines(outbytes);
|
actual = lines(outbytes);
|
||||||
expected = Set.of(
|
expected = Set.of(
|
||||||
@ -423,7 +423,7 @@ public class Basic {
|
|||||||
actual = lines(outbytes);
|
actual = lines(outbytes);
|
||||||
expected = Set.of(
|
expected = Set.of(
|
||||||
"releases: 9 10",
|
"releases: 9 10",
|
||||||
"m1 " + uriPrefix + "/!META-INF/versions/9/module-info.class",
|
"m1 " + uriPrefix + "!/META-INF/versions/9/module-info.class",
|
||||||
"requires java.base mandated",
|
"requires java.base mandated",
|
||||||
"exports p",
|
"exports p",
|
||||||
"main-class p.Main"
|
"main-class p.Main"
|
||||||
@ -434,7 +434,7 @@ public class Basic {
|
|||||||
actual = lines(outbytes);
|
actual = lines(outbytes);
|
||||||
expected = Set.of(
|
expected = Set.of(
|
||||||
"releases: 9 10",
|
"releases: 9 10",
|
||||||
"m1 " + uriPrefix + "/!META-INF/versions/10/module-info.class",
|
"m1 " + uriPrefix + "!/META-INF/versions/10/module-info.class",
|
||||||
"requires java.base mandated",
|
"requires java.base mandated",
|
||||||
"exports p",
|
"exports p",
|
||||||
"main-class p.Main"
|
"main-class p.Main"
|
||||||
|
@ -494,9 +494,9 @@ public class Basic {
|
|||||||
"--file=" + modularJar.toString())
|
"--file=" + modularJar.toString())
|
||||||
.assertSuccess()
|
.assertSuccess()
|
||||||
.resultChecker(r -> {
|
.resultChecker(r -> {
|
||||||
// Expect "bar jar:file:/.../!module-info.class"
|
// Expect "bar jar:file:/...!/module-info.class"
|
||||||
// conceals jdk.test.foo, conceals jdk.test.foo.internal"
|
// conceals jdk.test.foo, conceals jdk.test.foo.internal"
|
||||||
String uri = "jar:" + modularJar.toUri().toString() + "/!module-info.class";
|
String uri = "jar:" + modularJar.toUri().toString() + "!/module-info.class";
|
||||||
assertTrue(r.output.contains("bar " + uri),
|
assertTrue(r.output.contains("bar " + uri),
|
||||||
"Expecting to find \"bar " + uri + "\"",
|
"Expecting to find \"bar " + uri + "\"",
|
||||||
"in output, but did not: [" + r.output + "]");
|
"in output, but did not: [" + r.output + "]");
|
||||||
@ -848,10 +848,14 @@ public class Basic {
|
|||||||
jar(option,
|
jar(option,
|
||||||
"--file=" + modularJar.toString())
|
"--file=" + modularJar.toString())
|
||||||
.assertSuccess()
|
.assertSuccess()
|
||||||
.resultChecker(r ->
|
.resultChecker(r -> {
|
||||||
assertTrue(r.output.contains(FOO.moduleName + "@" + FOO.version),
|
assertTrue(r.output.contains(FOO.moduleName + "@" + FOO.version),
|
||||||
"Expected to find ", FOO.moduleName + "@" + FOO.version,
|
"Expected to find ", FOO.moduleName + "@" + FOO.version,
|
||||||
" in [", r.output, "]")
|
" in [", r.output, "]");
|
||||||
|
assertTrue(r.output.contains(modularJar.toUri().toString()),
|
||||||
|
"Expected to find ", modularJar.toUri().toString(),
|
||||||
|
" in [", r.output, "]");
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
jar(option,
|
jar(option,
|
||||||
|
Loading…
Reference in New Issue
Block a user