public void testFromDate() throws Exception {
  TimeZone.setDefault(TimeZone.getTimeZone("PST"));
  final Calendar date=Calendar.getInstance();
  date.setTime(new Date(123456789012345L));
  Assert.assertEquals("5882-03-11T00:30:12.345Z",CalendarSerializer.serialize(date));
  final Calendar dateNoMillis=Calendar.getInstance();
  dateNoMillis.setTime(new Date(123456789012000L));
  Assert.assertEquals("5882-03-11T00:30:12.000Z",CalendarSerializer.serialize(dateNoMillis));
}

public void testFromDate ( ) throws Exception { TimeZone . setDefault ( TimeZone . getTimeZone ( "PST" ) ) ; final Calendar date = Calendar . getInstance ( ) ; date . setTime ( new Date ( 123456789012345L ) ) ; Assert . assertEquals ( "5882-03-11T00:30:12.345Z" , CalendarSerializer . serialize ( date ) ) ; final Calendar dateNoMillis = Calendar . getInstance ( ) ; dateNoMillis . setTime ( new Date ( 123456789012000L ) ) ; Assert . assertEquals ( "5882-03-11T00:30:12.000Z" , CalendarSerializer . serialize ( dateNoMillis ) ) ; }
make sure that dates with and without millis can be converted properly into strings
