You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2022/01/15 23:30:48 UTC

[logging-log4j2] branch release-2.x updated (a6bbbcd -> 1a9c04f)

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

ggregory pushed a change to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git.


    from a6bbbcd  Javadoc typos, "posix" is an acronym -> POSIX.
     new 0b489f1  Add Interpolator#getDefaultLookup().
     new 1a9c04f  Add Interpolator#getDefaultLookup().

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:
 .../apache/logging/log4j/core/lookup/Interpolator.java    |  4 ++++
 .../logging/log4j/core/lookup/InterpolatorTest.java       | 15 ++++++++++++---
 2 files changed, 16 insertions(+), 3 deletions(-)

[logging-log4j2] 02/02: Add Interpolator#getDefaultLookup().

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

ggregory pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 1a9c04f18aeafa3297ed5c4498eb1279c13d53d9
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jan 15 18:30:43 2022 -0500

    Add Interpolator#getDefaultLookup().
    
    Split commit 3/2 for cherry-picking to master.
---
 .../logging/log4j/core/lookup/InterpolatorTest.java       | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/InterpolatorTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/InterpolatorTest.java
index af0067b..456a744 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/InterpolatorTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/InterpolatorTest.java
@@ -39,7 +39,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNull;
 
 /**
- *
+ * Tests {@link Interpolator}.
  */
 public class InterpolatorTest {
 
@@ -51,7 +51,7 @@ public class InterpolatorTest {
     private static final String TEST_CONTEXT_NAME = "app-1";
 
     @ClassRule
-    public static RuleChain rules = RuleChain.outerRule(new ExternalResource() {
+    public final static RuleChain RULES = RuleChain.outerRule(new ExternalResource() {
         @Override
         protected void before() throws Throwable {
             System.setProperty(TESTKEY, TESTVAL);
@@ -69,6 +69,16 @@ public class InterpolatorTest {
         JndiLookup.CONTAINER_JNDI_RESOURCE_PATH_PREFIX + TEST_CONTEXT_RESOURCE_NAME, TEST_CONTEXT_NAME));
 
     @Test
+    public void testGetDefaultLookup() {
+        final Map<String, String> map = new HashMap<>();
+        map.put(TESTKEY, TESTVAL);
+        final MapLookup defaultLookup = new MapLookup(map);
+        final Interpolator interpolator = new Interpolator(defaultLookup);
+        assertEquals(defaultLookup.getMap(), ((MapLookup) interpolator.getDefaultLookup()).getMap());
+        assertSame(defaultLookup, interpolator.getDefaultLookup());
+    }
+
+    @Test
     public void testLookup() {
         final Map<String, String> map = new HashMap<>();
         map.put(TESTKEY, TESTVAL);
@@ -120,7 +130,6 @@ public class InterpolatorTest {
         assertLookupNotEmpty(lookup, "java:hw");
     }
 
-
     @Test
     public void testInterpolatorMapMessageWithNoPrefix() {
         final HashMap<String, String> configProperties = new HashMap<>();

[logging-log4j2] 01/02: Add Interpolator#getDefaultLookup().

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

ggregory pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 0b489f1ea8cbda74dc3a8c1022fc99e38e120957
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jan 15 18:30:32 2022 -0500

    Add Interpolator#getDefaultLookup().
    
    Split commit 1/2 for cherry-picking to master.
---
 .../main/java/org/apache/logging/log4j/core/lookup/Interpolator.java  | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
index 531c7d1..145766c 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
@@ -159,6 +159,10 @@ public class Interpolator extends AbstractConfigurationAwareLookup {
         }
     }
 
+    public StrLookup getDefaultLookup() {
+        return defaultLookup;
+    }
+
     public Map<String, StrLookup> getStrLookupMap() {
         return strLookupMap;
     }