Repository: logging-log4j2 Updated Branches: refs/heads/release-2.x 2c6314394 -> 6a04c4c0d
Apply ThreadContextRule to Log4j1XmlLayoutTest NDC value is leaking into the test intermittently causing a comparison to fail. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/6a04c4c0 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/6a04c4c0 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/6a04c4c0 Branch: refs/heads/release-2.x Commit: 6a04c4c0decae394388e6b8e78023adccac87f65 Parents: 2c63143 Author: Carter Kozak <[email protected]> Authored: Tue Jun 12 12:08:10 2018 -0400 Committer: Carter Kozak <[email protected]> Committed: Tue Jun 12 12:54:28 2018 -0400 ---------------------------------------------------------------------- .../test/java/org/apache/log4j/layout/Log4j1XmlLayoutTest.java | 5 +++++ 1 file changed, 5 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6a04c4c0/log4j-1.2-api/src/test/java/org/apache/log4j/layout/Log4j1XmlLayoutTest.java ---------------------------------------------------------------------- diff --git a/log4j-1.2-api/src/test/java/org/apache/log4j/layout/Log4j1XmlLayoutTest.java b/log4j-1.2-api/src/test/java/org/apache/log4j/layout/Log4j1XmlLayoutTest.java index 395cf3b..28579fe 100644 --- a/log4j-1.2-api/src/test/java/org/apache/log4j/layout/Log4j1XmlLayoutTest.java +++ b/log4j-1.2-api/src/test/java/org/apache/log4j/layout/Log4j1XmlLayoutTest.java @@ -21,12 +21,17 @@ import static org.junit.Assert.assertEquals; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.core.impl.ContextDataFactory; import org.apache.logging.log4j.core.impl.Log4jLogEvent; +import org.apache.logging.log4j.junit.ThreadContextRule; import org.apache.logging.log4j.message.SimpleMessage; import org.apache.logging.log4j.util.StringMap; +import org.junit.Rule; import org.junit.Test; public class Log4j1XmlLayoutTest { + @Rule + public ThreadContextRule threadContextRule = new ThreadContextRule(); + @Test public void testWithoutThrown() { final Log4j1XmlLayout layout = Log4j1XmlLayout.createLayout(false, true);
