|
|
|
@ -172,13 +172,9 @@ class HandlerTests { |
|
|
|
TestJarCreator.createTestJar(testJar); |
|
|
|
TestJarCreator.createTestJar(testJar); |
|
|
|
URL url = new URL(null, "jar:" + testJar.toURI().toURL() + "!/nested.jar!/3.dat", this.handler); |
|
|
|
URL url = new URL(null, "jar:" + testJar.toURI().toURL() + "!/nested.jar!/3.dat", this.handler); |
|
|
|
JarURLConnection connection = (JarURLConnection) url.openConnection(); |
|
|
|
JarURLConnection connection = (JarURLConnection) url.openConnection(); |
|
|
|
JarFile jarFile = JarFileWrapper.unwrap(connection.getJarFile()); |
|
|
|
try (JarFile jarFile = JarFileWrapper.unwrap(connection.getJarFile())) { |
|
|
|
try { |
|
|
|
|
|
|
|
assertThat(jarFile.getRootJarFile().getFile()).isEqualTo(testJar); |
|
|
|
assertThat(jarFile.getRootJarFile().getFile()).isEqualTo(testJar); |
|
|
|
} |
|
|
|
} |
|
|
|
finally { |
|
|
|
|
|
|
|
jarFile.close(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
@ -187,13 +183,9 @@ class HandlerTests { |
|
|
|
TestJarCreator.createTestJar(testJar); |
|
|
|
TestJarCreator.createTestJar(testJar); |
|
|
|
URL url = new URL(null, "jar:" + testJar.toURI().toURL() + "!/nested.jar!/3.dat", this.handler); |
|
|
|
URL url = new URL(null, "jar:" + testJar.toURI().toURL() + "!/nested.jar!/3.dat", this.handler); |
|
|
|
JarURLConnection connection = (JarURLConnection) url.openConnection(); |
|
|
|
JarURLConnection connection = (JarURLConnection) url.openConnection(); |
|
|
|
JarFile jarFile = JarFileWrapper.unwrap(connection.getJarFile()); |
|
|
|
try (JarFile jarFile = JarFileWrapper.unwrap(connection.getJarFile())) { |
|
|
|
try { |
|
|
|
|
|
|
|
assertThat(jarFile.getRootJarFile().getFile()).isEqualTo(testJar); |
|
|
|
assertThat(jarFile.getRootJarFile().getFile()).isEqualTo(testJar); |
|
|
|
} |
|
|
|
} |
|
|
|
finally { |
|
|
|
|
|
|
|
jarFile.close(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void assertStandardAndCustomHandlerUrlsAreEqual(String context, String spec) throws MalformedURLException { |
|
|
|
private void assertStandardAndCustomHandlerUrlsAreEqual(String context, String spec) throws MalformedURLException { |
|
|
|
|