logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Fwd: logging-log4j2 git commit: Update tests for LOG4J2-1289.
Date Sat, 20 Feb 2016 04:25:04 GMT
Thanks Matt!

Gary

---------- Forwarded message ----------
From: <mattsicker@apache.org>
Date: Fri, Feb 19, 2016 at 6:57 PM
Subject: logging-log4j2 git commit: Update tests for LOG4J2-1289.
To: commits@logging.apache.org


Repository: logging-log4j2
Updated Branches:
  refs/heads/master 504c2ebd5 -> 5fef2798e


Update tests for LOG4J2-1289.


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit:
http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/5fef2798
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/5fef2798
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/5fef2798

Branch: refs/heads/master
Commit: 5fef2798e8f4e67a59112d51a97fe27dbc1781db
Parents: 504c2eb
Author: Matt Sicker <boards@gmail.com>
Authored: Fri Feb 19 20:55:32 2016 -0600
Committer: Matt Sicker <boards@gmail.com>
Committed: Fri Feb 19 20:57:26 2016 -0600

----------------------------------------------------------------------
 .../logging/log4j/core/PatternSelectorTest.java    | 10 +++++-----
 .../logging/log4j/jul/AbstractLoggerTest.java      | 17 ++++++++---------
 2 files changed, 13 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5fef2798/log4j-core/src/test/java/org/apache/logging/log4j/core/PatternSelectorTest.java
----------------------------------------------------------------------
diff --git
a/log4j-core/src/test/java/org/apache/logging/log4j/core/PatternSelectorTest.java
b/log4j-core/src/test/java/org/apache/logging/log4j/core/PatternSelectorTest.java
index 7e168bd..9fda787 100644
---
a/log4j-core/src/test/java/org/apache/logging/log4j/core/PatternSelectorTest.java
+++
b/log4j-core/src/test/java/org/apache/logging/log4j/core/PatternSelectorTest.java
@@ -16,6 +16,8 @@
  */
 package org.apache.logging.log4j.core;

+import java.util.List;
+
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.core.util.Constants;
 import org.apache.logging.log4j.junit.LoggerContextRule;
@@ -23,8 +25,6 @@ import
org.apache.logging.log4j.test.appender.ListAppender;
 import org.junit.ClassRule;
 import org.junit.Test;

-import java.util.List;
-
 import static org.junit.Assert.*;
 /**
  *
@@ -49,7 +49,7 @@ public class PatternSelectorTest {
         assertNotNull("No Messages", messages);
         assertTrue("Incorrect number of messages. Expected 3, Actual " +
messages.size() + ": " + messages, messages.size() == 3);
         final String expect = String.format("[TRACE]
TestMarkerPatternSelector ====== "
-                +
"o.a.l.l.c.PatternSelectorTest.testMarkerPatternSelector:43 entry
======%n");
+                +
"o.a.l.l.c.PatternSelectorTest.testMarkerPatternSelector:43 Enter
======%n");
         assertEquals(expect, messages.get(0));
         assertEquals("[INFO ] TestMarkerPatternSelector Hello World" +
Constants.LINE_SEPARATOR, messages.get(1));
         app.clear();
@@ -69,7 +69,7 @@ public class PatternSelectorTest {
         assertNotNull("No Messages", messages);
         assertTrue("Incorrect number of messages. Expected 4, Actual " +
messages.size() + ": " + messages, messages.size() == 4);
         String expect = "[TRACE] TestScriptPatternSelector ====== " +
-
"o.a.l.l.c.PatternSelectorTest.testScriptPatternSelector:62 entry ======" +
Constants.LINE_SEPARATOR;
+
"o.a.l.l.c.PatternSelectorTest.testScriptPatternSelector:62 Enter ======" +
Constants.LINE_SEPARATOR;
         assertEquals(expect, messages.get(0));
         expect = "[INFO ] TestScriptPatternSelector
o.a.l.l.c.PatternSelectorTest.testScriptPatternSelector.63 " +
                 "Hello World" + Constants.LINE_SEPARATOR;
@@ -92,7 +92,7 @@ public class PatternSelectorTest {
         assertNotNull("No Messages", messages);
         assertTrue("Incorrect number of messages. Expected 4, Actual " +
messages.size() + ": " + messages, messages.size() == 4);
         String expect = "[TRACE] TestJavaScriptPatternSelector ====== " +
-
"o.a.l.l.c.PatternSelectorTest.testJavaScriptPatternSelector:85 entry
======" + Constants.LINE_SEPARATOR;
+
"o.a.l.l.c.PatternSelectorTest.testJavaScriptPatternSelector:85 Enter
======" + Constants.LINE_SEPARATOR;
         assertEquals(expect, messages.get(0));
         expect = "[INFO ] TestJavaScriptPatternSelector " +

 "o.a.l.l.c.PatternSelectorTest.testJavaScriptPatternSelector.86 Hello
World" + Constants.LINE_SEPARATOR;

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5fef2798/log4j-jul/src/test/java/org/apache/logging/log4j/jul/AbstractLoggerTest.java
----------------------------------------------------------------------
diff --git
a/log4j-jul/src/test/java/org/apache/logging/log4j/jul/AbstractLoggerTest.java
b/log4j-jul/src/test/java/org/apache/logging/log4j/jul/AbstractLoggerTest.java
index e6ba02f..46f5999 100644
---
a/log4j-jul/src/test/java/org/apache/logging/log4j/jul/AbstractLoggerTest.java
+++
b/log4j-jul/src/test/java/org/apache/logging/log4j/jul/AbstractLoggerTest.java
@@ -17,12 +17,6 @@

 package org.apache.logging.log4j.jul;

-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.instanceOf;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
-
 import java.util.List;
 import java.util.logging.Logger;

@@ -32,6 +26,11 @@ import org.apache.logging.log4j.core.impl.Log4jLogEvent;
 import org.apache.logging.log4j.test.appender.ListAppender;
 import org.junit.Test;

+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.junit.Assert.*;
+
 /**
  *
  */
@@ -149,9 +148,9 @@ public abstract class AbstractLoggerTest {
                 new Object[] { "TestParam0", "TestParam1" });
         final List<LogEvent> events = flowAppender.getEvents();
         assertThat(events, hasSize(3));
-        assertEquals("entry",
events.get(0).getMessage().getFormattedMessage());
-        assertEquals("entry params(TestParam)",
events.get(1).getMessage().getFormattedMessage());
-        assertEquals("entry params(TestParam0, TestParam1)",
events.get(2).getMessage().getFormattedMessage());
+        assertEquals("Enter",
events.get(0).getMessage().getFormattedMessage());
+        assertEquals("Enter params(TestParam)",
events.get(1).getMessage().getFormattedMessage());
+        assertEquals("Enter params(TestParam0, TestParam1)",
events.get(2).getMessage().getFormattedMessage());
     }

     @Test




-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Mime
View raw message