Code example for SimpleTimeZone

Methods: setEndRule, setStartRule, useDaylightTime

0
	/** 
	 * @tests java.util.SimpleTimeZone#useDaylightTime() 
	 */ 
	public void test_useDaylightTime() { 
		// Test for method boolean java.util.SimpleTimeZone.useDaylightTime() 
		SimpleTimeZone st = new SimpleTimeZone(1000, "Test_TZ");
		assertTrue("useDaylightTime returned incorrect value", !st
				.useDaylightTime());
		// Spec indicates that both end and start must be set or result is 
		// undefined 
		st.setStartRule(Calendar.NOVEMBER, 1, Calendar.SUNDAY, 0);
		st.setEndRule(Calendar.NOVEMBER, -1, Calendar.SUNDAY, 0);
		assertTrue("useDaylightTime returned incorrect value", st
				.useDaylightTime());
	} 
 
	/** 
	 * Sets up the fixture, for example, open a network connection. This method 
	 * is called before a test is executed. 
	 */ 
	protected void setUp() {