You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2016/10/02 09:13:15 UTC

[1/4] maven-surefire git commit: [SUREFIRE] refactoring

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 <ti...@lycos.com>
Authored: Sun Sep 25 11:32:43 2016 +0200
Committer: Tibor17 <ti...@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' };


[4/4] maven-surefire git commit: [SUREFIRE-1289] forkedProcessTimeoutInSeconds should not use ping timer of 10 seconds but 0.1 sec period timer

Posted by ti...@apache.org.
[SUREFIRE-1289] forkedProcessTimeoutInSeconds should not use ping timer of 10 seconds but 0.1 sec period timer


Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/b2488b64
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/b2488b64
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/b2488b64

Branch: refs/heads/master
Commit: b2488b64567934c341d2643856d57dd48aa88359
Parents: e563566
Author: Tibor17 <ti...@lycos.com>
Authored: Sun Oct 2 11:08:51 2016 +0200
Committer: Tibor17 <ti...@lycos.com>
Committed: Sun Oct 2 11:12:39 2016 +0200

----------------------------------------------------------------------
 .../org/apache/maven/plugin/surefire/booterclient/ForkStarter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/b2488b64/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
index 4f9c813..baea043 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
@@ -716,7 +716,7 @@ public class ForkStarter
 
     private ScheduledFuture<?> triggerTimeoutCheck()
     {
-        return pingThreadScheduler.scheduleAtFixedRate( new Runnable()
+        return timeoutCheckScheduler.scheduleAtFixedRate( new Runnable()
         {
             public void run()
             {


[2/4] maven-surefire git commit: [SUREFIRE] refactoring

Posted by ti...@apache.org.
[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/4f3f59e2
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/4f3f59e2
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/4f3f59e2

Branch: refs/heads/master
Commit: 4f3f59e2dcdeba154c7d22dea05f906e6f54d0e7
Parents: 02a8a59
Author: Tibor17 <ti...@lycos.com>
Authored: Sat Oct 1 02:32:11 2016 +0200
Committer: Tibor17 <ti...@lycos.com>
Committed: Sun Oct 2 11:12:37 2016 +0200

----------------------------------------------------------------------
 .../maven/plugin/surefire/report/StatelessXmlReporter.java    | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/4f3f59e2/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
index 9e22f1e..f30e54f 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
@@ -293,7 +293,6 @@ public class StatelessXmlReporter
 
         try
         {
-
             return new FileOutputStream( reportFile );
         }
         catch ( Exception e )
@@ -322,9 +321,9 @@ public class StatelessXmlReporter
     private static File getReportFile( ReportEntry report, File reportsDirectory, String reportNameSuffix )
     {
         String reportName = "TEST-" + report.getName();
-        return isNotBlank( reportNameSuffix )
-            ? new File( reportsDirectory, stripIllegalFilenameChars( reportName + "-" + reportNameSuffix + ".xml" ) )
-            : new File( reportsDirectory, stripIllegalFilenameChars( reportName + ".xml" ) );
+        String reportFileName =
+                isNotBlank( reportNameSuffix ) ? reportName + "-" + reportNameSuffix + ".xml" : reportName + ".xml";
+        return new File( reportsDirectory, stripIllegalFilenameChars( reportFileName ) );
     }
 
     private static void startTestElement( XMLWriter ppw, WrappedReportEntry report, String reportNameSuffix,


[3/4] maven-surefire git commit: [SUREFIRE] refactoring

Posted by ti...@apache.org.
[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/e563566b
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/e563566b
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/e563566b

Branch: refs/heads/master
Commit: e563566b4d3713cc1277771c31a86defbeb7ddbe
Parents: 4f3f59e
Author: Tibor17 <ti...@lycos.com>
Authored: Sun Oct 2 11:08:09 2016 +0200
Committer: Tibor17 <ti...@lycos.com>
Committed: Sun Oct 2 11:12:38 2016 +0200

----------------------------------------------------------------------
 .../surefire/report/StatelessXmlReporter.java   | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/e563566b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
index f30e54f..8ebeb96 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
@@ -45,7 +45,7 @@ import java.util.StringTokenizer;
 
 import static org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType;
 import static org.apache.maven.plugin.surefire.report.FileReporterUtils.stripIllegalFilenameChars;
-import static org.apache.maven.surefire.util.internal.StringUtils.isNotBlank;
+import static org.apache.maven.surefire.util.internal.StringUtils.isBlank;
 
 // CHECKSTYLE_OFF: LineLength
 /**
@@ -321,9 +321,8 @@ public class StatelessXmlReporter
     private static File getReportFile( ReportEntry report, File reportsDirectory, String reportNameSuffix )
     {
         String reportName = "TEST-" + report.getName();
-        String reportFileName =
-                isNotBlank( reportNameSuffix ) ? reportName + "-" + reportNameSuffix + ".xml" : reportName + ".xml";
-        return new File( reportsDirectory, stripIllegalFilenameChars( reportFileName ) );
+        String customizedReportName = isBlank( reportNameSuffix ) ? reportName : reportName + "-" + reportNameSuffix;
+        return new File( reportsDirectory, stripIllegalFilenameChars( customizedReportName + ".xml" ) );
     }
 
     private static void startTestElement( XMLWriter ppw, WrappedReportEntry report, String reportNameSuffix,
@@ -490,7 +489,6 @@ public class StatelessXmlReporter
                 xmlWriter.addAttribute( "value", extraEscape( value, true ) );
 
                 xmlWriter.endElement();
-
             }
         }
         xmlWriter.endElement();
@@ -506,14 +504,10 @@ public class StatelessXmlReporter
     private static String extraEscape( String message, boolean attribute )
     {
         // Someday convert to xml 1.1 which handles everything but 0 inside string
-        if ( !containsEscapesIllegalnXml10( message ) )
-        {
-            return message;
-        }
-        return escapeXml( message, attribute );
+        return containsEscapesIllegalXml10( message ) ? escapeXml( message, attribute ) : message;
     }
 
-    private static class EncodingOutputStream
+    private static final class EncodingOutputStream
         extends FilterOutputStream
     {
         private int c1;
@@ -563,7 +557,7 @@ public class StatelessXmlReporter
         }
     }
 
-    private static boolean containsEscapesIllegalnXml10( String message )
+    private static boolean containsEscapesIllegalXml10( String message )
     {
         int size = message.length();
         for ( int i = 0; i < size; i++ )
@@ -611,7 +605,7 @@ public class StatelessXmlReporter
         return sb.toString();
     }
 
-    private static class ByteConstantsHolder
+    private static final class ByteConstantsHolder
     {
         private static final byte[] CDATA_START_BYTES;