JDK-6659364 : api/java_util/Date/index.html#Ctor: Date constructor case - tests fail on Vista and Win2008
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.3.1_22
  • Priority: P1
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2008
  • CPU: generic
  • Submitted: 2008-02-05
  • Updated: 2012-03-22
  • Resolved: 2008-03-08
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
The tests 
api/java_util/Date/index.html#Ctor: Date2001
api/java_util/Date/index.html#Ctor: Date2002
api/java_util/Date/index.html#Ctor: Date2003
fail for locale gmt +3.0 (Moscow).

Windows system has gmt +3.0 locale but tests pass if locale is gmt 0.0 only.
Tests report 

Expected: Sun Dec 31 21:00:00 GMT 1899: -2208999600000
Received: Mon Jan 01 00:00:00 GMT 1900: -2208988800000
Expected: Tue Jan 15 10:15:00 GMT 1901: -2176206300000
Received: Tue Jan 15 13:15:00 GMT 1901: -2176195500000
Expected: Mon Mar 05 11:06:05 GMT 3900: 60910398365000
Received: Mon Mar 05 14:06:05 GMT 3900: 60910409165000
----------log:(6/289)----------
10800000
Date2001: Failed. Received: Mon Jan 01 00:00:00 GMT 1900
Date2002: Failed. Received: Tue Jan 15 13:15:00 GMT 1901
Date2003: Failed. Received: Mon Mar 05 14:06:05 GMT 3900
Date2004: Passed. OKAY
STATUS:Failed.tests: 4; passed: 1; failed: 3; first test case failure: Date2001
result: Failed. tests: 4; passed: 1; failed: 3; first test case failure: Date2001

steps to reproduce: 
set CLASSPATH=Z:\\jck_promotions\\1.3a_01\\binaries\\JCK-runtime-13a_01\\tests\\..\\classes;Z:\\jck_promotions\\1.3a_01\\binaries\\JCK-runtime-13a_01\\javatest.jar 
set PATH= 
set SystemRoot=C:/Windows 
C:/jdk/jdk1.3.1_22/bin/java.exe -classic -Xfuture -Djava.library.path=Z:\\jck_promotions\\1.3a_01\\binaries\\JCK-runtime-13a_01\\tests/../lib-win32 -Djava.security.policy=Z:\\jck_promotions\\1.3a_01\\binaries\\JCK-runtime-13a_01\\tests\\..\\lib\\jck.policy -Djava.rmi.activation.port=1098 javasoft.sqe.tests.api.java.util.Date.CtorTests -locale.gmtOffset +3.0

Comments
EVALUATION It's been confirmed that the test cases failed require the correct platform time zone detection because the Date class ALWAYS uses the default time zone of which GMT offset must agree with the given gmtOffset by -locale.gmtOffseet.
08-03-2008

EVALUATION I believe developers have to decide is this the same issue or not. Please also take into account that CR 6440819 is in "Fix Delivered" state so it will be necessary to create MR for tracking 1.3.1 (in case you decide this is duplicate)
07-03-2008

EVALUATION Unless the time zone detection code for Vista is back ported to 1.3.1_xx, the date-time APIs can't be supported on Vista. Should this CR be closed as a duplicate of 6440819?
07-03-2008