garydgregory commented on a change in pull request #76:
URL:
https://github.com/apache/commons-configuration/pull/76#discussion_r501742019
##########
File path:
src/test/java/org/apache/commons/configuration2/builder/TestFileBasedConfigurationBuilder.java
##########
@@ -136,6 +141,31 @@ public void testGetConfigurationLoadFromFile()
.getFileHandler().getContent());
}
+ /**
+ * Tests whether a configuration is loaded from a JAR file if a location is
+ * provided.
+ */
+ @Test
+ public void testGetConfigurationLoadFromJarFile()
+ throws ConfigurationException, IOException
+ {
+ URL jarResource = getClass().getClassLoader().getResource("test.jar");
+ assertNotNull(jarResource);
+ final Path testJar = Paths.get(folder.getRoot().getAbsolutePath(),
"test.jar");
+ Files.copy(jarResource.openStream(), testJar);
Review comment:
This stream needs to be managed in a try-with-resources block.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]