From 9d2afac05d1129355b5b7aca584744eb1124e586 Mon Sep 17 00:00:00 2001 From: Bing Xu Date: Tue, 29 Oct 2024 21:46:09 +1100 Subject: [PATCH] Swap to minOccurs=0 from nillable in the failsafe-summary.xsd for the flakes element. Add a comment noting that flakes will be expected in the failsafe-summary in the future. Incorporate the value of flakes into RunResult.hashCode() to be consistent with the new implementation of toEquals --- .../maven/plugin/failsafe/util/FailsafeSummaryXmlUtils.java | 1 + .../src/site/resources/xsd/failsafe-summary.xsd | 2 +- .../java/org/apache/maven/surefire/api/suite/RunResult.java | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/util/FailsafeSummaryXmlUtils.java b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/util/FailsafeSummaryXmlUtils.java index 149e19118e..9fb01a46ca 100644 --- a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/util/FailsafeSummaryXmlUtils.java +++ b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/util/FailsafeSummaryXmlUtils.java @@ -92,6 +92,7 @@ public static RunResult toRunResult(File failsafeSummaryXml) throws Exception { parseInt(errors), parseInt(failures), parseInt(skipped), + // Backwards compatability - to be replaced with parseInt in a future release isBlank(flakes) ? 0 : parseInt(flakes), isBlank(failureMessage) ? null : unescapeXml(failureMessage), parseBoolean(timeout)); diff --git a/maven-surefire-plugin/src/site/resources/xsd/failsafe-summary.xsd b/maven-surefire-plugin/src/site/resources/xsd/failsafe-summary.xsd index 216690a98a..1cb22b2d57 100644 --- a/maven-surefire-plugin/src/site/resources/xsd/failsafe-summary.xsd +++ b/maven-surefire-plugin/src/site/resources/xsd/failsafe-summary.xsd @@ -25,7 +25,7 @@ - + diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/api/suite/RunResult.java b/surefire-api/src/main/java/org/apache/maven/surefire/api/suite/RunResult.java index e05c881269..545e7ab447 100644 --- a/surefire-api/src/main/java/org/apache/maven/surefire/api/suite/RunResult.java +++ b/surefire-api/src/main/java/org/apache/maven/surefire/api/suite/RunResult.java @@ -221,6 +221,7 @@ public int hashCode() { result = 31 * result + errors; result = 31 * result + failures; result = 31 * result + skipped; + result = 31 * result + flakes; result = 31 * result + (failure != null ? failure.hashCode() : 0); result = 31 * result + (timeout ? 1 : 0); return result;