Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 75302 invoked from network); 26 Jul 2006 23:25:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Jul 2006 23:25:38 -0000 Received: (qmail 2976 invoked by uid 500); 26 Jul 2006 23:25:36 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 2952 invoked by uid 500); 26 Jul 2006 23:25:36 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 2942 invoked by uid 99); 26 Jul 2006 23:25:36 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Jul 2006 16:25:36 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Jul 2006 16:25:35 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id DDF0741000A for ; Wed, 26 Jul 2006 23:23:13 +0000 (GMT) Message-ID: <27348265.1153956193906.JavaMail.jira@brutus> Date: Wed, 26 Jul 2006 16:23:13 -0700 (PDT) From: "David Pitfield (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Created: (JCR-503) TCK: SetValueDateTest compares Calendar objects MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N TCK: SetValueDateTest compares Calendar objects ----------------------------------------------- Key: JCR-503 URL: http://issues.apache.org/jira/browse/JCR-503 Project: Jackrabbit Issue Type: Bug Components: test Reporter: David Pitfield SetValueDateTest#testDateSession SetValueDateTest#testDateParent Tests compare Calendar objects. Calendar.equals(Object) is a stronger test than JSR-170 specifies for Value.equals(Object), leading to false failures. For the purpose of these tests, even Value.equals(Object) is too strong an equality test, since some repositories may normalize date/time values across a save/read roundtrip (for example, converting "Z" to "+00:00", or adding/removing trailing zeros in fractional seconds). Proposal: compare the getTimeInMillis() values. --- SetValueDateTest.java (revision 422074) +++ SetValueDateTest.java (working copy) @@ -79,7 +80,8 @@ public void testDateSession() throws RepositoryException { property1.setValue(value); superuser.save(); - assertEquals("Date node property not saved", value.getDate(), property1.getValue().getDate()); + assertEquals("Date node property not saved", + value.getDate().getTimeInMillis(), property1.getDate().getTimeInMillis()); } /** @@ -89,7 +91,8 @@ public void testDateParent() throws RepositoryException { property1.setValue(value.getDate()); node.save(); - assertEquals("Date node property not saved", value.getDate(), property1.getValue().getDate()); + assertEquals("Date node property not saved", + value.getDate().getTimeInMillis(), property1.getDate().getTimeInMillis()); } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira