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 2022/01/23 23:32:52 UTC

[maven-surefire] branch release/2.22.3 updated (7020cda -> 974016d)

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

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


 discard 7020cda  enabled and fixed tests in surefire-junit-platform
 discard 0007085  setupJunitLogger() should be called AFTER startCapture()
 discard ad11fa1  [jenkinsci] windows-he, Maven 3.2.x and 3.5.x; JDK 7,8,11,17
     new 70b3729  [jenkinsci] windows-he, Maven 3.2.x and 3.5.x; JDK 7,8,11,13
     new 14c3b01  [SUREFIRE-1983] Corrupted STDOUT by directly writing to native stream in forked JVM 1. [setupJunitLogger() should be called AFTER startCapture()]
     new 974016d  enabled and fixed tests in surefire-junit-platform

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (7020cda)
            \
             N -- N -- N   refs/heads/release/2.22.3 (974016d)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 3 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.


Summary of changes:
 Jenkinsfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

[maven-surefire] 01/03: [jenkinsci] windows-he, Maven 3.2.x and 3.5.x; JDK 7,8,11,13

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

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

commit 70b3729659cc7390c7593902453bb31c2f30c9e6
Author: Tibor Digaňa <ti...@apache.org>
AuthorDate: Sun Jan 23 07:06:27 2022 +0100

    [jenkinsci] windows-he, Maven 3.2.x and 3.5.x; JDK 7,8,11,13
---
 Jenkinsfile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 9de3f2f..19226e7 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -30,9 +30,9 @@ properties(
     ]
 )
 
-final def oses = ['linux':'ubuntu && !H24', 'windows':'Windows']
-final def mavens = env.BRANCH_NAME == 'master' ? ['3.2.x', '3.3.x', '3.5.x'] : ['3.5.x']
-final def jdks = [7, 8, 9, 10, 11]
+final def oses = ['linux':'ubuntu', 'windows':'windows-he']
+final def mavens = env.BRANCH_NAME == 'master' ? ['3.2.x', '3.5.x'] : ['3.5.x']
+final def jdks = [7, 8, 11, 13]
 
 final def options = ['-e', '-V', '-B', '-nsu', '-P', 'run-its']
 final def goals = ['clean', 'install', 'jacoco:report']

[maven-surefire] 03/03: enabled and fixed tests in surefire-junit-platform

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

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

commit 974016d1ed81a1b8d76d15e5126662adbe0953bc
Author: Tibor Digaňa <ti...@apache.org>
AuthorDate: Sun Jan 23 20:57:40 2022 +0100

    enabled and fixed tests in surefire-junit-platform
---
 surefire-providers/surefire-junit-platform/pom.xml |  4 ++
 .../surefire/junitplatform/JUnit47SuiteTest.java   | 44 ++++++++++++++++++++++
 .../junitplatform/RunListenerAdapterTest.java      |  5 ++-
 .../junitplatform/TestMethodFilterTest.java        |  5 ++-
 4 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/surefire-providers/surefire-junit-platform/pom.xml b/surefire-providers/surefire-junit-platform/pom.xml
index b50dc6d..da34605 100644
--- a/surefire-providers/surefire-junit-platform/pom.xml
+++ b/surefire-providers/surefire-junit-platform/pom.xml
@@ -138,6 +138,10 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <jvm>${java.home}/bin/java</jvm>
+                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
+                    <includes>
+                        <include>**/JUnit47SuiteTest.java</include>
+                    </includes>
                 </configuration>
             </plugin>
             <plugin>
diff --git a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/JUnit47SuiteTest.java b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/JUnit47SuiteTest.java
new file mode 100644
index 0000000..6e56760
--- /dev/null
+++ b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/JUnit47SuiteTest.java
@@ -0,0 +1,44 @@
+package org.apache.maven.surefire.junitplatform;
+
+/*
+ * 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.
+ */
+
+import junit.framework.JUnit4TestAdapter;
+import junit.framework.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ *
+ */
+@SuiteClasses( {
+        JUnitPlatformProviderTest.class,
+        RunListenerAdapterTest.class,
+        TestMethodFilterTest.class,
+        TestPlanScannerFilterTest.class
+} )
+@RunWith( Suite.class )
+public class JUnit47SuiteTest
+{
+    public static Test suite()
+    {
+        return new JUnit4TestAdapter( JUnit47SuiteTest.class );
+    }
+}
diff --git a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java
index a6cbddd..a0ba6b7 100644
--- a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java
+++ b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java
@@ -46,9 +46,11 @@ import org.apache.maven.surefire.report.SimpleReportEntry;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.engine.config.DefaultJupiterConfiguration;
 import org.junit.jupiter.engine.config.JupiterConfiguration;
 import org.junit.jupiter.engine.descriptor.ClassTestDescriptor;
 import org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor;
+import org.junit.platform.engine.ConfigurationParameters;
 import org.junit.platform.engine.TestDescriptor;
 import org.junit.platform.engine.TestDescriptor.Type;
 import org.junit.platform.engine.TestExecutionResult;
@@ -69,7 +71,8 @@ import org.mockito.InOrder;
  */
 public class RunListenerAdapterTest
 {
-    private static final JupiterConfiguration JUPITER_CONFIGURATION = mock(JupiterConfiguration.class);
+    private static final JupiterConfiguration JUPITER_CONFIGURATION =
+            new DefaultJupiterConfiguration( mock( ConfigurationParameters.class ) );
 
     private RunListener listener;
 
diff --git a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/TestMethodFilterTest.java b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/TestMethodFilterTest.java
index 3633faa..b5cb528 100644
--- a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/TestMethodFilterTest.java
+++ b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/TestMethodFilterTest.java
@@ -29,9 +29,11 @@ import java.lang.reflect.Method;
 
 import org.apache.maven.surefire.testset.TestListResolver;
 import org.junit.Test;
+import org.junit.jupiter.engine.config.DefaultJupiterConfiguration;
 import org.junit.jupiter.engine.config.JupiterConfiguration;
 import org.junit.jupiter.engine.descriptor.ClassTestDescriptor;
 import org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor;
+import org.junit.platform.engine.ConfigurationParameters;
 import org.junit.platform.engine.FilterResult;
 import org.junit.platform.engine.UniqueId;
 
@@ -42,7 +44,8 @@ import org.junit.platform.engine.UniqueId;
  */
 public class TestMethodFilterTest
 {
-    private static final JupiterConfiguration JUPITER_CONFIGURATION = mock(JupiterConfiguration.class);
+    private static final JupiterConfiguration JUPITER_CONFIGURATION =
+            new DefaultJupiterConfiguration( mock( ConfigurationParameters.class ) );
 
     private final TestListResolver resolver = mock( TestListResolver.class );
 

[maven-surefire] 02/03: [SUREFIRE-1983] Corrupted STDOUT by directly writing to native stream in forked JVM 1. [setupJunitLogger() should be called AFTER startCapture()]

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

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

commit 14c3b018adc87c473a68435538f1463eaaeef543
Author: Tibor Digaňa <ti...@apache.org>
AuthorDate: Sun Jan 23 20:33:58 2022 +0100

    [SUREFIRE-1983] Corrupted STDOUT by directly writing to native stream in forked JVM 1. [setupJunitLogger() should be called AFTER startCapture()]
---
 .../maven/surefire/junitplatform/JUnitPlatformProvider.java   | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProvider.java b/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProvider.java
index 10a5dfe..63d65c1 100644
--- a/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProvider.java
+++ b/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProvider.java
@@ -91,7 +91,6 @@ public class JUnitPlatformProvider
         this.launcher = launcher;
         filters = newFilters();
         configurationParameters = newConfigurationParameters();
-        Logger.getLogger( "org.junit" ).setLevel( WARNING );
     }
 
     @Override
@@ -110,6 +109,7 @@ public class JUnitPlatformProvider
         {
             RunListener runListener = reporterFactory.createReporter();
             startCapture( ( ConsoleOutputReceiver ) runListener );
+            setupJunitLogger();
             if ( forkTestSet instanceof TestsToRun )
             {
                 invokeAllTests( (TestsToRun) forkTestSet, runListener );
@@ -135,6 +135,15 @@ public class JUnitPlatformProvider
         return runResult;
     }
 
+    private static void setupJunitLogger()
+    {
+        Logger logger = Logger.getLogger( "org.junit" );
+        if ( logger.getLevel() == null )
+        {
+            logger.setLevel( WARNING );
+        }
+    }
+
     private TestsToRun scanClasspath()
     {
         TestPlanScannerFilter filter = new TestPlanScannerFilter( launcher, filters );