harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen Shunfei (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4903) [classlib][luni]Calendar.get(Calendar.DST_OFFSET) returns wrong value.
Date Mon, 08 Oct 2007 08:09:50 GMT
[classlib][luni]Calendar.get(Calendar.DST_OFFSET) returns wrong value.
----------------------------------------------------------------------

                 Key: HARMONY-4903
                 URL: https://issues.apache.org/jira/browse/HARMONY-4903
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
         Environment: harmony-jre-579330
Windows
            Reporter: Chen Shunfei
            Priority: Minor


Here is the testCase:

import junit.framework.TestCase;
import java.util.Calendar;
import java.util.TimeZone;

public class TestDstOffset extends TestCase {
	TimeZone timeZone;
	Calendar cal;

	public void setUp() {
		timeZone = TimeZone.getTimeZone("America/Toronto");
		cal = Calendar.getInstance(timeZone);
	}

	public void testDstOffset() {
		cal.set(2006, Calendar.AUGUST, 1);
		assertEquals(cal.get(Calendar.DST_OFFSET), 3600000);
	}

	public void testTimeInMillis() {
		cal.clear();
		cal.setTimeInMillis(119785146189L);
		assertEquals(cal.get(Calendar.DST_OFFSET), 3600000);
	}

	public void testClear() {
		cal.clear(Calendar.DST_OFFSET);
		assertEquals(cal.get(Calendar.DST_OFFSET), 3600000);
	}

	public void testSetTimeInMills() {
		cal.clear(Calendar.DST_OFFSET);
		cal.set(Calendar.DST_OFFSET, 1800000);
		cal.setTimeInMillis(119785146189L);
		assertEquals(cal.get(Calendar.DST_OFFSET), 3600000);
	}
}




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message