From dev-return-28621-apmail-harmony-dev-archive=harmony.apache.org@harmony.apache.org Thu Jul 26 20:51:55 2007 Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 20725 invoked from network); 26 Jul 2007 20:51:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Jul 2007 20:51:54 -0000 Received: (qmail 50981 invoked by uid 500); 26 Jul 2007 20:51:53 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 50956 invoked by uid 500); 26 Jul 2007 20:51:52 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 50947 invoked by uid 99); 26 Jul 2007 20:51:52 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jul 2007 13:51:52 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of alexander.frey@gmx.de designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 26 Jul 2007 13:51:51 -0700 Received: (qmail invoked by alias); 26 Jul 2007 20:51:28 -0000 Received: from p54A0DF09.dip.t-dialin.net (EHLO [192.168.2.202]) [84.160.223.9] by mail.gmx.net (mp035) with SMTP; 26 Jul 2007 22:51:28 +0200 X-Authenticated: #15140024 X-Provags-ID: V01U2FsdGVkX19ur/0qb31uS/IPN5JvRgG7mwhZymKtMPHbx/NAuV rp42pbos3k+8oK Message-ID: <46A909F4.5030300@gmx.de> Date: Thu, 26 Jul 2007 22:54:12 +0200 From: Alexander Frey User-Agent: Thunderbird 1.5.0.7 (X11/20060911) MIME-Version: 1.0 To: dev@harmony.apache.org Subject: Re: [classlib][luni] GregorianCalendarTest fails now References: <211709bc0707241934n70f84b75j8860a95b0a989656@mail.gmail.com> <211709bc0707242340n25f26ba4kf29d8b1e16315834@mail.gmail.com> In-Reply-To: <211709bc0707242340n25f26ba4kf29d8b1e16315834@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org Tony, I think this modified test isn't a valid regression test for HARMONY-4513 anymore. This problem only occurs if the calendar date and the cutover date of the calendar are the same, even the milliseconds. The constructors used in the original test set default values (0 for milliseconds) for the date fields not given to the constructors as parameters. The constructors in the modified test set the timezone and initialize with the current time (including milliseconds). The set method only modifies the date fields given as parameters, values of other fields are not changed. This means the milliseconds of the calendar and its cutover date are almost always different and the test passes. I recommend to either call gc.clear() before gc.set(year,...) or to set the milliseconds explicit to 0. Perhaps an assertEquals() should check the milliseconds to be sure and to 'document' this. Regards, Alexander Tony Wu wrote: > On 7/25/07, Alexey Varlamov wrote: >> 2007/7/25, Tony Wu : >> > Hi Alexey, >> > This testcase is added by me when fix HARMONY-4513, I think it should >> > not depend on vm. So I'm a little confused, would you please help to >> > try following test >> > >> > gGregorianCalendar c = new >> > GregorianCalendar(TimeZone.getTimeZone("GMT")); >> > gc.set(1582, Calendar.OCTOBER, 15, 0, 0, 0); >> > assertEquals(1582, gc.get(Calendar.YEAR)); >> > assertEquals(Calendar.OCTOBER, gc.get(Calendar.MONTH)); >> > assertEquals(15, gc.get(Calendar.DAY_OF_MONTH)); >> > assertEquals(0, gc.get(Calendar.HOUR_OF_DAY)); >> > assertEquals(0, gc.get(Calendar.MINUTE)); >> > assertEquals(0, gc.get(Calendar.SECOND)); >> > gc.set(1582, Calendar.OCTOBER, 14, 0, 0, 0); >> > assertEquals(24, gc.get(Calendar.DAY_OF_MONTH)); >> > >> > >> > if it passes and the line 732 of current GregorianCalendarTest still >> > fails, I should say it is due to different time zone and modify the >> > testcase. Thanks. >> >> This one passed on DRLVM. Indeed the key difference between VMs might >> be in detecting default TZ: on my Linux box user.timezone=BST on J9 >> and user.timezone= (is empty) on DRLVM (that look strange BTW). >> Anyway the testcase should not depend on this. > > agree, fixed at r559334. > >> >> > >> > On 7/24/07, Alexey Varlamov wrote: >> > > Seems it fails on DRLVM only. >> > > >> > > 2007/7/24, Alexey Varlamov : >> > > > The recently modified GregorianCalendarTest fails now, are there >> > > > someone looking at this? >> > > > >> > > > junit.framework.AssertionFailedError: expected:<15> but was:<5> >> > > > at >> tests.api.java.util.GregorianCalendarTest.test_getI(GregorianCalendarTest.java:732) >> >> > > > at >> java.lang.reflect.VMReflection.invokeMethod(VMReflection.java) >> > > > >> > > >> > >> > >> > -- >> > Tony Wu >> > China Software Development Lab, IBM >> > >> > >