Code example for SimpleTimeZone

Methods: getRawOffset

0
     */ 
	public void test_getRawOffset() { 
		// Test for method int java.util.SimpleTimeZone.getRawOffset() 
		st1 = (SimpleTimeZone) TimeZone.getTimeZone("EST");
		assertTrue("Incorrect offset returned",
				st1.getRawOffset() == -(5 * 60 * 60 * 1000));
 
	} 
 
	/** 
	 * @tests java.util.SimpleTimeZone#hashCode() 
	 */ 
	public void test_hashCode() { 
		// Test for method int java.util.SimpleTimeZone.hashCode() 
		// For lack of a better test. 
		st1 = new SimpleTimeZone(-5 * 3600000, "EST", Calendar.APRIL, 1,
				-Calendar.SUNDAY, 2 * 3600000, Calendar.OCTOBER, -1,
				Calendar.SUNDAY, 2 * 3600000);
		assertTrue("Returned different hashcodes", TimeZone.getTimeZone("EST")
				.hashCode() == st1.hashCode());
	}