You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sj...@apache.org on 2024/09/22 17:48:30 UTC

(maven-surefire) branch master updated: [SUREFIRE-1737] Fix disable in statelessTestsetReporter

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

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


The following commit(s) were added to refs/heads/master by this push:
     new a9282552d [SUREFIRE-1737] Fix disable in statelessTestsetReporter
a9282552d is described below

commit a9282552d2086299a400a27781509e2b942a743d
Author: Slawomir Jaranowski <s....@gmail.com>
AuthorDate: Thu Sep 19 22:55:15 2024 +0200

    [SUREFIRE-1737] Fix disable in statelessTestsetReporter
---
 .../maven/plugin/surefire/AbstractSurefireMojo.java  | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
index aaa1cf2fb..6e0de4730 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
@@ -168,9 +168,6 @@ public abstract class AbstractSurefireMojo extends AbstractMojo implements Suref
 
     private final ClasspathCache classpathCache = new ClasspathCache();
 
-    /**
-     * Note: use the legacy system property <em>disableXmlReport</em> set to {@code true} to disable the report.
-     */
     @Parameter
     private SurefireStatelessReporter statelessTestsetReporter;
 
@@ -706,12 +703,12 @@ public abstract class AbstractSurefireMojo extends AbstractMojo implements Suref
     /**
      * Flag to disable the generation of report files in xml format.
      * Deprecated since 3.0.0-M4.
-     * Instead use <em>disable</em> within {@code statelessTestsetReporter} since of 3.0.0-M6.
+     * @deprecated Instead use <em>disable</em> within {@code statelessTestsetReporter} since of 3.0.0-M6.
      * @since 2.2
      */
     @Deprecated // todo make readonly to handle system property
     @Parameter(property = "disableXmlReport", defaultValue = "false")
-    private boolean disableXmlReport;
+    private Boolean disableXmlReport;
 
     /**
      * By default, Surefire enables JVM assertions for the execution of your test cases. To disable the assertions, set
@@ -2058,11 +2055,12 @@ public abstract class AbstractSurefireMojo extends AbstractMojo implements Suref
     }
 
     private StartupReportConfiguration getStartupReportConfiguration(String configChecksum, boolean isForking) {
-        SurefireStatelessReporter xmlReporter = statelessTestsetReporter == null
-                ? new SurefireStatelessReporter(/*todo call def. constr.*/ isDisableXmlReport(), "3.0.2")
-                : statelessTestsetReporter;
+        SurefireStatelessReporter xmlReporter =
+                statelessTestsetReporter == null ? new SurefireStatelessReporter() : statelessTestsetReporter;
 
-        xmlReporter.setDisable(isDisableXmlReport()); // todo change to Boolean in the version 3.0.0-M6
+        if (isDisableXmlReport() != null) {
+            xmlReporter.setDisable(isDisableXmlReport());
+        }
 
         SurefireConsoleOutputReporter outReporter =
                 consoleOutputReporter == null ? new SurefireConsoleOutputReporter() : consoleOutputReporter;
@@ -3557,12 +3555,12 @@ public abstract class AbstractSurefireMojo extends AbstractMojo implements Suref
         this.trimStackTrace = trimStackTrace;
     }
 
-    public boolean isDisableXmlReport() {
+    public Boolean isDisableXmlReport() {
         return disableXmlReport;
     }
 
     @SuppressWarnings("UnusedDeclaration")
-    public void setDisableXmlReport(boolean disableXmlReport) {
+    public void setDisableXmlReport(Boolean disableXmlReport) {
         this.disableXmlReport = disableXmlReport;
     }