elharo commented on code in PR #772:
URL: https://github.com/apache/maven-surefire/pull/772#discussion_r1874927220


##########
surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire2252JUnit5IT.java:
##########
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.surefire.its.jiras;
+
+import org.apache.maven.surefire.its.fixture.OutputValidator;
+import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.junit.Test;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.is;
+
+/**
+ * Integration tests for SUREFIRE-2252
+ */
+public class Surefire2252JUnit5IT extends SurefireJUnit4IntegrationTestCase {
+    @Test
+    public void testJUnit5() throws Exception {
+        unpack("surefire-2252-junit5-parallel")
+                .executeTest()
+                .verifyTextInLog(
+                        "Using auto detected provider 
org.apache.maven.surefire.junitplatform.JUnitPlatformProvider")
+                .assertThatLogLine(containsString("Tests run: 1, Failures: 0, 
Errors: 0, Skipped: 0"), is(2));
+    }
+
+    @Test
+    public void testJUnit5Xml() {
+        OutputValidator validator =
+                
unpack("surefire-2252-junit5-parallel-xml").executeTest().verifyErrorFree(2);
+
+        validator
+                .getSurefireReportsFile("TEST-pkg.domain.AxTest.xml", UTF_8)

Review Comment:
   When testing the output in XML, we really should use a parser to read the 
file, and then test the resulting tree. Relying on the text serialization is 
fragile.
   
   Yes, I know we don't do this in most existing tests. Fixing that is on my 
todo list, and doing something wrong 17 times is not a good reason to do it 
wrong the 18th. :-) 



##########
surefire-its/src/test/resources/surefire-2252-junit5-parallel-xml/pom.xml:
##########
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.example</groupId>
+  <artifactId>surefire-2252-junit5-parallel-xml</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    
<maven.compiler.source>${java.specification.version}</maven.compiler.source>
+    
<maven.compiler.target>${java.specification.version}</maven.compiler.target>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+      <version>5.10.2</version>

Review Comment:
   5.11.3



##########
surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire2252JUnit5IT.java:
##########
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.surefire.its.jiras;
+
+import org.apache.maven.surefire.its.fixture.OutputValidator;
+import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.junit.Test;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.is;
+
+/**
+ * Integration tests for SUREFIRE-2252
+ */
+public class Surefire2252JUnit5IT extends SurefireJUnit4IntegrationTestCase {
+    @Test
+    public void testJUnit5() throws Exception {
+        unpack("surefire-2252-junit5-parallel")
+                .executeTest()
+                .verifyTextInLog(
+                        "Using auto detected provider 
org.apache.maven.surefire.junitplatform.JUnitPlatformProvider")

Review Comment:
   I wouldn't bother to assert this one.  It's the sort of detail that can 
easily change wording without truly breaking anything. The next assert is the 
one we care about.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to