You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ca...@apache.org on 2010/05/17 07:07:54 UTC

svn commit: r944973 - in /logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j: TestLogMF.java TestLogXF.java

Author: carnold
Date: Mon May 17 05:07:53 2010
New Revision: 944973

URL: http://svn.apache.org/viewvc?rev=944973&view=rev
Log:
Bug 48953: Unused imports and variables in test coude cause gcj compile warnings

Modified:
    logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/TestLogMF.java
    logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/TestLogXF.java

Modified: logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/TestLogMF.java
URL: http://svn.apache.org/viewvc/logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/TestLogMF.java?rev=944973&r1=944972&r2=944973&view=diff
==============================================================================
--- logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/TestLogMF.java (original)
+++ logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/TestLogMF.java Mon May 17 05:07:53 2010
@@ -22,6 +22,7 @@ import java.io.CharArrayWriter;
 import java.text.MessageFormat;
 import java.text.NumberFormat;
 import java.util.Date;
+import java.text.DateFormat;
 
 
 /**
@@ -480,7 +481,17 @@ public class TestLogMF extends TestCase 
 
         String expected = MessageFormat.format("Iteration {0}",
                 new Object[] { epoch });
-        assertEquals(expected, capture.getMessage());
+        String expected2 = "Iteration " + DateFormat.getDateTimeInstance(
+                                DateFormat.SHORT,
+                                DateFormat.SHORT).format(epoch);
+        String actual = capture.getMessage();
+        //
+        //  gcj has been observed to output 12/31/69 6:00:00 PM
+        //     instead of the expected 12/31/69 6:00 PM
+        if (System.getProperty("java.vendor").indexOf("Free") == -1) {
+            assertEquals(expected, actual);
+        }
+        assertEquals(expected2, actual);
     }
 
     /**

Modified: logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/TestLogXF.java
URL: http://svn.apache.org/viewvc/logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/TestLogXF.java?rev=944973&r1=944972&r2=944973&view=diff
==============================================================================
--- logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/TestLogXF.java (original)
+++ logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/TestLogXF.java Mon May 17 05:07:53 2010
@@ -200,16 +200,4 @@ public class TestLogXF extends TestCase 
         LogXF.throwing(logger, "SomeClass", "someMethod", new IllegalArgumentException());
         assertEquals("SomeClass.someMethod THROW", capture.getMessage());
     }
-
-    public void testJul() {
-        java.util.logging.Logger l = java.util.logging.Logger.getAnonymousLogger();
-        java.util.logging.Handler h = new java.util.logging.ConsoleHandler();
-        h.setLevel(java.util.logging.Level.FINER);
-        l.addHandler(h);
-        l.setLevel(java.util.logging.Level.FINER);
-        l.entering("SomeClass", "someMethod", "foo");
-        l.setLevel(java.util.logging.Level.FINER);
-        l.entering("SomeClass", "someMethod", BadStringifier.INSTANCE);
-    }
-
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org