You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by pk...@apache.org on 2022/06/23 18:25:12 UTC

[logging-log4j2] branch master updated (da68155a27 -> ea10933c5a)

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

pkarwasz pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


    from da68155a27 Fail lazily
     new 9223354ee9 Use BOMs instead of single dependencies
     new ea10933c5a Add a global test listener

The 2 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:
 log4j-api-test/pom.xml                             | 28 ++++---
 ...ble.java => Log4j2LauncherSessionListener.java} | 22 ++---
 ...unit.platform.launcher.LauncherSessionListener} |  2 +-
 pom.xml                                            | 93 +++++-----------------
 4 files changed, 51 insertions(+), 94 deletions(-)
 copy log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/{Mutable.java => Log4j2LauncherSessionListener.java} (63%)
 copy log4j-api-test/src/{test/resources/META-INF/services/org.apache.logging.log4j.util.test.BetterService => main/resources/META-INF/services/org.junit.platform.launcher.LauncherSessionListener} (92%)


[logging-log4j2] 02/02: Add a global test listener

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

pkarwasz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit ea10933c5a13270f4874170db90f81f749ec211e
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Thu Jun 23 20:24:02 2022 +0200

    Add a global test listener
    
    The `Log4j2LauncherSessionListener` provides the global setup necessary
    for a parallel run.
    
    At the moment it initializes `PropertiesUtil` to prevent initialization
    during a test case and the caching of non-default properties.
---
 .../test/junit/Log4j2LauncherSessionListener.java  | 35 ++++++++++++++++++++++
 ...junit.platform.launcher.LauncherSessionListener | 16 ++++++++++
 2 files changed, 51 insertions(+)

diff --git a/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/Log4j2LauncherSessionListener.java b/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/Log4j2LauncherSessionListener.java
new file mode 100644
index 0000000000..51abd82afe
--- /dev/null
+++ b/log4j-api-test/src/main/java/org/apache/logging/log4j/test/junit/Log4j2LauncherSessionListener.java
@@ -0,0 +1,35 @@
+/*
+ * 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.logging.log4j.test.junit;
+
+import org.apache.logging.log4j.util.PropertiesUtil;
+import org.junit.platform.launcher.LauncherSession;
+import org.junit.platform.launcher.LauncherSessionListener;
+
+/**
+ * Global Log4j2 test setup.
+ */
+public class Log4j2LauncherSessionListener implements LauncherSessionListener {
+
+    @Override
+    public void launcherSessionOpened(LauncherSession session) {
+        // Prevents `PropertiesUtil` from initializing (and caching the results)
+        // in the middle of a test.
+        PropertiesUtil.getProperties();
+    }
+
+}
diff --git a/log4j-api-test/src/main/resources/META-INF/services/org.junit.platform.launcher.LauncherSessionListener b/log4j-api-test/src/main/resources/META-INF/services/org.junit.platform.launcher.LauncherSessionListener
new file mode 100644
index 0000000000..e492405c76
--- /dev/null
+++ b/log4j-api-test/src/main/resources/META-INF/services/org.junit.platform.launcher.LauncherSessionListener
@@ -0,0 +1,16 @@
+# 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.
+
+org.apache.logging.log4j.test.junit.Log4j2LauncherSessionListener
\ No newline at end of file


[logging-log4j2] 01/02: Use BOMs instead of single dependencies

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

pkarwasz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 9223354ee928bb8f3d06bacf0096fc4750f4c037
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Thu Jun 23 20:10:49 2022 +0200

    Use BOMs instead of single dependencies
    
    Adds the `junit-bom` and `spring-framework-bom` to the dependency
    management to prevent mismatched dependencies.
    
    Cleans up `log4j-api-test` dependencies base on Maven's
    `dependency:analyze` goal.
---
 log4j-api-test/pom.xml | 28 +++++++++------
 pom.xml                | 93 ++++++++++++--------------------------------------
 2 files changed, 39 insertions(+), 82 deletions(-)

diff --git a/log4j-api-test/pom.xml b/log4j-api-test/pom.xml
index d626043014..698af4e3bc 100644
--- a/log4j-api-test/pom.xml
+++ b/log4j-api-test/pom.xml
@@ -38,18 +38,12 @@
       <artifactId>log4j-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.framework</artifactId>
-      <scope>provided</scope>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.resource</artifactId>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.vintage</groupId>
-      <artifactId>junit-vintage-engine</artifactId>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
@@ -63,10 +57,18 @@
       <groupId>org.junit.platform</groupId>
       <artifactId>junit-platform-commons</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.junit.platform</groupId>
+      <artifactId>junit-platform-launcher</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.junit-pioneer</groupId>
       <artifactId>junit-pioneer</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.opentest4j</groupId>
+      <artifactId>opentest4j</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.assertj</groupId>
       <artifactId>assertj-core</artifactId>
@@ -90,9 +92,13 @@
       <artifactId>jackson-databind</artifactId>
     </dependency>
     <dependency>
-          <groupId>uk.org.webcompere</groupId>
+      <groupId>uk.org.webcompere</groupId>
       <artifactId>system-stubs-jupiter</artifactId>
     </dependency>
+    <dependency>
+      <groupId>uk.org.webcompere</groupId>
+      <artifactId>system-stubs-core</artifactId>
+    </dependency>
   </dependencies>
   <build>
     <plugins>
diff --git a/pom.xml b/pom.xml
index 3d61913ebe..cd1ae3f503 100644
--- a/pom.xml
+++ b/pom.xml
@@ -314,6 +314,18 @@
         <scope>import</scope>
         <type>pom</type>
       </dependency>
+      <dependency>
+        <groupId>org.junit</groupId>
+        <artifactId>junit-bom</artifactId>
+        <version>${junitJupiterVersion}</version>
+        <scope>import</scope>
+        <type>pom</type>
+      </dependency>
+      <dependency>
+        <groupId>org.opentest4j</groupId>
+        <artifactId>opentest4j</artifactId>
+        <version>1.2.0</version>
+      </dependency>
       <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-api</artifactId>
@@ -628,39 +640,11 @@
         <artifactId>jctools-core</artifactId>
         <version>${jctoolsVersion}</version>
       </dependency>
-      <!-- JUnit 5 engine -->
-      <dependency>
-        <groupId>org.junit.jupiter</groupId>
-        <artifactId>junit-jupiter-api</artifactId>
-        <version>${junitJupiterVersion}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.junit.jupiter</groupId>
-        <artifactId>junit-jupiter-engine</artifactId>
-        <version>${junitJupiterVersion}</version>
-      </dependency>
       <dependency>
         <groupId>org.junit-pioneer</groupId>
         <artifactId>junit-pioneer</artifactId>
         <version>${junitPioneerVersion}</version>
       </dependency>
-      <!-- JUnit 4 to 5 migration support -->
-      <dependency>
-        <groupId>org.junit.jupiter</groupId>
-        <artifactId>junit-jupiter-migrationsupport</artifactId>
-        <version>${junitJupiterVersion}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.junit.platform</groupId>
-        <artifactId>junit-platform-commons</artifactId>
-        <version>1.8.2</version>
-      </dependency>
-      <!-- JUnit 5 parameterized test support -->
-      <dependency>
-        <groupId>org.junit.jupiter</groupId>
-        <artifactId>junit-jupiter-params</artifactId>
-        <version>${junitJupiterVersion}</version>
-      </dependency>
       <!-- Environment and system properties support for Jupiter -->
       <dependency>
         <groupId>uk.org.webcompere</groupId>
@@ -668,6 +652,12 @@
         <version>2.0.1</version>
         <scope>test</scope>
       </dependency>
+      <dependency>
+        <groupId>uk.org.webcompere</groupId>
+        <artifactId>system-stubs-core</artifactId>
+        <version>2.0.1</version>
+        <scope>test</scope>
+      </dependency>
       <!-- JUnit 4 API dependency -->
       <dependency>
         <groupId>junit</groupId>
@@ -680,12 +670,6 @@
           </exclusion>
         </exclusions>
       </dependency>
-      <!-- JUnit 4 engine -->
-      <dependency>
-        <groupId>org.junit.vintage</groupId>
-        <artifactId>junit-vintage-engine</artifactId>
-        <version>${junitJupiterVersion}</version>
-      </dependency>
       <dependency>
         <groupId>org.assertj</groupId>
         <artifactId>assertj-core</artifactId>
@@ -734,23 +718,15 @@
       </dependency>
       <dependency>
         <groupId>org.springframework</groupId>
-        <artifactId>spring-aop</artifactId>
-        <version>${springVersion}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.springframework</groupId>
-        <artifactId>spring-beans</artifactId>
-        <version>${springVersion}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.springframework</groupId>
-        <artifactId>spring-context</artifactId>
+        <artifactId>spring-framework-bom</artifactId>
         <version>${springVersion}</version>
+	<scope>import</scope>
+	<type>pom</type>
       </dependency>
       <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-core</artifactId>
-        <version>${springVersion}</version>
+	<version>${springVersion}</version>
         <exclusions>
           <exclusion>
             <groupId>org.springframework</groupId>
@@ -758,31 +734,6 @@
           </exclusion>
         </exclusions>
       </dependency>
-      <dependency>
-        <groupId>org.springframework</groupId>
-        <artifactId>spring-expression</artifactId>
-        <version>${springVersion}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.springframework</groupId>
-        <artifactId>spring-oxm</artifactId>
-        <version>${springVersion}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.springframework</groupId>
-        <artifactId>spring-test</artifactId>
-        <version>${springVersion}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.springframework</groupId>
-        <artifactId>spring-web</artifactId>
-        <version>${springVersion}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.springframework</groupId>
-        <artifactId>spring-webmvc</artifactId>
-        <version>${springVersion}</version>
-      </dependency>
       <dependency>
         <groupId>io.fabric8</groupId>
         <artifactId>kubernetes-client</artifactId>