logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1528068 - /logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java
Date Tue, 01 Oct 2013 12:41:50 GMT
Author: ggregory
Date: Tue Oct  1 12:41:49 2013
New Revision: 1528068

URL: http://svn.apache.org/r1528068
Log:
Sort members.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java?rev=1528068&r1=1528067&r2=1528068&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/PatternLayoutTest.java
Tue Oct  1 12:41:49 2013
@@ -39,15 +39,16 @@ import static org.junit.Assert.assertEqu
  *
  */
 public class PatternLayoutTest {
-    static String OUTPUT_FILE   = "target/output/PatternParser";
-    static String WITNESS_FILE  = "witness/PatternParser";
-    LoggerContext ctx = (LoggerContext) LogManager.getContext();
-    Logger root = ctx.getLogger("");
-
+    static ConfigurationFactory cf = new BasicConfigurationFactory();
     static String msgPattern = "%m%n";
+    static String OUTPUT_FILE   = "target/output/PatternParser";
     static final String regexPattern = "%replace{%logger %msg}{\\.}{/}";
-    static ConfigurationFactory cf = new BasicConfigurationFactory();
 
+    static String WITNESS_FILE  = "witness/PatternParser";
+    @AfterClass
+    public static void cleanupClass() {
+        ConfigurationFactory.removeConfigurationFactory(cf);
+    }
     @BeforeClass
     public static void setupClass() {
         ConfigurationFactory.setConfigurationFactory(cf);
@@ -55,10 +56,9 @@ public class PatternLayoutTest {
         ctx.reconfigure();
     }
 
-    @AfterClass
-    public static void cleanupClass() {
-        ConfigurationFactory.removeConfigurationFactory(cf);
-    }
+    LoggerContext ctx = (LoggerContext) LogManager.getContext();
+
+    Logger root = ctx.getLogger("");
 
 
     /**
@@ -133,14 +133,4 @@ public class PatternLayoutTest {
         appender.stop();
     }
 
-    @Test
-    public void testRegex() throws Exception {
-        final LoggerContext ctx = (LoggerContext) LogManager.getContext();
-        final PatternLayout layout = PatternLayout.createLayout(regexPattern, ctx.getConfiguration(),
-            null, null, null);
-        final LogEvent event = new Log4jLogEvent(this.getClass().getName(), null, "org.apache.logging.log4j.core.Logger",
-            Level.INFO, new SimpleMessage("Hello, world!"), null);
-        final byte[] result = layout.toByteArray(event);
-        assertEquals("org/apache/logging/log4j/core/layout/PatternLayoutTest Hello, world!",
new String(result));
-    }
 }



Mime
View raw message