Repository: maven-surefire Updated Branches: refs/heads/master 308d941c9 -> b2488b645
[SUREFIRE] refactoring Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/02a8a599 Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/02a8a599 Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/02a8a599 Branch: refs/heads/master Commit: 02a8a599aa9d73b799e8de9899a2eec4735936ad Parents: 308d941 Author: Tibor17 <tibo...@lycos.com> Authored: Sun Sep 25 11:32:43 2016 +0200 Committer: Tibor17 <tibo...@lycos.com> Committed: Sun Oct 2 11:12:36 2016 +0200 ---------------------------------------------------------------------- .../plugin/surefire/report/ConsoleOutputFileReporter.java | 5 +++-- .../maven/plugin/surefire/report/WrappedReportEntry.java | 4 ++-- .../plugin/surefire/booterclient/ForkingRunListenerTest.java | 7 +++++-- .../apache/maven/surefire/report/ConsoleOutputCapture.java | 3 +-- .../org/apache/maven/surefire/util/internal/StringUtils.java | 2 ++ 5 files changed, 13 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/02a8a599/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleOutputFileReporter.java ---------------------------------------------------------------------- diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleOutputFileReporter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleOutputFileReporter.java index d7e0df7..f9e59fe 100644 --- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleOutputFileReporter.java +++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleOutputFileReporter.java @@ -25,6 +25,8 @@ import java.io.IOException; import org.apache.maven.surefire.report.ReportEntry; +import static org.apache.maven.plugin.surefire.report.FileReporter.getReportFile; + /** * Surefire output consumer proxy that writes test output to a {@link java.io.File} for each test suite. * <p/> @@ -88,8 +90,7 @@ public class ConsoleOutputFileReporter //noinspection ResultOfMethodCallIgnored reportsDirectory.mkdirs(); } - File file = - FileReporter.getReportFile( reportsDirectory, reportEntryName, reportNameSuffix, "-output.txt" ); + File file = getReportFile( reportsDirectory, reportEntryName, reportNameSuffix, "-output.txt" ); fileOutputStream = new FileOutputStream( file ); } fileOutputStream.write( buf, off, len ); http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/02a8a599/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/WrappedReportEntry.java ---------------------------------------------------------------------- diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/WrappedReportEntry.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/WrappedReportEntry.java index 12f63e5..2394ff0 100644 --- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/WrappedReportEntry.java +++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/WrappedReportEntry.java @@ -22,14 +22,14 @@ package org.apache.maven.plugin.surefire.report; import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.StackTraceWriter; +import static org.apache.maven.surefire.util.internal.StringUtils.NL; + /** * @author Kristian Rosenvold */ public class WrappedReportEntry implements ReportEntry { - private static final String NL = System.getProperty( "line.separator" ); - private final ReportEntry original; private final ReportEntryType reportEntryType; http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/02a8a599/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkingRunListenerTest.java ---------------------------------------------------------------------- diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkingRunListenerTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkingRunListenerTest.java index cccb14b..5b8867b 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkingRunListenerTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkingRunListenerTest.java @@ -268,8 +268,11 @@ public class ForkingRunListenerTest ReportEntry expected = createDefaultReportEntry(); final SimpleReportEntry secondExpected = createAnotherDefaultReportEntry(); - new ForkingRunListener( printStream, defaultChannel, false ).testStarting( expected ); - new ForkingRunListener( printStream, anotherChannel, false ).testSkipped( secondExpected ); + new ForkingRunListener( printStream, defaultChannel, false ) + .testStarting( expected ); + + new ForkingRunListener( printStream, anotherChannel, false ) + .testSkipped( secondExpected ); TestSetMockReporterFactory providerReporterFactory = new TestSetMockReporterFactory(); NullConsoleLogger log = new NullConsoleLogger(); http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/02a8a599/surefire-api/src/main/java/org/apache/maven/surefire/report/ConsoleOutputCapture.java ---------------------------------------------------------------------- diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/report/ConsoleOutputCapture.java b/surefire-api/src/main/java/org/apache/maven/surefire/report/ConsoleOutputCapture.java index bb33b3a..b583593 100644 --- a/surefire-api/src/main/java/org/apache/maven/surefire/report/ConsoleOutputCapture.java +++ b/surefire-api/src/main/java/org/apache/maven/surefire/report/ConsoleOutputCapture.java @@ -25,6 +25,7 @@ import java.io.PrintStream; import static java.lang.System.setErr; import static java.lang.System.setOut; +import static org.apache.maven.surefire.util.internal.StringUtils.NL; /** * Deals with system.out/err. @@ -41,8 +42,6 @@ public class ConsoleOutputCapture private static class ForwardingPrintStream extends PrintStream { - private static final String NL = System.getProperty( "line.separator" ); - private final boolean isStdout; private final ConsoleOutputReceiver target; http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/02a8a599/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/StringUtils.java ---------------------------------------------------------------------- diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/StringUtils.java b/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/StringUtils.java index c5f48c1..07722a1 100644 --- a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/StringUtils.java +++ b/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/StringUtils.java @@ -57,6 +57,8 @@ import java.util.StringTokenizer; */ public class StringUtils { + public static final String NL = System.getProperty( "line.separator" ); + private static final byte[] HEX_CHARS = new byte[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };