ceki 2004/12/31 08:54:23
Modified: tests/src/java/org/apache/log4j/pattern
CachedDateFormatTest.java
Log:
'Z' is not a date pattern recognized by SimpleDateFormat in JDK versions
earlier than 1.4.
Testing with 'z' instead.
Revision Changes Path
1.13 +6 -4
logging-log4j/tests/src/java/org/apache/log4j/pattern/CachedDateFormatTest.java
Index: CachedDateFormatTest.java
===================================================================
RCS file:
/home/cvs/logging-log4j/tests/src/java/org/apache/log4j/pattern/CachedDateFormatTest.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- CachedDateFormatTest.java 31 Dec 2004 16:52:46 -0000 1.12
+++ CachedDateFormatTest.java 31 Dec 2004 16:54:23 -0000 1.13
@@ -137,9 +137,9 @@
}
public void test4() {
- // subsequent calls within one minute
- // are optimized to reuse previous formatted value
- // make a couple of nearly spaced calls
+ // subsequent calls within one minute are optimized to reuse previous
+ // formatted value. make a couple of nearly spaced calls
+ // (Note: 'Z' is JDK 1.4, using 'z' instead.)
SimpleDateFormat baseFormat =
new SimpleDateFormat("EEE, MMM dd, HH:mm:ss.SSS z", Locale.ENGLISH);
DateFormat cachedFormat = new CachedDateFormat(baseFormat, 1000);
@@ -164,9 +164,10 @@
// subsequent calls within one minute
// are optimized to reuse previous formatted value
// make a couple of nearly spaced calls
+ // (Note: 'Z' is JDK 1.4, using 'z' instead.)
Locale thai = new Locale("th", "TH");
SimpleDateFormat baseFormat =
- new SimpleDateFormat("EEE, MMM dd, HH:mm:ss.SSS Z", thai);
+ new SimpleDateFormat("EEE, MMM dd, HH:mm:ss.SSS z", thai);
DateFormat cachedFormat = new CachedDateFormat(baseFormat, 1000);
//
// use a date in the year 2000 CE to attempt to confuse the millisecond
locator
@@ -227,6 +228,7 @@
* Test of caching when less than three millisecond digits are specified.
*/
public void test9() {
+ // (Note: 'Z' is JDK 1.4, using 'z' instead.)
DateFormat baseFormat = new SimpleDateFormat("yyyy-MMMM-dd HH:mm:ss,SS
z", Locale.US);
DateFormat cachedFormat = new CachedDateFormat(baseFormat, 1000);
TimeZone cet = TimeZone.getTimeZone("GMT+1");
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]