You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sc...@apache.org on 2017/01/08 05:08:04 UTC

[1/2] maven-surefire git commit: [MSUREFIRE-1324] Surefire incorrectly suppresses exceptions when closing resources.

Repository: maven-surefire
Updated Branches:
  refs/heads/master d580f672b -> 18018cce3


[MSUREFIRE-1324] Surefire incorrectly suppresses exceptions when closing resources.


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

Branch: refs/heads/master
Commit: cc09759a9adfa1de4ce968fa8745fc305b7c52e3
Parents: d580f67
Author: Christian Schulte <sc...@apache.org>
Authored: Sun Jan 8 06:03:13 2017 +0100
Committer: Christian Schulte <sc...@apache.org>
Committed: Sun Jan 8 06:03:13 2017 +0100

----------------------------------------------------------------------
 .../surefire/report/StatelessXmlReporter.java   | 27 ++++++++++++++------
 1 file changed, 19 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/cc09759a/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 271d3f0..b846942 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
@@ -125,10 +125,12 @@ public class StatelessXmlReporter
             getAddMethodEntryList( methodRunHistoryMap, methodEntry );
         }
 
-        FileOutputStream outputStream = getOutputStream( testSetReportEntry );
-        OutputStreamWriter fw = getWriter( outputStream );
+        FileOutputStream outputStream = null;
+        OutputStreamWriter fw = null;
         try
         {
+            outputStream = getOutputStream( testSetReportEntry );
+            fw = getWriter( outputStream );
             XMLWriter ppw = new PrettyPrintXMLWriter( fw );
             ppw.setEncoding( ENCODING );
 
@@ -239,10 +241,19 @@ public class StatelessXmlReporter
                 }
             }
             ppw.endElement(); // TestSuite
+
+            fw.close();
+            fw = null;
+            outputStream = null;
+        }
+        catch ( final IOException e )
+        {
+            throw new RuntimeException( "Failure creating report.", e );
         }
         finally
         {
             IOUtil.close( fw );
+            IOUtil.close( outputStream );
         }
     }
 
@@ -326,7 +337,7 @@ public class StatelessXmlReporter
     }
 
     private static void startTestElement( XMLWriter ppw, WrappedReportEntry report, String reportNameSuffix,
-                                          String timeAsString )
+                                          String timeAsString ) throws IOException
     {
         ppw.startElement( "testcase" );
         ppw.addAttribute( "name", report.getReportName() );
@@ -349,7 +360,7 @@ public class StatelessXmlReporter
     }
 
     private void createTestSuiteElement( XMLWriter ppw, WrappedReportEntry report, TestSetStats testSetStats,
-                                         String timeAsString )
+                                         String timeAsString ) throws IOException
     {
         ppw.startElement( "testsuite" );
 
@@ -376,7 +387,7 @@ public class StatelessXmlReporter
 
     private static void getTestProblems( OutputStreamWriter outputStreamWriter, XMLWriter ppw,
                                          WrappedReportEntry report, boolean trimStackTrace, FileOutputStream fw,
-                                         String testErrorType, boolean createOutErrElementsInside )
+                                         String testErrorType, boolean createOutErrElementsInside ) throws IOException
     {
         ppw.startElement( testErrorType );
 
@@ -421,7 +432,7 @@ public class StatelessXmlReporter
 
     // Create system-out and system-err elements
     private static void createOutErrElements( OutputStreamWriter outputStreamWriter, XMLWriter ppw,
-                                              WrappedReportEntry report, FileOutputStream fw )
+                                              WrappedReportEntry report, FileOutputStream fw ) throws IOException
     {
         EncodingOutputStream eos = new EncodingOutputStream( fw );
         addOutputStreamElement( outputStreamWriter, eos, ppw, report.getStdout(), "system-out" );
@@ -431,7 +442,7 @@ public class StatelessXmlReporter
     private static void addOutputStreamElement( OutputStreamWriter outputStreamWriter,
                                          EncodingOutputStream eos, XMLWriter xmlWriter,
                                          Utf8RecodingDeferredFileOutputStream utf8RecodingDeferredFileOutputStream,
-                                         String name )
+                                         String name ) throws IOException
     {
         if ( utf8RecodingDeferredFileOutputStream != null && utf8RecodingDeferredFileOutputStream.getByteCount() > 0 )
         {
@@ -461,7 +472,7 @@ public class StatelessXmlReporter
      *
      * @param xmlWriter The test suite to report to
      */
-    private static void showProperties( XMLWriter xmlWriter )
+    private static void showProperties( XMLWriter xmlWriter ) throws IOException
     {
         xmlWriter.startElement( "properties" );
 


[2/2] maven-surefire git commit: [MSUREFIRE-1326] Upgrade maven-shared-utils to 3.2.0.

Posted by sc...@apache.org.
[MSUREFIRE-1326] Upgrade maven-shared-utils to 3.2.0.

o Updated to 3.2.0-SNAPSHOT temporarily.


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

Branch: refs/heads/master
Commit: 18018cce343fb8394f017b867b277378c5774405
Parents: cc09759
Author: Christian Schulte <sc...@apache.org>
Authored: Sun Jan 8 06:03:57 2017 +0100
Committer: Christian Schulte <sc...@apache.org>
Committed: Sun Jan 8 06:03:57 2017 +0100

----------------------------------------------------------------------
 pom.xml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/18018cce/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 3b8ab65..4338a3e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -215,7 +215,8 @@
       <dependency>
         <groupId>org.apache.maven.shared</groupId>
         <artifactId>maven-shared-utils</artifactId>
-        <version>0.9</version>
+        <!-- https://issues.apache.org/jira/browse/MSHARED-610 -->
+        <version>3.2.0-SNAPSHOT</version>
       </dependency>
       <dependency>
         <groupId>org.apache.maven.shared</groupId>