Code example for SimpleTimeZone

Methods: inDaylightTime, setEndRule, setStartRule, setStartYear

0
	/** 
	 * @tests java.util.SimpleTimeZone#setStartYear(int) 
	 */ 
	public void test_setStartYearI() { 
		// Test for method void java.util.SimpleTimeZone.setStartYear(int) 
		SimpleTimeZone st = new SimpleTimeZone(1000, "Test_TZ");
		st.setStartRule(Calendar.NOVEMBER, 1, Calendar.SUNDAY, 0);
		st.setEndRule(Calendar.NOVEMBER, -1, Calendar.SUNDAY, 0);
		st.setStartYear(1999);
		assertTrue("set year improperly set1", !(st
				.inDaylightTime(new GregorianCalendar(1999, Calendar.JULY, 12)
						.getTime())));
		assertTrue("set year improperly set2", !(st
				.inDaylightTime(new GregorianCalendar(1998, Calendar.OCTOBER,
						13).getTime())));
		assertTrue("set year improperly set3", (st
				.inDaylightTime(new GregorianCalendar(1999, Calendar.NOVEMBER,
						13).getTime())));
	} 
 
	/** 
	 * @tests java.util.SimpleTimeZone#toString()