Code example for SimpleTimeZone

Methods: getDSTSavings, setEndRule, setStartRule

0
	/** 
	 * @tests java.util.SimpleTimeZone#getDSTSavings() 
	 */ 
	public void test_getDSTSavings() { 
		// Test for method int java.util.SimpleTimeZone.getDSTSavings() 
		st1 = new SimpleTimeZone(0, "TEST"); 
 
		assertEquals("Non-zero default daylight savings", 
				0, st1.getDSTSavings()); 
		st1.setStartRule(0, 1, 1, 1); 
		st1.setEndRule(11, 1, 1, 1); 
 
		assertEquals("Incorrect default daylight savings", 
				3600000, st1.getDSTSavings()); 
		st1 = new SimpleTimeZone(-5 * 3600000, "EST", Calendar.APRIL, 1, 
				-Calendar.SUNDAY, 2 * 3600000, Calendar.OCTOBER, -1, 
				Calendar.SUNDAY, 2 * 3600000, 7200000); 
		assertEquals("Incorrect daylight savings from constructor", 7200000, st1 
				.getDSTSavings()); 
 
	}