Skip to content

Commit

Permalink
[SUREFIRE-2250] Surefire Test Report Schema properties element is not…
Browse files Browse the repository at this point in the history
… consistent with the code

This closes #758
  • Loading branch information
michael-o committed Jul 7, 2024
1 parent 6aaea8a commit 561b4ca
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1978,7 +1978,7 @@ private Artifact getShadefireArtifact() {

private StartupReportConfiguration getStartupReportConfiguration(String configChecksum, boolean isForking) {
SurefireStatelessReporter xmlReporter = statelessTestsetReporter == null
? new SurefireStatelessReporter(/*todo call def. constr.*/ isDisableXmlReport(), "3.0.1")
? new SurefireStatelessReporter(/*todo call def. constr.*/ isDisableXmlReport(), "3.0.2")
: statelessTestsetReporter;

xmlReporter.setDisable(isDisableXmlReport()); // todo change to Boolean in the version 3.0.0-M6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class SurefireStatelessReporter
* Activated in the injection point of MOJO.
*/
public SurefireStatelessReporter() {
this(false, "3.0.1");
this(false, "3.0.2");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.apache.maven.surefire.extensions.StatelessReportEventListener;

/**
* The extension of {@link StatelessReportEventListener xml reporter} based on XSD version 3.0.1 for JUnit5.
* The extension of {@link StatelessReportEventListener XML reporter} based on XSD version 3.0.2 for JUnit5.
* Selectively enables phrased classes, methods and report files upon JUnit5 annotation <em>DisplayName</em>.
*
* author <a href="mailto:[email protected]">Tibor Digana (tibor17)</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void shouldCloneXmlReporter() {
@Test
public void shouldAssertToStringXmlReporter() {
SurefireStatelessReporter extension = new SurefireStatelessReporter();
assertThat(extension.toString()).isEqualTo("SurefireStatelessReporter{version=3.0.1, disable=false}");
assertThat(extension.toString()).isEqualTo("SurefireStatelessReporter{version=3.0.2, disable=false}");
}

@Test
Expand All @@ -69,7 +69,7 @@ public void shouldCreateConsoleListener() {
reportsDirectory, reportNameSuffix, true, 5, schema, true, true, testClassMethodRunHistory);
SurefireStatelessReporter extension = new SurefireStatelessReporter();

assertThat(extension.getVersion()).isEqualTo("3.0.1");
assertThat(extension.getVersion()).isEqualTo("3.0.2");
extension.setVersion("V3");
assertThat(extension.getVersion()).isEqualTo("V3");

Expand Down Expand Up @@ -128,7 +128,7 @@ public void shouldCloneJUnit5XmlReporter() {
public void shouldAssertToStringJUnit5ConsoleReporter() {
JUnit5Xml30StatelessReporter extension = new JUnit5Xml30StatelessReporter();
assertThat(extension.toString())
.isEqualTo("JUnit5Xml30StatelessReporter{version=3.0.1, disable=false, "
.isEqualTo("JUnit5Xml30StatelessReporter{version=3.0.2, disable=false, "
+ "usePhrasedFileName=false, usePhrasedTestSuiteClassName=false, "
+ "usePhrasedTestCaseClassName=false, usePhrasedTestCaseMethodName=false}");
}
Expand All @@ -144,7 +144,7 @@ public void shouldCreateJUnit5ConsoleListener() {
reportsDirectory, reportNameSuffix, true, 5, schema, true, true, testClassMethodRunHistory);
JUnit5Xml30StatelessReporter extension = new JUnit5Xml30StatelessReporter();

assertThat(extension.getVersion()).isEqualTo("3.0.1");
assertThat(extension.getVersion()).isEqualTo("3.0.2");
extension.setVersion("V3");
assertThat(extension.getVersion()).isEqualTo("V3");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void testFileNameWithoutSuffix() {
0,
new ConcurrentHashMap<String, Deque<WrappedReportEntry>>(),
XSD,
"3.0.1",
"3.0.2",
false,
false,
false,
Expand Down Expand Up @@ -167,7 +167,7 @@ public void testAllFieldsSerialized() throws IOException {
0,
new ConcurrentHashMap<String, Deque<WrappedReportEntry>>(),
XSD,
"3.0.1",
"3.0.2",
false,
false,
false,
Expand Down Expand Up @@ -271,7 +271,7 @@ public void testOutputRerunFlakyFailure() throws IOException {
1,
new HashMap<String, Deque<WrappedReportEntry>>(),
XSD,
"3.0.1",
"3.0.2",
false,
false,
false,
Expand Down Expand Up @@ -376,7 +376,7 @@ public void testOutputRerunFlakyAssumption() throws IOException {
rerunStats.testSucceeded(testTwoSecondError);

StatelessXmlReporter reporter = new StatelessXmlReporter(
reportDir, null, false, 1, new HashMap<>(), XSD, "3.0.1", false, false, false, false, true, true);
reportDir, null, false, 1, new HashMap<>(), XSD, "3.0.2", false, false, false, false, true, true);

WrappedReportEntry testSetReportEntry = new WrappedReportEntry(
new SimpleReportEntry(
Expand Down Expand Up @@ -540,7 +540,7 @@ public void testReporterHandlesATestWithoutMessageAndWithEmptyStackTrace() {
null);

StatelessXmlReporter reporter = new StatelessXmlReporter(
reportDir, null, false, 1, new HashMap<>(), XSD, "3.0.1", false, false, false, false, true, true);
reportDir, null, false, 1, new HashMap<>(), XSD, "3.0.2", false, false, false, false, true, true);

reporter.testSetCompleted(testReport, stats);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ else
<configuration>
<statelessTestsetReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5Xml30StatelessReporter">
<disable>false</disable>
<version>3.0.1</version>
<version>3.0.2</version>
<usePhrasedFileName>false</usePhrasedFileName>
<usePhrasedTestSuiteClassName>true</usePhrasedTestSuiteClassName>
<usePhrasedTestCaseClassName>true</usePhrasedTestCaseClassName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
~ specific language governing permissions and limitations
~ under the License.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="3.0.1">
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="3.0.2">
<xs:element name="testsuite">
<xs:complexType>
<xs:sequence>
<xs:element name="properties" minOccurs="0" maxOccurs="unbounded">
<xs:element name="properties" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="property" minOccurs="0" maxOccurs="unbounded">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="surefire.MyTest" version="3.0.1" time="0" tests="1" errors="1" skipped="0" failures="0">
<testsuite name="surefire.MyTest" version="3.0.2" time="0" tests="1" errors="1" skipped="0" failures="0">
<properties>
<property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public abstract class StatelessReporter<R extends TestSetReportEntry, S, C exten
private boolean disable;

/**
* Version of reporter. It is version <em>3.0.1</em> used by default in XML reporter.
* Version of reporter. It is version <em>3.0.2</em> used by default in XML reporter.
*/
private String version;

Expand All @@ -62,7 +62,7 @@ public void setDisable(boolean disable) {
}

public String getVersion() {
return isBlank(version) ? "3.0.1" : version;
return isBlank(version) ? "3.0.2" : version;
}

public void setVersion(String version) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite version="3.0.1" name="org.acme.FlakyTest" time="1.324" tests="1" errors="0" skipped="0" failures="0">
<testsuite version="3.0.2" name="org.acme.FlakyTest" time="1.324" tests="1" errors="0" skipped="0" failures="0">
<properties>
<property name="java.class.version" value="55.0"/>
</properties>
Expand Down

0 comments on commit 561b4ca

Please sign in to comment.