You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Chen Shunfei (JIRA)" <ji...@apache.org> on 2007/09/27 11:15:50 UTC
[jira] Updated: (HARMONY-4863) [classlib][luni]TimeZone.getTimeZone
does not work properly
[ https://issues.apache.org/jira/browse/HARMONY-4863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chen Shunfei updated HARMONY-4863:
----------------------------------
Description:
import junit.framework.TestCase;
import java.util.Calendar;
import java.util.TimeZone;
import java.util.Date;
public class TestTimeZone extends TestCase{
public void testTimeZone() throws Throwable{
Calendar calendar = Calendar.getInstance();
calendar.setTimeZone(TimeZone.getTimeZone("GMT+0"));
int timeOne= calendar.get(Calendar.HOUR_OF_DAY);
calendar.setTimeZone(TimeZone.getTimeZone("GMT+15"));
int timeTwo = calendar.get(java.util.Calendar.HOUR_OF_DAY);
int i = (timeTwo-timeOne+24)%24;
assertEquals(i,15);
}
}
was:
This failure only happens on Linux. Here is the test case of Junit
import junit.framework.TestCase;
import java.util.Calendar;
import java.util.TimeZone;
import java.util.Date;
public class TestTimeZone extends TestCase{
public void testTimeZone() throws Throwable{
Calendar calendar = Calendar.getInstance();
calendar.setTimeZone(TimeZone.getTimeZone("GMT+0"));
int timeOne= calendar.get(Calendar.HOUR_OF_DAY);
calendar.setTimeZone(TimeZone.getTimeZone("GMT+15"));
int timeTwo = calendar.get(java.util.Calendar.HOUR_OF_DAY);
int i = timeTwo-timeOne;
assertEquals(i,15);
}
}
Summary: [classlib][luni]TimeZone.getTimeZone does not work properly (was: Bug found on java.util)
> [classlib][luni]TimeZone.getTimeZone does not work properly
> -----------------------------------------------------------
>
> Key: HARMONY-4863
> URL: https://issues.apache.org/jira/browse/HARMONY-4863
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Linux Ubuntu
> harmony-jre-567890
> Reporter: Chen Shunfei
> Assignee: Tony Wu
> Priority: Minor
>
> import junit.framework.TestCase;
> import java.util.Calendar;
> import java.util.TimeZone;
> import java.util.Date;
> public class TestTimeZone extends TestCase{
> public void testTimeZone() throws Throwable{
> Calendar calendar = Calendar.getInstance();
> calendar.setTimeZone(TimeZone.getTimeZone("GMT+0"));
> int timeOne= calendar.get(Calendar.HOUR_OF_DAY);
> calendar.setTimeZone(TimeZone.getTimeZone("GMT+15"));
> int timeTwo = calendar.get(java.util.Calendar.HOUR_OF_DAY);
> int i = (timeTwo-timeOne+24)%24;
> assertEquals(i,15);
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.