Repository: logging-log4j2 Updated Branches: refs/heads/master 1b1bccc42 -> 1ce2dec9b
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/1ce2dec9 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/1ce2dec9 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/1ce2dec9 Branch: refs/heads/master Commit: 1ce2dec9be99dbf6a4360a38bfeae86727b8ec3f Parents: 1b1bccc 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:09 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/1ce2dec9/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);
