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 2018/09/12 01:09:06 UTC

[maven-surefire] branch 1559 created (now 15475f2)

This is an automated email from the ASF dual-hosted git repository.

tibordigana pushed a change to branch 1559
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git.


      at 15475f2  [SUREFIRE-1559] XML Report elements rerunError, rerunFailure, flakyFailure, flakyError should contain element stackTrace and should not be simpleContent.

This branch includes the following new commits:

     new 15475f2  [SUREFIRE-1559] XML Report elements rerunError, rerunFailure, flakyFailure, flakyError should contain element stackTrace and should not be simpleContent.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-surefire] 01/01: [SUREFIRE-1559] XML Report elements rerunError, rerunFailure, flakyFailure, flakyError should contain element stackTrace and should not be simpleContent.

Posted by ti...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tibordigana pushed a commit to branch 1559
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git

commit 15475f28d005b73e1d1eaf8ebb70f18aeca4d30e
Author: Tibor17 <ti...@apache.org>
AuthorDate: Wed Sep 12 03:08:48 2018 +0200

    [SUREFIRE-1559] XML Report elements rerunError, rerunFailure, flakyFailure, flakyError should contain element stackTrace and should not be simpleContent.
---
 .../surefire/report/StatelessXmlReporter.java      | 12 ++++
 .../site/resources/xsd/surefire-test-report.xsd    | 66 +++++++++++-----------
 2 files changed, 46 insertions(+), 32 deletions(-)

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 1e79a7d..0773788 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
@@ -404,9 +404,21 @@ public class StatelessXmlReporter
             }
         }
 
+        boolean hasNestedElements = createOutErrElementsInside & stackTrace != null;
+
         if ( stackTrace != null )
         {
+            if ( hasNestedElements )
+            {
+                ppw.startElement( "stackTrace" );
+            }
+
             ppw.writeText( extraEscape( stackTrace, false ) );
+
+            if ( hasNestedElements )
+            {
+                ppw.endElement();
+            }
         }
 
         if ( createOutErrElementsInside )
diff --git a/maven-surefire-plugin/src/site/resources/xsd/surefire-test-report.xsd b/maven-surefire-plugin/src/site/resources/xsd/surefire-test-report.xsd
index 684f175..898bb86 100644
--- a/maven-surefire-plugin/src/site/resources/xsd/surefire-test-report.xsd
+++ b/maven-surefire-plugin/src/site/resources/xsd/surefire-test-report.xsd
@@ -47,30 +47,30 @@
                                         <xs:extension base="xs:string">
                                             <xs:attribute name="message" type="xs:string"/>
                                             <xs:attribute name="type" type="xs:string" use="required"/>
-                                            <xs:attribute name="time" type="SUREFIRE_TIME" />
                                         </xs:extension>
                                     </xs:simpleContent>
                                 </xs:complexType>
                             </xs:element>
-                            <xs:element name="rerunFailure" nillable="true" minOccurs="0" maxOccurs="unbounded">
+                            <xs:element name="rerunFailure" minOccurs="0" maxOccurs="unbounded">
                                 <xs:complexType>
-                                    <xs:simpleContent>
-                                        <xs:extension base="xs:string">
-                                            <xs:attribute name="message" type="xs:string"/>
-                                            <xs:attribute name="type" type="xs:string" use="required"/>
-                                            <xs:attribute name="time" type="SUREFIRE_TIME" />
-                                        </xs:extension>
-                                    </xs:simpleContent>
+                                    <xs:sequence>
+                                        <xs:element name="stackTrace" type="xs:string"/>
+                                        <xs:element name="system-out" type="xs:string" minOccurs="0"/>
+                                        <xs:element name="system-err" type="xs:string" minOccurs="0"/>
+                                    </xs:sequence>
+                                    <xs:attribute name="message" type="xs:string"/>
+                                    <xs:attribute name="type" type="xs:string" use="required"/>
                                 </xs:complexType>
                             </xs:element>
-                            <xs:element name="flakyFailure" nillable="true" minOccurs="0" maxOccurs="unbounded">
+                            <xs:element name="flakyFailure" minOccurs="0" maxOccurs="unbounded">
                                 <xs:complexType>
-                                    <xs:simpleContent>
-                                        <xs:extension base="xs:string">
-                                            <xs:attribute name="message" type="xs:string"/>
-                                            <xs:attribute name="type" type="xs:string" use="required"/>
-                                            <xs:attribute name="time" type="SUREFIRE_TIME" />                                        </xs:extension>
-                                    </xs:simpleContent>
+                                    <xs:sequence>
+                                        <xs:element name="stackTrace" type="xs:string"/>
+                                        <xs:element name="system-out" type="xs:string" minOccurs="0"/>
+                                        <xs:element name="system-err" type="xs:string" minOccurs="0"/>
+                                    </xs:sequence>
+                                    <xs:attribute name="message" type="xs:string"/>
+                                    <xs:attribute name="type" type="xs:string" use="required"/>
                                 </xs:complexType>
                             </xs:element>
                             <xs:element name="skipped" nillable="true" minOccurs="0" maxOccurs="1">
@@ -92,28 +92,30 @@
                                     </xs:simpleContent>
                                 </xs:complexType>
                             </xs:element>
-                            <xs:element name="rerunError" nillable="true" minOccurs="0" maxOccurs="unbounded">
+                            <xs:element name="rerunError" minOccurs="0" maxOccurs="unbounded">
                                 <xs:complexType>
-                                    <xs:simpleContent>
-                                        <xs:extension base="xs:string">
-                                            <xs:attribute name="message" type="xs:string"/>
-                                            <xs:attribute name="type" type="xs:string" use="required"/>
-                                            <xs:attribute name="time" type="SUREFIRE_TIME" />                                        </xs:extension>
-                                    </xs:simpleContent>
+                                    <xs:sequence>
+                                        <xs:element name="stackTrace" type="xs:string"/>
+                                        <xs:element name="system-out" type="xs:string" minOccurs="0"/>
+                                        <xs:element name="system-err" type="xs:string" minOccurs="0"/>
+                                    </xs:sequence>
+                                    <xs:attribute name="message" type="xs:string"/>
+                                    <xs:attribute name="type" type="xs:string" use="required"/>
                                 </xs:complexType>
                             </xs:element>
-                            <xs:element name="flakyError" nillable="true" minOccurs="0" maxOccurs="unbounded">
+                            <xs:element name="flakyError" minOccurs="0" maxOccurs="unbounded">
                                 <xs:complexType>
-                                    <xs:simpleContent>
-                                        <xs:extension base="xs:string">
-                                            <xs:attribute name="message" type="xs:string"/>
-                                            <xs:attribute name="type" type="xs:string" use="required"/>
-                                            <xs:attribute name="time" type="SUREFIRE_TIME" />                                        </xs:extension>
-                                    </xs:simpleContent>
+                                    <xs:sequence>
+                                        <xs:element name="stackTrace" type="xs:string"/>
+                                        <xs:element name="system-out" type="xs:string" minOccurs="0"/>
+                                        <xs:element name="system-err" type="xs:string" minOccurs="0"/>
+                                    </xs:sequence>
+                                    <xs:attribute name="message" type="xs:string"/>
+                                    <xs:attribute name="type" type="xs:string" use="required"/>
                                 </xs:complexType>
                             </xs:element>
-                            <xs:element name="system-out" nillable="true" minOccurs="0" maxOccurs="1"/>
-                            <xs:element name="system-err" nillable="true" minOccurs="0" maxOccurs="1"/>
+                            <xs:element name="system-out" type="xs:string" minOccurs="0"/>
+                            <xs:element name="system-err" type="xs:string" minOccurs="0"/>
                         </xs:sequence>
                         <xs:attribute name="name" type="xs:string" use="required"/>
                         <xs:attribute name="classname" type="xs:string"/>