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 2017/08/12 17:10:21 UTC
logging-log4j2 git commit: Refactor for customizable testing
extensions.
Repository: logging-log4j2
Updated Branches:
refs/heads/master e9db5a7f4 -> 070c696ac
Refactor for customizable testing extensions.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/070c696a
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/070c696a
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/070c696a
Branch: refs/heads/master
Commit: 070c696acf5eb95b392a010076d23a0d82117cda
Parents: e9db5a7
Author: Gary Gregory <ga...@gmail.com>
Authored: Sat Aug 12 11:10:17 2017 -0600
Committer: Gary Gregory <ga...@gmail.com>
Committed: Sat Aug 12 11:10:17 2017 -0600
----------------------------------------------------------------------
.../log4j/junit/LoggerContextAccessor.java | 28 ++++++++++++++++++++
.../logging/log4j/junit/LoggerContextRule.java | 3 ++-
2 files changed, 30 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/070c696a/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextAccessor.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextAccessor.java b/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextAccessor.java
new file mode 100644
index 0000000..af34788
--- /dev/null
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextAccessor.java
@@ -0,0 +1,28 @@
+/*
+ * 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.junit;
+
+import org.apache.logging.log4j.core.LoggerContext;
+
+/**
+ * Provides access to a Core Logger Context.
+ */
+public interface LoggerContextAccessor {
+
+ LoggerContext getLoggerContext();
+
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/070c696a/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextRule.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextRule.java b/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextRule.java
index 6e275af..b4ecb7c 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextRule.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextRule.java
@@ -42,7 +42,7 @@ import static org.junit.Assert.*;
* set to the debug level. This allows for more debug messages as the StatusLogger will be in the error level until a
* configuration file has been read and parsed into a tree of Nodes.
*/
-public class LoggerContextRule implements TestRule {
+public class LoggerContextRule implements TestRule, LoggerContextAccessor {
public static LoggerContextRule createShutdownTimeoutLoggerContextRule(final String config) {
return new LoggerContextRule(config, 10, TimeUnit.SECONDS);
@@ -177,6 +177,7 @@ public class LoggerContextRule implements TestRule {
*
* @return the current LoggerContext.
*/
+ @Override
public LoggerContext getLoggerContext() {
return loggerContext;
}