From 6b6e96e07db49b40873f4a2c844e31c7b52aa63c Mon Sep 17 00:00:00 2001 From: Andreas Beeker Date: Fri, 25 Dec 2020 01:42:10 +0000 Subject: [PATCH] try to fix distsourcebuild error git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884785 13f79535-47bb-0310-9956-ffa450edef68 --- build.xml | 8 +++++--- src/excelant/poi-ant-contrib/Junit5Progress.java | 10 +++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/build.xml b/build.xml index b1f01b3fdd..3b9f35c803 100644 --- a/build.xml +++ b/build.xml @@ -1239,7 +1239,7 @@ under the License. - + @@ -1255,6 +1255,7 @@ under the License. + @@ -1279,14 +1280,15 @@ under the License. + + - - + diff --git a/src/excelant/poi-ant-contrib/Junit5Progress.java b/src/excelant/poi-ant-contrib/Junit5Progress.java index afe51c42f0..f907b5c27c 100644 --- a/src/excelant/poi-ant-contrib/Junit5Progress.java +++ b/src/excelant/poi-ant-contrib/Junit5Progress.java @@ -36,7 +36,7 @@ import org.junit.platform.launcher.TestPlan; **/ public class Junit5Progress implements TestExecutionListener { - private StringWriter inMemoryWriter = new StringWriter(); + private final StringWriter inMemoryWriter = new StringWriter(); private int numSkippedInCurrentClass; private int numAbortedInCurrentClass; @@ -97,10 +97,14 @@ public class Junit5Progress implements TestExecutionListener { } /* - * Append to file on disk since listener can't write to System.out (becuase legacy listeners enabled) + * Append to file on disk since listener can't write to System.out (because legacy listeners enabled) + * + * Implementing/using the TestResultFormatter - mentioned in the junitlauncher ant manual - + * doesn't work currently, because the output is truncated/overwritten with every test */ private void flushToDisk() { - try (FileWriter writer = new FileWriter("build/status-as-tests-run.txt", true)) { + String outFile = System.getProperty("junit5.progress.file", "build/status-as-tests-run.txt"); + try (FileWriter writer = new FileWriter(outFile, true)) { writer.write(inMemoryWriter.toString()); } catch (IOException e) { throw new UncheckedIOException(e);