Hi, all,
I looked at this issue from the JIRA[1]. The testcase works fine on RI but
fails on Harmony in the second assert statement.
I found that the returned TimeZone instance from
TimeZone.getTimeZone("America/Toronto") on Harmony was "GMT" other than
"America/Toronto". That's why the second assert statement fails on Harmony.
I attached a patch to the JIRA[1], which will solve
this issue. Anybody to verify it? If no objection, I will ask a committer to
apply it: )
-----------------TestCase---------------------------
import java.util.TimeZone;
import java.util.Date;
import junit.framework.TestCase;
public class TestGetTimezoneOffset extends TestCase {
public void testGetTimezoneOffset() {
TimeZone.setDefault(TimeZone.getTimeZone("America/Toronto"));
Date date = new Date(07,2,24);
assertEquals(300,date.getTimezoneOffset());
date = new Date(99,8,1);
assertEquals(240,date.getTimezoneOffset());
}
}
[1] https://issues.apache.org/jira/browse/HARMONY-4904
--
Best Regards,
Jim Yu (虞俊杰)
China Software Development Lab, IBM