Code example for GregorianCalendar

Methods: equals, setTime

0
	 * @tests java.util.GregorianCalendar#GregorianCalendar(java.util.Locale) 
	 */ 
	public void test_ConstructorLjava_util_Locale() { 
		// Test for method java.util.GregorianCalendar(java.util.Locale) 
		Date date = new Date();
		GregorianCalendar gcJapan = new GregorianCalendar(Locale.JAPAN);
		gcJapan.setTime(date);
		GregorianCalendar gcJapan2 = new GregorianCalendar(Locale.JAPAN);
		gcJapan2.setTime(date);
		GregorianCalendar gcItaly = new GregorianCalendar(Locale.ITALY);
		gcItaly.setTime(date);
		assertTrue("Locales not created correctly", gcJapan.equals(gcJapan2)
				&& !gcJapan.equals(gcItaly));
	} 
 
	/** 
	 * @tests java.util.GregorianCalendar#GregorianCalendar(java.util.TimeZone) 
	 */ 
	public void test_ConstructorLjava_util_TimeZone() { 
		// Test for method java.util.GregorianCalendar(java.util.TimeZone) 
		Date date = new Date(2008,1,1);