* 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");
cachedFormat.setTimeZone(cet);
Calendar c = Calendar.getInstance();
c.set(2004, Calendar.DECEMBER, 12, 20, 0);
c.set(Calendar.SECOND, 37);
c.set(Calendar.MILLISECOND, 23);
c.setTimeZone(cet);
String s = cachedFormat.format(c.getTime());
assertEquals("2004-December-12 20:00:37,23 GMT+01:00", s);
c.set(2005, Calendar.JANUARY, 1, 0, 0);
c.set(Calendar.SECOND, 13);
c.set(Calendar.MILLISECOND, 905);
s = cachedFormat.format(c.getTime());
assertEquals("2005-January-01 00:00:13,905 GMT+01:00", s);
}