Skip to content

Commit

Permalink
Buffer for more Speed
Browse files Browse the repository at this point in the history
  • Loading branch information
tg-freigmbh committed Jan 15, 2024
1 parent 60e3661 commit f5e1bd2
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit f5e1bd2

Please sign in to comment.