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:45:54 UTC

[logging-log4j2] 02/02: Add PropertiesLookup#getProperties().

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 645a06d3204ccbb56e6f6c6ce0c9356ba2ffce24
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jan 15 18:45:48 2022 -0500

    Add PropertiesLookup#getProperties().
    
    Commit 2/2 for cherry-picking to master.
---
 .../log4j/core/lookup/PropertiesLookupTest.java    | 37 ++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/PropertiesLookupTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/PropertiesLookupTest.java
new file mode 100644
index 0000000..2c708f0
--- /dev/null
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/PropertiesLookupTest.java
@@ -0,0 +1,37 @@
+/*
+ * 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.core.lookup;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.HashMap;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests {@link PropertiesLookup}.
+ */
+public class PropertiesLookupTest {
+
+    @Test
+    public void testGetProperties() {
+        final HashMap<String, String> properties = new HashMap<>();
+        properties.put("A", "1");
+        assertEquals(properties, new PropertiesLookup(properties).getProperties());
+    }
+}