Code example for GregorianCalendar

Methods: setTime

0
 
	@Test 
	public void testSerialize() throws ParseException { 
		 
		Date date = new Date();
		Calendar expected = new GregorianCalendar();
		expected.setTime(date);
		 
		String iso8601 = ISO8601.fromCalendar(expected);
		 
		Calendar got = ISO8601.toCalendar(iso8601);
		 
		// test this way until millisecond testing is fixed 
		Assert.assertEquals(date.toString(), got.getTime().toString());
	} 
	 
}