This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git


The following commit(s) were added to refs/heads/master by this push:
     new 4f4f2cf38 cleaner test resource management
4f4f2cf38 is described below

commit 4f4f2cf38c12525f79a6ef5395ed32aad3f434b6
Author: Andrus Adamchik <[email protected]>
AuthorDate: Fri May 22 16:34:15 2026 -0400

    cleaner test resource management
    
    this fixes windows builds
---
 .../src/test/java/org/apache/cayenne/tools/DbImporterTaskTest.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/cayenne-ant/src/test/java/org/apache/cayenne/tools/DbImporterTaskTest.java 
b/cayenne-ant/src/test/java/org/apache/cayenne/tools/DbImporterTaskTest.java
index 8c59d5bc0..990035a06 100644
--- a/cayenne-ant/src/test/java/org/apache/cayenne/tools/DbImporterTaskTest.java
+++ b/cayenne-ant/src/test/java/org/apache/cayenne/tools/DbImporterTaskTest.java
@@ -175,9 +175,10 @@ public class DbImporterTaskTest {
 
     @SuppressWarnings("unchecked")
     private void verifyResult(File map, File mapFileCopy) throws IOException {
-        FileReader control = new FileReader(map.getAbsolutePath() + "-result");
-        FileReader test = new FileReader(mapFileCopy);
-        assertThat(test, 
CompareMatcher.isSimilarTo(control).ignoreWhitespace());
+        try (FileReader control = new FileReader(map.getAbsolutePath() + 
"-result");
+             FileReader test = new FileReader(mapFileCopy)) {
+            assertThat(test, 
CompareMatcher.isSimilarTo(control).ignoreWhitespace());
+        }
     }
 
     private void prepareDatabase(String sqlFile, DbImportConfiguration 
dbImportConfiguration) throws Exception {

Reply via email to