logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1400882 - /logging/log4j/log4j2/trunk/api/src/test/java/org/apache/logging/log4j/LoggerTest.java
Date Mon, 22 Oct 2012 14:00:36 GMT
Author: ggregory
Date: Mon Oct 22 14:00:36 2012
New Revision: 1400882

URL: http://svn.apache.org/viewvc?rev=1400882&view=rev
Log:
Sort members.

Modified:
    logging/log4j/log4j2/trunk/api/src/test/java/org/apache/logging/log4j/LoggerTest.java

Modified: logging/log4j/log4j2/trunk/api/src/test/java/org/apache/logging/log4j/LoggerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/test/java/org/apache/logging/log4j/LoggerTest.java?rev=1400882&r1=1400881&r2=1400882&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/test/java/org/apache/logging/log4j/LoggerTest.java
(original)
+++ logging/log4j/log4j2/trunk/api/src/test/java/org/apache/logging/log4j/LoggerTest.java
Mon Oct 22 14:00:36 2012
@@ -37,11 +37,6 @@ public class LoggerTest {
     TestLogger logger = (TestLogger) LogManager.getLogger("LoggerTest");
     List<String> results = logger.getEntries();
 
-    @Before
-    public void setup() {
-        results.clear();
-    }
-
     @Test
     public void basicFlow() {
         logger.entry();
@@ -53,14 +48,6 @@ public class LoggerTest {
     }
 
     @Test
-    public void throwing() {
-        logger.throwing(new IllegalArgumentException("Test Exception"));
-        assertEquals(1, results.size());
-        assertTrue("Incorrect Throwing",
-            results.get(0).startsWith(" ERROR throwing java.lang.IllegalArgumentException:
Test Exception"));
-    }
-
-    @Test
     public void catching() {
         try {
             throw new NullPointerException();
@@ -102,6 +89,35 @@ public class LoggerTest {
     }
 
     @Test
+    public void getLoggerByClass() {
+        Logger classLogger = LogManager.getLogger(LoggerTest.class);
+        assertNotNull(classLogger);
+    }
+
+    public void getLoggerByNullClass() {
+        // Returns a SimpleLogger
+        Assert.assertNotNull(LogManager.getLogger((Class<?>) null));
+    }
+
+    public void getLoggerByNullObject() {
+        // Returns a SimpleLogger
+        Assert.assertNotNull(LogManager.getLogger((Object) null));
+    }
+
+    @Test
+    public void getLoggerByNullString() {
+        // Returns a SimpleLogger
+        Assert.assertNotNull(LogManager.getLogger((String) null));
+    }
+
+    @Test
+    public void getLoggerByObject() {
+        Logger classLogger = LogManager.getLogger(this);
+        assertNotNull(classLogger);
+        assertEquals(classLogger, LogManager.getLogger(LoggerTest.class));
+    }
+
+    @Test
     public void mdc() {
 
         ThreadContext.put("TestYear", new Integer(2010).toString());
@@ -115,6 +131,11 @@ public class LoggerTest {
             results.get(1).startsWith(" DEBUG Debug message"));
     }
 
+    @Before
+    public void setup() {
+        results.clear();
+    }
+
     @Test
     public void structuredData() {
         ThreadContext.put("loginId", "JohnDoe");
@@ -132,31 +153,10 @@ public class LoggerTest {
     }
 
     @Test
-    public void getLoggerByClass() {
-        Logger classLogger = LogManager.getLogger(LoggerTest.class);
-        assertNotNull(classLogger);
-    }
-
-    public void getLoggerByNullClass() {
-        // Returns a SimpleLogger
-        Assert.assertNotNull(LogManager.getLogger((Class<?>) null));
-    }
-
-    public void getLoggerByNullObject() {
-        // Returns a SimpleLogger
-        Assert.assertNotNull(LogManager.getLogger((Object) null));
-    }
-
-    @Test
-    public void getLoggerByNullString() {
-        // Returns a SimpleLogger
-        Assert.assertNotNull(LogManager.getLogger((String) null));
-    }
-
-    @Test
-    public void getLoggerByObject() {
-        Logger classLogger = LogManager.getLogger(this);
-        assertNotNull(classLogger);
-        assertEquals(classLogger, LogManager.getLogger(LoggerTest.class));
+    public void throwing() {
+        logger.throwing(new IllegalArgumentException("Test Exception"));
+        assertEquals(1, results.size());
+        assertTrue("Incorrect Throwing",
+            results.get(0).startsWith(" ERROR throwing java.lang.IllegalArgumentException:
Test Exception"));
     }
 }



Mime
View raw message