logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1405575 - /logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/PatternParserTest.java
Date Sun, 04 Nov 2012 16:03:45 GMT
Author: ggregory
Date: Sun Nov  4 16:03:45 2012
New Revision: 1405575

URL: http://svn.apache.org/viewvc?rev=1405575&view=rev
Log:
Fix test to be OS independent.

Modified:
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/PatternParserTest.java

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/PatternParserTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/PatternParserTest.java?rev=1405575&r1=1405574&r2=1405575&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/PatternParserTest.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/pattern/PatternParserTest.java
Sun Nov  4 16:03:45 2012
@@ -115,14 +115,14 @@ public class PatternParserTest {
         Throwable t = new Throwable();
         StackTraceElement[] elements = t.getStackTrace();
         LogEvent event = new Log4jLogEvent("org.apache.logging.log4j.PatternParserTest",
MarkerManager.getMarker("TEST"),
-            Logger.class.getName(), Level.INFO, new SimpleMessage("Hello, world"), null,
-            null, null, "Thread1", elements[0], System.currentTimeMillis());
+                Logger.class.getName(), Level.INFO, new SimpleMessage("Hello, world"), null,
null, null, "Thread1", elements[0],
+                System.currentTimeMillis());
         StringBuilder buf = new StringBuilder();
         for (PatternFormatter formatter : formatters) {
             formatter.format(event, buf);
         }
         String str = buf.toString();
-        String expected = "] INFO : Hello, world\n\u001B[m";
+        String expected = String.format("] INFO : Hello, world%s\u001B[m", System.getProperty("line.separator"));
         assertTrue(" Expected to end with: " + expected + ". Actual: " + str, str.endsWith(expected));
     }
 



Mime
View raw message