Author: carnold
Date: Sat Mar 27 05:36:13 2010
New Revision: 928149

URL: http://svn.apache.org/viewvc?rev=928149&view=rev
Log:
Bug 49004: TestLogMF.testDebugDate fails on gcj

Modified:
    logging/log4j/trunk/src/changes/changes.xml
    logging/log4j/trunk/tests/src/java/org/apache/log4j/TestLogMF.java

Modified: logging/log4j/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/logging/log4j/trunk/src/changes/changes.xml?rev=928149&r1=928148&r2=928149&view=diff
==============================================================================
--- logging/log4j/trunk/src/changes/changes.xml (original)
+++ logging/log4j/trunk/src/changes/changes.xml Sat Mar 27 05:36:13 2010
@@ -98,6 +98,7 @@
        <action action="add" issue="48927">Add EnhancedPatternLayout from 
extras companion.</action>
        <action action="fix" issue="48784">Links to example code broken in the 
JavaDocs</action>
        <action action="fix" issue="48953">Unused imports and variables in test 
code cause gcj compile warnings.</action>
+       <action action="fix" issue="49004">TestLogMF.testDebugDate fails on 
gcj.</action>
     </release>
 
   

Modified: logging/log4j/trunk/tests/src/java/org/apache/log4j/TestLogMF.java
URL: 
http://svn.apache.org/viewvc/logging/log4j/trunk/tests/src/java/org/apache/log4j/TestLogMF.java?rev=928149&r1=928148&r2=928149&view=diff
==============================================================================
--- logging/log4j/trunk/tests/src/java/org/apache/log4j/TestLogMF.java 
(original)
+++ logging/log4j/trunk/tests/src/java/org/apache/log4j/TestLogMF.java Sat Mar 
27 05:36:13 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);
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to