You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2016/09/11 06:28:09 UTC
[28/50] logging-log4j2 git commit: LOG4J2-1349 added test
LOG4J2-1349 added test
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/1dbe39e0
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/1dbe39e0
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/1dbe39e0
Branch: refs/heads/master
Commit: 1dbe39e0aa3dc0a29b8efc0f21c3cc82f85dd19c
Parents: f2818eb
Author: rpopma <rp...@apache.org>
Authored: Fri Sep 2 23:25:12 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Fri Sep 2 23:25:12 2016 +0900
----------------------------------------------------------------------
.../apache/logging/log4j/core/layout/PatternLayoutTest.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1dbe39e0/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java
index 185432e..aab5896 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java
@@ -75,7 +75,7 @@ public class PatternLayoutTest {
Logger root = ctx.getRootLogger();
@Rule
- public final ThreadContextRule threadContextRule = new ThreadContextRule();
+ public final ThreadContextRule threadContextRule = new ThreadContextRule();
private static class Destination implements ByteBufferDestination {
ByteBuffer byteBuffer = ByteBuffer.wrap(new byte[2048]);
@@ -203,6 +203,11 @@ public class PatternLayoutTest {
}
@Test
+ public void testMdcPattern0() throws Exception {
+ testMdcPattern("%m : %X", "Hello : {key1=value1, key2=value2}", true);
+ }
+
+ @Test
public void testMdcPattern1() throws Exception {
testMdcPattern("%m : %X", "Hello : {}", false);
}
@@ -241,7 +246,7 @@ public class PatternLayoutTest {
.setIncludeLocation(true)
.setMessage(new SimpleMessage("entry")).build();
final String result1 = new FauxLogger().formatEvent(event1, layout);
- final String expectSuffix1 = String.format("====== PatternLayoutTest.testPatternSelector:243 entry ======%n");
+ final String expectSuffix1 = String.format("====== PatternLayoutTest.testPatternSelector:248 entry ======%n");
assertTrue("Unexpected result: " + result1, result1.endsWith(expectSuffix1));
final LogEvent event2 = Log4jLogEvent.newBuilder() //
.setLoggerName(this.getClass().getName()).setLoggerFqcn("org.apache.logging.log4j.core.Logger") //