kwin commented on a change in pull request #195:
URL: 
https://github.com/apache/jackrabbit-filevault/pull/195#discussion_r781941408



##########
File path: 
vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/PackageInstallIT.java
##########
@@ -404,14 +411,17 @@ public void testNoProperties() throws 
RepositoryException, IOException, PackageE
      */
     @Test
     public void testNoChildFilter() throws RepositoryException, IOException, 
PackageException {
-        File tmpFile = File.createTempFile("vlttest", "zip");
-        IOUtils.copy(getStream("/test-packages/test-package-with-etc.zip"), 
FileUtils.openOutputStream(tmpFile));
-        JcrPackage pack = packMgr.upload(tmpFile, true, true, 
"test-package-with-etc", false);
-        assertNodeExists("/etc");
-        admin.getNode("/etc").addNode("foo", NodeType.NT_FOLDER);
-        admin.save();
-        pack.install(getDefaultOptions());
-        assertNodeExists("/etc/foo");
+        File tmpFile = testFolder.newFile();
+        try (OutputStream os = FileUtils.openOutputStream(tmpFile)) {
+            
IOUtils.copy(getStream("/test-packages/test-package-with-etc.zip"), os);
+            try (JcrPackage pack = packMgr.upload(tmpFile, true, true, 
"test-package-with-etc", false)) {
+                assertNodeExists("/etc");
+                admin.getNode("/etc").addNode("foo", NodeType.NT_FOLDER);
+                admin.save();
+                pack.install(getDefaultOptions());
+                assertNodeExists("/etc/foo");
+            }
+        }

Review comment:
       ```suggestion
           try (JcrPackage pack = 
packMgr.upload(getFile("/test-packages/test-package-with-etc.zip"), true, true, 
"test-package-with-etc", false)) {
               assertNodeExists("/etc");
               admin.getNode("/etc").addNode("foo", NodeType.NT_FOLDER);
               admin.save();
               pack.install(getDefaultOptions());
               assertNodeExists("/etc/foo");
           }
   ```




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to