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 2015/08/29 22:58:01 UTC
[3/3] logging-log4j2 git commit: Rename internal JUnit extension
class InitialLoggerContext to LoggerContextRule.
Rename internal JUnit extension class InitialLoggerContext to
LoggerContextRule.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/546f4d04
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/546f4d04
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/546f4d04
Branch: refs/heads/master
Commit: 546f4d0439c3cc14c6e78ad5b81c84790ee94da7
Parents: b4f73bc
Author: ggregory <gg...@apache.org>
Authored: Sat Aug 29 13:57:52 2015 -0700
Committer: ggregory <gg...@apache.org>
Committed: Sat Aug 29 13:57:52 2015 -0700
----------------------------------------------------------------------
.../org/apache/log4j/CallerInformationTest.java | 130 +++----
.../test/java/org/apache/log4j/LoggingTest.java | 86 ++---
.../apache/logging/log4j/PerformanceRun.java | 4 +-
.../log4j/core/AppenderRefLevelJsonTest.java | 4 +-
.../log4j/core/AppenderRefLevelTest.java | 4 +-
.../log4j/core/CollectionLoggingTest.java | 4 +-
.../log4j/core/CustomLevelsOverrideTest.java | 4 +-
.../logging/log4j/core/CustomLevelsTest.java | 4 +-
.../log4j/core/CustomLevelsWithFiltersTest.java | 4 +-
.../apache/logging/log4j/core/DeadlockTest.java | 4 +-
.../logging/log4j/core/ExtendedLevelTest.java | 4 +-
.../logging/log4j/core/FileConfigTest.java | 4 +-
.../apache/logging/log4j/core/HostNameTest.java | 4 +-
.../apache/logging/log4j/core/LevelTest.java | 4 +-
.../logging/log4j/core/LogEventFactoryTest.java | 4 +-
.../logging/log4j/core/LoggerDateTest.java | 4 +-
.../apache/logging/log4j/core/LoggerTest.java | 4 +-
.../logging/log4j/core/LoggerUpdateTest.java | 4 +-
.../apache/logging/log4j/core/LookupTest.java | 4 +-
.../log4j/core/ShutdownDisabledTest.java | 4 +-
.../logging/log4j/core/StrictXmlConfigTest.java | 4 +-
.../apache/logging/log4j/core/ThreadedTest.java | 4 +-
.../log4j/core/TimestampMessageTest.java | 4 +-
.../apache/logging/log4j/core/XmlEvents.java | 4 +-
.../appender/AsyncAppenderNoLocationTest.java | 4 +-
.../core/appender/FailoverAppenderTest.java | 4 +-
.../appender/JsonCompleteFileAppenderTest.java | 4 +-
.../appender/RandomAccessFileAppenderTests.java | 6 +-
.../core/appender/mom/JmsAppenderTest.java | 4 +-
.../appender/rewrite/RewriteAppenderTest.java | 4 +-
.../rolling/RollingAppenderSizeTest.java | 6 +-
.../rolling/RollingAppenderTimeAndSizeTest.java | 4 +-
.../rolling/RollingAppenderTimeTest.java | 4 +-
...RandomAccessFileManagerHeaderFooterTest.java | 4 +-
.../appender/routing/RoutingAppenderTest.java | 4 +-
.../routing/RoutingAppenderWithJndiTest.java | 4 +-
.../routing/RoutingDefaultAppenderTest.java | 4 +-
.../log4j/core/async/AsyncRootReloadTest.java | 4 +-
.../core/config/AbstractLog4j2_1100Test.java | 4 +-
.../log4j/core/config/ConfigurationTest.java | 6 +-
.../core/config/CustomConfigurationTest.java | 4 +-
.../log4j/core/config/FileOutputTest.java | 4 +-
.../core/config/MissingRootLoggerTest.java | 4 +-
.../config/ReconfigurationDeadlockTest.java | 4 +-
.../logging/log4j/core/config/XIncludeTest.java | 6 +-
.../core/config/xml/XmlLoggerPropsTest.java | 4 +-
.../log4j/core/filter/BurstFilterTest.java | 4 +-
.../log4j/core/lookup/ContextMapLookupTest.java | 4 +-
.../core/lookup/MarkerLookupConfigTest.java | 4 +-
.../log4j/core/net/SocketMessageLossTest.java | 4 +-
.../log4j/core/net/SocketReconnectTest.java | 4 +-
.../logging/log4j/core/net/SocketTest.java | 4 +-
.../core/pattern/CallerInformationTest.java | 4 +-
.../core/pattern/ExtendedThrowableTest.java | 4 +-
.../log4j/core/pattern/NoConsoleNoAnsiTest.java | 4 +-
.../core/pattern/RegexReplacementTest.java | 4 +-
.../log4j/core/pattern/RootThrowableTest.java | 4 +-
.../log4j/core/pattern/StyleConverterTest.java | 4 +-
.../log4j/core/pattern/ThrowableTest.java | 4 +-
.../core/util/ShutdownCallbackRegistryTest.java | 4 +-
.../log4j/junit/InitialLoggerContext.java | 144 --------
.../logging/log4j/junit/LoggerContextRule.java | 144 ++++++++
.../log4j/test/appender/ListAppender.java | 4 +-
.../logging/log4j/io/AbstractStreamTest.java | 118 +++---
.../log4j/io/IoBuilderCallerInfoTesting.java | 110 +++---
.../apache/logging/log4j/io/IoBuilderTest.java | 102 +++---
.../log4j/io/LoggerPrintWriterJdbcH2Test.java | 190 +++++-----
.../log4j/jcl/CallerInformationTest.java | 134 +++----
.../apache/logging/log4j/jcl/LoggerTest.java | 130 +++----
.../log4j/jul/CallerInformationTest.java | 156 ++++----
.../log4j/nosql/appender/MongoDbTest.java | 74 ++--
.../logging/slf4j/CallerInformationTest.java | 134 +++----
.../org/apache/logging/slf4j/LoggerTest.java | 364 +++++++++----------
.../org/apache/logging/slf4j/OptionalTest.java | 138 +++----
.../org/apache/logging/slf4j/SerializeTest.java | 94 ++---
75 files changed, 1246 insertions(+), 1246 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-1.2-api/src/test/java/org/apache/log4j/CallerInformationTest.java
----------------------------------------------------------------------
diff --git a/log4j-1.2-api/src/test/java/org/apache/log4j/CallerInformationTest.java b/log4j-1.2-api/src/test/java/org/apache/log4j/CallerInformationTest.java
index 013bd35..80cea0a 100644
--- a/log4j-1.2-api/src/test/java/org/apache/log4j/CallerInformationTest.java
+++ b/log4j-1.2-api/src/test/java/org/apache/log4j/CallerInformationTest.java
@@ -1,65 +1,65 @@
-/*
- * 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.log4j;
-
-import java.util.List;
-
-import org.apache.logging.log4j.junit.InitialLoggerContext;
-import org.apache.logging.log4j.test.appender.ListAppender;
-import org.junit.Rule;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-public class CallerInformationTest {
-
- // config from log4j-core test-jar
- private static final String CONFIG = "log4j2-calling-class.xml";
-
- @Rule
- public final InitialLoggerContext ctx = new InitialLoggerContext(CONFIG);
-
- @Test
- public void testClassLogger() throws Exception {
- final ListAppender app = ctx.getListAppender("Class").clear();
- final Logger logger = Logger.getLogger("ClassLogger");
- logger.info("Ignored message contents.");
- logger.warn("Verifying the caller class is still correct.");
- logger.error("Hopefully nobody breaks me!");
- final List<String> messages = app.getMessages();
- assertEquals("Incorrect number of messages.", 3, messages.size());
- for (final String message : messages) {
- assertEquals("Incorrect caller class name.", this.getClass().getName(), message);
- }
- }
-
- @Test
- public void testMethodLogger() throws Exception {
- final ListAppender app = ctx.getListAppender("Method").clear();
- final Logger logger = Logger.getLogger("MethodLogger");
- logger.info("More messages.");
- logger.warn("CATASTROPHE INCOMING!");
- logger.error("ZOMBIES!!!");
- logger.warn("brains~~~");
- logger.info("Itchy. Tasty.");
- final List<String> messages = app.getMessages();
- assertEquals("Incorrect number of messages.", 5, messages.size());
- for (final String message : messages) {
- assertEquals("Incorrect caller method name.", "testMethodLogger", message);
- }
- }
-}
+/*
+ * 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.log4j;
+
+import java.util.List;
+
+import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.test.appender.ListAppender;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class CallerInformationTest {
+
+ // config from log4j-core test-jar
+ private static final String CONFIG = "log4j2-calling-class.xml";
+
+ @Rule
+ public final LoggerContextRule ctx = new LoggerContextRule(CONFIG);
+
+ @Test
+ public void testClassLogger() throws Exception {
+ final ListAppender app = ctx.getListAppender("Class").clear();
+ final Logger logger = Logger.getLogger("ClassLogger");
+ logger.info("Ignored message contents.");
+ logger.warn("Verifying the caller class is still correct.");
+ logger.error("Hopefully nobody breaks me!");
+ final List<String> messages = app.getMessages();
+ assertEquals("Incorrect number of messages.", 3, messages.size());
+ for (final String message : messages) {
+ assertEquals("Incorrect caller class name.", this.getClass().getName(), message);
+ }
+ }
+
+ @Test
+ public void testMethodLogger() throws Exception {
+ final ListAppender app = ctx.getListAppender("Method").clear();
+ final Logger logger = Logger.getLogger("MethodLogger");
+ logger.info("More messages.");
+ logger.warn("CATASTROPHE INCOMING!");
+ logger.error("ZOMBIES!!!");
+ logger.warn("brains~~~");
+ logger.info("Itchy. Tasty.");
+ final List<String> messages = app.getMessages();
+ assertEquals("Incorrect number of messages.", 5, messages.size());
+ for (final String message : messages) {
+ assertEquals("Incorrect caller method name.", "testMethodLogger", message);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-1.2-api/src/test/java/org/apache/log4j/LoggingTest.java
----------------------------------------------------------------------
diff --git a/log4j-1.2-api/src/test/java/org/apache/log4j/LoggingTest.java b/log4j-1.2-api/src/test/java/org/apache/log4j/LoggingTest.java
index d10000d..a30dd88 100644
--- a/log4j-1.2-api/src/test/java/org/apache/log4j/LoggingTest.java
+++ b/log4j-1.2-api/src/test/java/org/apache/log4j/LoggingTest.java
@@ -1,43 +1,43 @@
-/*
- * 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.log4j;
-
-import org.apache.logging.log4j.junit.InitialLoggerContext;
-import org.junit.ClassRule;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- *
- */
-public class LoggingTest {
-
- private static final String CONFIG = "log4j2-config.xml";
-
- @ClassRule
- public static final InitialLoggerContext CTX = new InitialLoggerContext(CONFIG);
-
- @Test
- public void testParent() {
- final Logger logger = Logger.getLogger("org.apache.test.logging.Test");
- final Category parent = logger.getParent();
- assertNotNull("No parent Logger", parent);
- assertEquals("Incorrect parent logger", "org.apache.test.logging", parent.getName());
- }
-
-}
+/*
+ * 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.log4j;
+
+import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.junit.ClassRule;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ *
+ */
+public class LoggingTest {
+
+ private static final String CONFIG = "log4j2-config.xml";
+
+ @ClassRule
+ public static final LoggerContextRule CTX = new LoggerContextRule(CONFIG);
+
+ @Test
+ public void testParent() {
+ final Logger logger = Logger.getLogger("org.apache.test.logging.Test");
+ final Category parent = logger.getParent();
+ assertNotNull("No parent Logger", parent);
+ assertEquals("Incorrect parent logger", "org.apache.test.logging", parent.getName());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/PerformanceRun.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/PerformanceRun.java b/log4j-core/src/test/java/org/apache/logging/log4j/PerformanceRun.java
index 76e191e..64f0e35 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/PerformanceRun.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/PerformanceRun.java
@@ -25,7 +25,7 @@ import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import org.apache.logging.log4j.categories.PerformanceTests;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Test;
@@ -43,7 +43,7 @@ public class PerformanceRun {
private static final String CONFIG = "log4j2-perf.xml";
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
private final Logger logger = context.getLogger(PerformanceRun.class.getName());
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelJsonTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelJsonTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelJsonTest.java
index 119b179..a6c7697 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelJsonTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelJsonTest.java
@@ -18,7 +18,7 @@ package org.apache.logging.log4j.core;
import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.MarkerManager;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.Before;
import org.junit.ClassRule;
@@ -37,7 +37,7 @@ public class AppenderRefLevelJsonTest {
private ListAppender app2;
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
org.apache.logging.log4j.Logger logger1 = context.getLogger("org.apache.logging.log4j.test1");
org.apache.logging.log4j.Logger logger2 = context.getLogger("org.apache.logging.log4j.test2");
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java
index e2f7596..d59c1a0 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java
@@ -20,7 +20,7 @@ import java.util.List;
import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.MarkerManager;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.Before;
import org.junit.ClassRule;
@@ -38,7 +38,7 @@ public class AppenderRefLevelTest {
private ListAppender app2;
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
org.apache.logging.log4j.Logger logger1 = context.getLogger("org.apache.logging.log4j.test1");
org.apache.logging.log4j.Logger logger2 = context.getLogger("org.apache.logging.log4j.test2");
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java
index d286b9c..505bf3f 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java
@@ -23,7 +23,7 @@ import java.util.HashMap;
import java.util.Map;
import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.message.MapMessage;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.Before;
@@ -39,7 +39,7 @@ public class CollectionLoggingTest {
private ListAppender app;
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
@Before
public void before() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsOverrideTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsOverrideTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsOverrideTest.java
index bca0482..628d73f 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsOverrideTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsOverrideTest.java
@@ -25,7 +25,7 @@ import static org.junit.Assert.assertThat;
import java.util.List;
import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.Before;
import org.junit.ClassRule;
@@ -39,7 +39,7 @@ public class CustomLevelsOverrideTest {
private static final String CONFIG = "log4j-customLevels.xml";
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
private ListAppender listAppender;
private Level warnLevel;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsTest.java
index 4c61167..7bb7297 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsTest.java
@@ -24,7 +24,7 @@ import static org.junit.Assert.assertThat;
import java.util.List;
import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.Before;
import org.junit.ClassRule;
@@ -38,7 +38,7 @@ public class CustomLevelsTest {
private static final String CONFIG = "log4j-customLevels.xml";
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
private ListAppender listAppender;
private Level diagLevel;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsWithFiltersTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsWithFiltersTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsWithFiltersTest.java
index d7f62ba..bdb2522 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsWithFiltersTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsWithFiltersTest.java
@@ -26,7 +26,7 @@ import org.apache.logging.log4j.core.appender.FileAppender;
import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.filter.CompositeFilter;
import org.apache.logging.log4j.core.filter.ThresholdFilter;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.Assert;
import org.junit.Before;
import org.junit.ClassRule;
@@ -40,7 +40,7 @@ public class CustomLevelsWithFiltersTest {
private static final String CONFIG = "log4j-customLevelsWithFilters.xml";
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
private Level infom1Level;
private Level infop1Level;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/DeadlockTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/DeadlockTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/DeadlockTest.java
index 5e7023d..4deda12 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/DeadlockTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/DeadlockTest.java
@@ -16,7 +16,7 @@
*/
package org.apache.logging.log4j.core;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.ClassRule;
import org.junit.Test;
@@ -27,7 +27,7 @@ public class DeadlockTest {
private static final String CONFIG = "log4j-deadlock.xml";
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
@Test
public void deadlockOnReconfigure() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/ExtendedLevelTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/ExtendedLevelTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/ExtendedLevelTest.java
index 4eaba80..8126197 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/ExtendedLevelTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/ExtendedLevelTest.java
@@ -19,7 +19,7 @@ package org.apache.logging.log4j.core;
import java.util.List;
import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.ExtendedLevels;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.Before;
@@ -39,7 +39,7 @@ public class ExtendedLevelTest {
private ListAppender list2;
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
@Before
public void before() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/FileConfigTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/FileConfigTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/FileConfigTest.java
index 33a0ba6..1b9face 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/FileConfigTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/FileConfigTest.java
@@ -23,7 +23,7 @@ import java.io.File;
import java.util.concurrent.TimeUnit;
import org.apache.logging.log4j.core.config.Configuration;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
@@ -36,7 +36,7 @@ public class FileConfigTest {
private static final String CONFIG = "target/test-classes/log4j-test2.xml";
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
private final org.apache.logging.log4j.Logger logger = context.getLogger("LoggerTest");
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/HostNameTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/HostNameTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/HostNameTest.java
index e303da6..ca7b99e 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/HostNameTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/HostNameTest.java
@@ -21,7 +21,7 @@ import java.util.List;
import org.apache.logging.log4j.core.appender.RollingFileAppender;
import org.apache.logging.log4j.core.util.Constants;
import org.apache.logging.log4j.core.util.NetUtils;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.Before;
import org.junit.ClassRule;
@@ -41,7 +41,7 @@ public class HostNameTest {
private RollingFileAppender hostFile;
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
@Before
public void before() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/LevelTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LevelTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LevelTest.java
index ee0730c..a21c90c 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LevelTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/LevelTest.java
@@ -22,7 +22,7 @@ import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.MarkerManager;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.message.Message;
import org.apache.logging.log4j.message.ObjectMessage;
import org.apache.logging.log4j.test.appender.ListAppender;
@@ -48,7 +48,7 @@ public class LevelTest {
private ListAppender listFatal;
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
@Before
public void before() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/LogEventFactoryTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LogEventFactoryTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LogEventFactoryTest.java
index c2898c4..d2e971c 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LogEventFactoryTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/LogEventFactoryTest.java
@@ -31,7 +31,7 @@ import org.apache.logging.log4j.core.impl.DefaultLogEventFactory;
import org.apache.logging.log4j.core.impl.Log4jLogEvent;
import org.apache.logging.log4j.core.impl.LogEventFactory;
import org.apache.logging.log4j.core.util.Constants;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.message.Message;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.Before;
@@ -48,7 +48,7 @@ import org.junit.runners.model.Statement;
public class LogEventFactoryTest {
private static final String CONFIG = "log4j2-config.xml";
- private static final InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ private static final LoggerContextRule context = new LoggerContextRule(CONFIG);
private ListAppender app;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerDateTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerDateTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerDateTest.java
index a3912f7..78a2320 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerDateTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerDateTest.java
@@ -19,7 +19,7 @@ package org.apache.logging.log4j.core;
import java.util.Calendar;
import org.apache.logging.log4j.core.appender.FileAppender;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
@@ -35,7 +35,7 @@ public class LoggerDateTest {
private FileAppender fileApp;
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
@Before
public void before() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java
index 89f0b48..bd60eba 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java
@@ -36,7 +36,7 @@ import org.apache.logging.log4j.ThreadContext;
import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.Configurator;
import org.apache.logging.log4j.core.config.LoggerConfig;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.message.MessageFactory;
import org.apache.logging.log4j.message.ParameterizedMessageFactory;
import org.apache.logging.log4j.message.StringFormatterMessageFactory;
@@ -57,7 +57,7 @@ public class LoggerTest {
private ListAppender noThrown;
@Rule
- public InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public LoggerContextRule context = new LoggerContextRule(CONFIG);
private void assertEventCount(final List<LogEvent> events, final int expected) {
assertEquals("Incorrect number of events.", expected, events.size());
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerUpdateTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerUpdateTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerUpdateTest.java
index e6ff19c..fd9b0b0 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerUpdateTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerUpdateTest.java
@@ -21,7 +21,7 @@ import java.util.List;
import org.apache.logging.log4j.*;
import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.LoggerConfig;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.Before;
import org.junit.ClassRule;
@@ -38,7 +38,7 @@ public class LoggerUpdateTest {
private ListAppender app;
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
@Before
public void before() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/LookupTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LookupTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LookupTest.java
index 35f1794..04c837a 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LookupTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/LookupTest.java
@@ -18,7 +18,7 @@ package org.apache.logging.log4j.core;
import org.apache.logging.log4j.core.appender.ConsoleAppender;
import org.apache.logging.log4j.core.layout.PatternLayout;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.ClassRule;
import org.junit.Test;
@@ -32,7 +32,7 @@ public class LookupTest {
private static final String CONFIG = "log4j-lookup.xml";
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
@Test
public void testHostname() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/ShutdownDisabledTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/ShutdownDisabledTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/ShutdownDisabledTest.java
index f782671..5fcecd4 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/ShutdownDisabledTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/ShutdownDisabledTest.java
@@ -17,7 +17,7 @@
package org.apache.logging.log4j.core;
import org.apache.logging.log4j.core.config.Configuration;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.ClassRule;
import org.junit.Test;
@@ -31,7 +31,7 @@ public class ShutdownDisabledTest {
private static final String CONFIG = "log4j-test3.xml";
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
@Test
public void testShutdownFlag() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/StrictXmlConfigTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/StrictXmlConfigTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/StrictXmlConfigTest.java
index 39e6a78..edc428e 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/StrictXmlConfigTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/StrictXmlConfigTest.java
@@ -22,7 +22,7 @@ import java.util.Locale;
import org.apache.logging.log4j.MarkerManager;
import org.apache.logging.log4j.ThreadContext;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.message.StructuredDataMessage;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.Before;
@@ -40,7 +40,7 @@ public class StrictXmlConfigTest {
private ListAppender app;
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
@Before
public void setUp() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/ThreadedTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/ThreadedTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/ThreadedTest.java
index 4e0adf8..3df298a 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/ThreadedTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/ThreadedTest.java
@@ -24,7 +24,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.categories.PerformanceTests;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
@@ -43,7 +43,7 @@ public class ThreadedTest {
private static final int LOOP_CNT = 25;
private static final int THREADS = 4;
private static final AtomicInteger counter = new AtomicInteger(0);
- private static final InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ private static final LoggerContextRule context = new LoggerContextRule(CONFIG);
private final Logger logger = context.getLogger(ThreadedTest.class.getName());
private volatile Level lvl = Level.DEBUG;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/TimestampMessageTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/TimestampMessageTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/TimestampMessageTest.java
index b295bc9..5805edb 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/TimestampMessageTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/TimestampMessageTest.java
@@ -26,7 +26,7 @@ import org.apache.logging.log4j.core.util.Clock;
import org.apache.logging.log4j.core.util.ClockFactory;
import org.apache.logging.log4j.core.util.ClockFactoryTest;
import org.apache.logging.log4j.core.util.Constants;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.message.SimpleMessage;
import org.apache.logging.log4j.message.TimestampMessage;
import org.apache.logging.log4j.test.appender.ListAppender;
@@ -47,7 +47,7 @@ public class TimestampMessageTest {
private ListAppender app;
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext("log4j2-744.xml");
+ public static LoggerContextRule context = new LoggerContextRule("log4j2-744.xml");
@BeforeClass
public static void beforeClass() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/XmlEvents.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/XmlEvents.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/XmlEvents.java
index a228734..e583b89 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/XmlEvents.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/XmlEvents.java
@@ -20,7 +20,7 @@ import java.util.Locale;
import org.apache.logging.log4j.EventLogger;
import org.apache.logging.log4j.ThreadContext;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.message.StructuredDataMessage;
import org.junit.ClassRule;
import org.junit.Test;
@@ -33,7 +33,7 @@ public class XmlEvents {
private static final String CONFIG = "xml-events.xml";
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
@Test
public void testEvents() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderNoLocationTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderNoLocationTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderNoLocationTest.java
index cbed499..32fd93d 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderNoLocationTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderNoLocationTest.java
@@ -20,7 +20,7 @@ import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.After;
import org.junit.Before;
@@ -36,7 +36,7 @@ public class AsyncAppenderNoLocationTest {
private ListAppender app;
@Rule
- public InitialLoggerContext init = new InitialLoggerContext("log4j-asynch-no-location.xml");
+ public LoggerContextRule init = new LoggerContextRule("log4j-asynch-no-location.xml");
@Before
public void setUp() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FailoverAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FailoverAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FailoverAppenderTest.java
index 6afab44..2cbc2df 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FailoverAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FailoverAppenderTest.java
@@ -20,7 +20,7 @@ import java.util.List;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.LogEvent;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.FailOnceAppender;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.After;
@@ -40,7 +40,7 @@ public class FailoverAppenderTest {
private Logger onceLogger;
@Rule
- public InitialLoggerContext init = new InitialLoggerContext("log4j-failover.xml");
+ public LoggerContextRule init = new LoggerContextRule("log4j-failover.xml");
@Before
public void setUp() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/JsonCompleteFileAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/JsonCompleteFileAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/JsonCompleteFileAppenderTest.java
index 424336b..5d9b6a1 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/JsonCompleteFileAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/JsonCompleteFileAppenderTest.java
@@ -22,7 +22,7 @@ import java.io.FileReader;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.junit.CleanFiles;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.RuleChain;
@@ -36,7 +36,7 @@ public class JsonCompleteFileAppenderTest {
private final File logFile = new File("target", "JsonCompleteFileAppenderTest.log");
- private final InitialLoggerContext init = new InitialLoggerContext("JsonCompleteFileAppenderTest.xml");
+ private final LoggerContextRule init = new LoggerContextRule("JsonCompleteFileAppenderTest.xml");
private final CleanFiles files = new CleanFiles(logFile);
@Rule
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/RandomAccessFileAppenderTests.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/RandomAccessFileAppenderTests.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/RandomAccessFileAppenderTests.java
index 42276a3..8068d59 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/RandomAccessFileAppenderTests.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/RandomAccessFileAppenderTests.java
@@ -24,7 +24,7 @@ import java.util.Collection;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.junit.CleanFiles;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.hamcrest.Matcher;
import org.junit.Rule;
import org.junit.Test;
@@ -54,7 +54,7 @@ public class RandomAccessFileAppenderTests {
);
}
- private final InitialLoggerContext init;
+ private final LoggerContextRule init;
private final CleanFiles files;
@Rule
@@ -64,7 +64,7 @@ public class RandomAccessFileAppenderTests {
private final boolean locationEnabled;
public RandomAccessFileAppenderTests(final String testName, final boolean locationEnabled) {
- this.init = new InitialLoggerContext(testName + ".xml");
+ this.init = new LoggerContextRule(testName + ".xml");
this.logFile = new File("target", testName + ".log");
this.files = new CleanFiles(this.logFile);
this.locationEnabled = locationEnabled;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/JmsAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/JmsAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/JmsAppenderTest.java
index 06cf24c..9d1c65a 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/JmsAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/mom/JmsAppenderTest.java
@@ -27,7 +27,7 @@ import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.impl.Log4jLogEvent;
import org.apache.logging.log4j.core.util.JndiCloser;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.message.SimpleMessage;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -77,7 +77,7 @@ public class JmsAppenderTest {
}
@Rule
- public InitialLoggerContext ctx = new InitialLoggerContext("JmsAppenderTest.xml");
+ public LoggerContextRule ctx = new LoggerContextRule("JmsAppenderTest.xml");
@Test
public void testAppendToQueue() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppenderTest.java
index d0b832c..518ca87 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppenderTest.java
@@ -23,7 +23,7 @@ import org.apache.logging.log4j.EventLogger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.LogEvent;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.message.MapMessage;
import org.apache.logging.log4j.message.Message;
import org.apache.logging.log4j.message.StructuredDataMessage;
@@ -43,7 +43,7 @@ public class RewriteAppenderTest {
private ListAppender app2;
@Rule
- public InitialLoggerContext init = new InitialLoggerContext("log4j-rewrite.xml");
+ public LoggerContextRule init = new LoggerContextRule("log4j-rewrite.xml");
@Before
public void setUp() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
index 8181b2c..18e7901 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
@@ -21,7 +21,7 @@ import java.util.Arrays;
import java.util.Collection;
import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
@@ -63,11 +63,11 @@ public class RollingAppenderSizeTest {
}
@Rule
- public InitialLoggerContext init;
+ public LoggerContextRule init;
public RollingAppenderSizeTest(final String configFile, final String fileExtension) {
this.fileExtension = fileExtension;
- this.init = new InitialLoggerContext(configFile);
+ this.init = new LoggerContextRule(configFile);
}
@Before
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java
index 456acb0..efa11d5 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeAndSizeTest.java
@@ -19,7 +19,7 @@ package org.apache.logging.log4j.core.appender.rolling;
import java.io.File;
import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
@@ -39,7 +39,7 @@ public class RollingAppenderTimeAndSizeTest {
private static final String DIR = "target/rolling3/test";
@Rule
- public InitialLoggerContext init = new InitialLoggerContext("log4j-rolling3.xml");
+ public LoggerContextRule init = new LoggerContextRule("log4j-rolling3.xml");
private Logger logger;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java
index af951bd..52fe575 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderTimeTest.java
@@ -19,7 +19,7 @@ package org.apache.logging.log4j.core.appender.rolling;
import java.io.File;
import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.hamcrest.Matcher;
import org.junit.Rule;
import org.junit.Test;
@@ -40,7 +40,7 @@ public class RollingAppenderTimeTest {
private static final String CONFIG = "log4j-rolling2.xml";
private static final String DIR = "target/rolling2";
- private final InitialLoggerContext ctx = new InitialLoggerContext(CONFIG);
+ private final LoggerContextRule ctx = new LoggerContextRule(CONFIG);
@Rule
public RuleChain chain = RuleChain.outerRule(new ExternalResource() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerHeaderFooterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerHeaderFooterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerHeaderFooterTest.java
index 3fdac7a..f789e4a 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerHeaderFooterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerHeaderFooterTest.java
@@ -23,7 +23,7 @@ import java.nio.charset.Charset;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.layout.HtmlLayout;
import org.apache.logging.log4j.core.util.Closer;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
@@ -40,7 +40,7 @@ public class RollingRandomAccessFileManagerHeaderFooterTest {
private static final String LOGFILE = "target/RollingRandomAccessFileAppenderHeaderFooterTest.log";
@Rule
- public InitialLoggerContext init = new InitialLoggerContext("RollingRandomAccessFileAppenderHeaderFooterTest.xml");
+ public LoggerContextRule init = new LoggerContextRule("RollingRandomAccessFileAppenderHeaderFooterTest.xml");
private Logger logger;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderTest.java
index 2fadbd6..6f1613a 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderTest.java
@@ -22,7 +22,7 @@ import java.util.List;
import org.apache.logging.log4j.EventLogger;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.junit.CleanFiles;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.message.StructuredDataMessage;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.After;
@@ -44,7 +44,7 @@ public class RoutingAppenderTest {
private ListAppender app;
@Rule
- public InitialLoggerContext init = new InitialLoggerContext(CONFIG);
+ public LoggerContextRule init = new LoggerContextRule(CONFIG);
@Rule
public CleanFiles files = new CleanFiles(UNKNOWN_LOG_FILE, ALERT_LOG_FILE, ACTIVITY_LOG_FILE);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderWithJndiTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderWithJndiTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderWithJndiTest.java
index a4d5aca..240041b 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderWithJndiTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingAppenderWithJndiTest.java
@@ -23,7 +23,7 @@ import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.apache.logging.log4j.EventLogger;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.message.StructuredDataMessage;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.After;
@@ -44,7 +44,7 @@ public class RoutingAppenderWithJndiTest {
private ListAppender listAppender2;
@Rule
- public InitialLoggerContext init = new InitialLoggerContext("log4j-routing-by-jndi.xml");
+ public LoggerContextRule init = new LoggerContextRule("log4j-routing-by-jndi.xml");
@Before
public void before() throws NamingException {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingDefaultAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingDefaultAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingDefaultAppenderTest.java
index 289ac44..948f8a9 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingDefaultAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/routing/RoutingDefaultAppenderTest.java
@@ -22,7 +22,7 @@ import java.util.List;
import org.apache.logging.log4j.EventLogger;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.junit.CleanFiles;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.message.StructuredDataMessage;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.After;
@@ -41,7 +41,7 @@ public class RoutingDefaultAppenderTest {
private ListAppender app;
@Rule
- public InitialLoggerContext init = new InitialLoggerContext("log4j-routing3.xml");
+ public LoggerContextRule init = new LoggerContextRule("log4j-routing3.xml");
@Rule
public CleanFiles files = new CleanFiles(LOG_FILE);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncRootReloadTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncRootReloadTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncRootReloadTest.java
index 03fb423..54e517a 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncRootReloadTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncRootReloadTest.java
@@ -24,7 +24,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.util.FileUtils;
import org.apache.logging.log4j.junit.CleanFiles;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.RuleChain;
@@ -40,7 +40,7 @@ public class AsyncRootReloadTest {
private static final String RESOURCE = "classpath:" + ISSUE_CONFIG;
@Rule
- public RuleChain rules = RuleChain.outerRule(new CleanFiles(LOG)).around(new InitialLoggerContext(RESOURCE));
+ public RuleChain rules = RuleChain.outerRule(new CleanFiles(LOG)).around(new LoggerContextRule(RESOURCE));
@Test
public void testLog4j2_807() throws InterruptedException, URISyntaxException {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/config/AbstractLog4j2_1100Test.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/AbstractLog4j2_1100Test.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/AbstractLog4j2_1100Test.java
index 89b0904..43d91cc 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/AbstractLog4j2_1100Test.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/AbstractLog4j2_1100Test.java
@@ -26,14 +26,14 @@ import org.apache.logging.log4j.core.appender.rolling.CompositeTriggeringPolicy;
import org.apache.logging.log4j.core.appender.rolling.SizeBasedTriggeringPolicy;
import org.apache.logging.log4j.core.appender.rolling.TimeBasedTriggeringPolicy;
import org.apache.logging.log4j.core.appender.rolling.TriggeringPolicy;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.Rule;
import org.junit.Test;
public abstract class AbstractLog4j2_1100Test {
@Rule
- public InitialLoggerContext context = new InitialLoggerContext(getConfigurationResource());
+ public LoggerContextRule context = new LoggerContextRule(getConfigurationResource());
protected abstract String getConfigurationResource();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java
index 50ceb6a..45f5c55 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ConfigurationTest.java
@@ -32,7 +32,7 @@ import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.filter.ThreadContextMapFilter;
import org.apache.logging.log4j.junit.CleanFiles;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.util.Strings;
import org.junit.Before;
import org.junit.Rule;
@@ -63,7 +63,7 @@ public class ConfigurationTest {
@Rule
public TestRule rules;
- private final InitialLoggerContext init;
+ private final LoggerContextRule init;
private LoggerContext ctx;
@@ -71,7 +71,7 @@ public class ConfigurationTest {
public ConfigurationTest(final String configFileName, final String logFileName) {
this.logFileName = logFileName;
- this.init = new InitialLoggerContext(configFileName);
+ this.init = new LoggerContextRule(configFileName);
rules = RuleChain.outerRule(new CleanFiles(logFileName)).around(this.init);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/config/CustomConfigurationTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/CustomConfigurationTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/CustomConfigurationTest.java
index 72c81a4..136686c 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/CustomConfigurationTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/CustomConfigurationTest.java
@@ -27,7 +27,7 @@ import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.appender.FileAppender;
import org.apache.logging.log4j.core.config.xml.XmlConfiguration;
import org.apache.logging.log4j.core.layout.PatternLayout;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.status.StatusConsoleListener;
import org.apache.logging.log4j.status.StatusListener;
import org.apache.logging.log4j.status.StatusLogger;
@@ -56,7 +56,7 @@ public class CustomConfigurationTest {
}
@Rule
- public InitialLoggerContext init = new InitialLoggerContext("log4j-props.xml");
+ public LoggerContextRule init = new LoggerContextRule("log4j-props.xml");
@Before
public void setUp() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/config/FileOutputTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/FileOutputTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/FileOutputTest.java
index 86efebd..4666978 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/FileOutputTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/FileOutputTest.java
@@ -19,7 +19,7 @@ package org.apache.logging.log4j.core.config;
import java.io.File;
import org.apache.logging.log4j.junit.CleanFiles;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.RuleChain;
@@ -38,7 +38,7 @@ public class FileOutputTest {
private static final String STATUS_LOG = "target/status.log";
@Rule
- public RuleChain rules = RuleChain.outerRule(new CleanFiles(STATUS_LOG)).around(new InitialLoggerContext(CONFIG));
+ public RuleChain rules = RuleChain.outerRule(new CleanFiles(STATUS_LOG)).around(new LoggerContextRule(CONFIG));
@Test
public void testConfig() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/config/MissingRootLoggerTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/MissingRootLoggerTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/MissingRootLoggerTest.java
index 10fdacf..964f7fd 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/MissingRootLoggerTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/MissingRootLoggerTest.java
@@ -22,7 +22,7 @@ import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.LoggerContext;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -38,7 +38,7 @@ import static org.junit.Assert.*;
public class MissingRootLoggerTest {
@Rule
- public InitialLoggerContext context = new InitialLoggerContext("missingRootLogger.xml");
+ public LoggerContextRule context = new LoggerContextRule("missingRootLogger.xml");
@Test
public void testMissingRootLogger() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ReconfigurationDeadlockTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ReconfigurationDeadlockTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ReconfigurationDeadlockTest.java
index dd0f439..87c62d2 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ReconfigurationDeadlockTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/ReconfigurationDeadlockTest.java
@@ -20,7 +20,7 @@ import java.io.File;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.message.ThreadDumpMessage;
import org.junit.Rule;
import org.junit.Test;
@@ -33,7 +33,7 @@ import static org.junit.Assert.*;
public class ReconfigurationDeadlockTest {
@Rule
- public InitialLoggerContext init = new InitialLoggerContext("reconfiguration-deadlock.xml");
+ public LoggerContextRule init = new LoggerContextRule("reconfiguration-deadlock.xml");
private static final int THREAD_COUNT = 5;
private static final boolean[] finished = new boolean[THREAD_COUNT];
private static LoggerThread[] threads = new LoggerThread[THREAD_COUNT];
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/config/XIncludeTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/XIncludeTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/XIncludeTest.java
index 398f538..566081b 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/XIncludeTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/XIncludeTest.java
@@ -32,7 +32,7 @@ import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.filter.ThreadContextMapFilter;
import org.apache.logging.log4j.junit.CleanFiles;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.util.Strings;
import org.junit.Before;
import org.junit.Rule;
@@ -66,7 +66,7 @@ public class XIncludeTest {
@Rule
public TestRule rules;
- private final InitialLoggerContext init;
+ private final LoggerContextRule init;
private LoggerContext ctx;
@@ -74,7 +74,7 @@ public class XIncludeTest {
public XIncludeTest(final String configFileName, final String logFileName) {
this.logFileName = logFileName;
- this.init = new InitialLoggerContext(configFileName);
+ this.init = new LoggerContextRule(configFileName);
this.rules = RuleChain.outerRule(new CleanFiles(logFileName)).around(this.init);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/config/xml/XmlLoggerPropsTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/xml/XmlLoggerPropsTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/xml/XmlLoggerPropsTest.java
index 37b2c25..094defa 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/xml/XmlLoggerPropsTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/xml/XmlLoggerPropsTest.java
@@ -20,7 +20,7 @@ import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.BeforeClass;
import org.junit.Rule;
@@ -40,7 +40,7 @@ public class XmlLoggerPropsTest {
private static final String CONFIG = "log4j-loggerprops.xml";
@Rule
- public final InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public final LoggerContextRule context = new LoggerContextRule(CONFIG);
@BeforeClass
public static void setupClass() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/BurstFilterTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/BurstFilterTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/BurstFilterTest.java
index 48b5566..6ec1eb2 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/BurstFilterTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/filter/BurstFilterTest.java
@@ -20,7 +20,7 @@ package org.apache.logging.log4j.core.filter;
import java.util.List;
import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.Before;
import org.junit.ClassRule;
@@ -35,7 +35,7 @@ public class BurstFilterTest {
private static final String CONFIG = "log4j-burst.xml";
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
@Before
public void setUp() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/ContextMapLookupTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/ContextMapLookupTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/ContextMapLookupTest.java
index 86d9b39..b80491e 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/ContextMapLookupTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/ContextMapLookupTest.java
@@ -21,7 +21,7 @@ import java.io.File;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.ThreadContext;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.RuleChain;
@@ -39,7 +39,7 @@ public class ContextMapLookupTest {
private static final String TESTKEY = "TestKey";
private static final String TESTVAL = "TestValue";
- private final InitialLoggerContext context = new InitialLoggerContext("ContextMapLookupTest.xml");
+ private final LoggerContextRule context = new LoggerContextRule("ContextMapLookupTest.xml");
@Rule
public RuleChain chain = RuleChain.outerRule(new TestRule() {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MarkerLookupConfigTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MarkerLookupConfigTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MarkerLookupConfigTest.java
index 80ffdb4..62f8897 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MarkerLookupConfigTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/MarkerLookupConfigTest.java
@@ -24,7 +24,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.MarkerManager;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.Assert;
import org.junit.ClassRule;
import org.junit.Test;
@@ -37,7 +37,7 @@ import org.junit.Test;
public class MarkerLookupConfigTest {
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext("log4j-marker-lookup.yaml");
+ public static LoggerContextRule context = new LoggerContextRule("log4j-marker-lookup.yaml");
public static final Marker PAYLOAD = MarkerManager.getMarker("PAYLOAD");
private static final String PAYLOAD_LOG = "Message in payload.log";
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/net/SocketMessageLossTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/SocketMessageLossTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/SocketMessageLossTest.java
index 472cdcd..70ab122 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/SocketMessageLossTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/SocketMessageLossTest.java
@@ -29,7 +29,7 @@ import java.util.concurrent.Future;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.appender.AppenderLoggingException;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.AvailablePortFinder;
import org.junit.ClassRule;
import org.junit.Ignore;
@@ -44,7 +44,7 @@ public class SocketMessageLossTest {
private static final String CONFIG = "log4j-socket2.xml";
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
@Test
public void testSocket() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/net/SocketReconnectTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/SocketReconnectTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/SocketReconnectTest.java
index fb0e545..e586f7b 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/SocketReconnectTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/SocketReconnectTest.java
@@ -26,7 +26,7 @@ import java.util.List;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.appender.AppenderLoggingException;
import org.apache.logging.log4j.core.util.Constants;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.AvailablePortFinder;
import org.junit.ClassRule;
import org.junit.Ignore;
@@ -47,7 +47,7 @@ public class SocketReconnectTest {
"................................................................" + Constants.LINE_SEPARATOR;
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
@Test
public void testReconnect() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/net/SocketTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/SocketTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/SocketTest.java
index 58bb56f..bcc207c 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/SocketTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/SocketTest.java
@@ -24,7 +24,7 @@ import java.util.concurrent.Callable;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.appender.AppenderLoggingException;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.AvailablePortFinder;
import org.junit.ClassRule;
import org.junit.Ignore;
@@ -39,7 +39,7 @@ public class SocketTest {
private static final String CONFIG = "log4j-socket.xml";
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext(CONFIG);
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
@Test
public void testConnect() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/CallerInformationTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/CallerInformationTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/CallerInformationTest.java
index d8df42e..835ab4e 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/CallerInformationTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/CallerInformationTest.java
@@ -19,7 +19,7 @@ package org.apache.logging.log4j.core.pattern;
import java.util.List;
import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.ClassRule;
import org.junit.Test;
@@ -29,7 +29,7 @@ import static org.junit.Assert.*;
public class CallerInformationTest {
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext("log4j2-calling-class.xml");
+ public static LoggerContextRule context = new LoggerContextRule("log4j2-calling-class.xml");
@Test
public void testClassLogger() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/546f4d04/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/ExtendedThrowableTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/ExtendedThrowableTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/ExtendedThrowableTest.java
index 4e9da8a..affeae4 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/ExtendedThrowableTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/pattern/ExtendedThrowableTest.java
@@ -19,7 +19,7 @@ package org.apache.logging.log4j.core.pattern;
import java.util.List;
import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.junit.InitialLoggerContext;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.Before;
import org.junit.ClassRule;
@@ -34,7 +34,7 @@ public class ExtendedThrowableTest {
private ListAppender app;
@ClassRule
- public static InitialLoggerContext context = new InitialLoggerContext("log4j-throwablefilter.xml");
+ public static LoggerContextRule context = new LoggerContextRule("log4j-throwablefilter.xml");
@Before
public void setUp() throws Exception {