From 69b5a6b5a1000990b6d4f3ba20826f94e816a5d0 Mon Sep 17 00:00:00 2001 From: pieterlukasse Date: Fri, 3 May 2024 19:19:12 +0200 Subject: [PATCH] fix: add test file contents to logs --- .../CohortCharacterizationServiceTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/java/org/ohdsi/webapi/cohortcharacterization/CohortCharacterizationServiceTest.java b/src/test/java/org/ohdsi/webapi/cohortcharacterization/CohortCharacterizationServiceTest.java index f010a5873..3d0882cd8 100644 --- a/src/test/java/org/ohdsi/webapi/cohortcharacterization/CohortCharacterizationServiceTest.java +++ b/src/test/java/org/ohdsi/webapi/cohortcharacterization/CohortCharacterizationServiceTest.java @@ -37,6 +37,7 @@ import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.Paths; import java.sql.SQLException; import java.util.*; @@ -207,6 +208,16 @@ private ZipFile getZipFile(Long id, ParamItem paramItem) throws IOException { } System.out.println("BAOS Size: " + baos.size()); System.out.println("Temporary File Size: " + tempFile.length()); + try { + List lines = Files.readAllLines(Paths.get(tempFile.getAbsolutePath())); + System.out.println("File Contents:"); + for (String line : lines) { + System.out.println(line); + } + } catch (IOException e) { + System.out.println("Error reading file."); + e.printStackTrace(); + } return new ZipFile(tempFile); }