From f5e1bd2b65c5590ab30a3d9dd2d4bb35a5286442 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Mon, 15 Jan 2024 15:07:57 +0100 Subject: [PATCH 1/2] Buffer for more Speed --- .../optional/junitlauncher/LauncherSupport.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/LauncherSupport.java b/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/LauncherSupport.java index 65335dc033..f886d1beeb 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/LauncherSupport.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/LauncherSupport.java @@ -45,14 +45,7 @@ import org.junit.platform.launcher.listeners.SummaryGeneratingListener; import org.junit.platform.launcher.listeners.TestExecutionSummary; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PipedInputStream; -import java.io.PipedOutputStream; -import java.io.PrintStream; -import java.io.UncheckedIOException; +import java.io.*; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -257,7 +250,7 @@ private void setupResultFormatter(final TestRequest testRequest, final ListenerD // set the destination output stream for writing out the formatted result final java.nio.file.Path resultOutputFile = getListenerOutputFile(testRequest, formatterDefinition); try { - final OutputStream resultOutputStream = Files.newOutputStream(resultOutputFile); + final OutputStream resultOutputStream = new BufferedOutputStream(Files.newOutputStream(resultOutputFile)); // enroll the output stream to be closed when the execution of the TestRequest completes testRequest.closeUponCompletion(resultOutputStream); resultFormatter.setDestination(new KeepAliveOutputStream(resultOutputStream)); From 0aa66de093444d9a30c0d4c5401e3512b4f3a82d Mon Sep 17 00:00:00 2001 From: Thorsten Date: Mon, 15 Jan 2024 15:22:11 +0100 Subject: [PATCH 2/2] Found the import thing --- .../optional/junitlauncher/LauncherSupport.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/LauncherSupport.java b/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/LauncherSupport.java index f886d1beeb..e3138001a1 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/LauncherSupport.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/LauncherSupport.java @@ -45,7 +45,15 @@ import org.junit.platform.launcher.listeners.SummaryGeneratingListener; import org.junit.platform.launcher.listeners.TestExecutionSummary; -import java.io.*; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PipedInputStream; +import java.io.PipedOutputStream; +import java.io.PrintStream; +import java.io.UncheckedIOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths;