[ http://issues.apache.org/jira/browse/JCR-502?page=all ]
Marcel Reutegger resolved JCR-502. ---------------------------------- Fix Version/s: 1.1 Resolution: Fixed Comitted my above mentioned patch. svn revision: 428296 Thank you for reporting this issue. > TCK: SetPropertyCalendarTest compares Calendar objects > ------------------------------------------------------ > > Key: JCR-502 > URL: http://issues.apache.org/jira/browse/JCR-502 > Project: Jackrabbit > Issue Type: Bug > Components: test > Reporter: David Pitfield > Fix For: 1.1 > > > SetPropertyCalendarTest# testNewCalendarPropertySession > SetPropertyCalendarTest# testModifyCalendarPropertySession > SetPropertyCalendarTest# testNewCalendarPropertyParent > SetPropertyCalendarTest# testModifyCalendarPropertyParent > 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. > --- SetPropertyCalendarTest.java (revision 422074) > +++ SetPropertyCalendarTest.java (working copy) > @@ -52,8 +52,8 @@ > testNode.setProperty(propertyName1, c1); > superuser.save(); > assertEquals("Setting property with Node.setProperty(String, > Calendar) and Session.save() not working", > - c1, > - testNode.getProperty(propertyName1).getDate()); > + c1.getTimeInMillis(), > + > testNode.getProperty(propertyName1).getDate().getTimeInMillis()); > } > > /** > @@ -66,8 +66,8 @@ > testNode.setProperty(propertyName1, c2); > superuser.save(); > assertEquals("Modifying property with Node.setProperty(String, > Calendar) and Session.save() not working", > - c2, > - testNode.getProperty(propertyName1).getDate()); > + c2.getTimeInMillis(), > + > testNode.getProperty(propertyName1).getDate().getTimeInMillis()); > } > > /** > @@ -78,8 +78,8 @@ > testNode.setProperty(propertyName1, c1); > testRootNode.save(); > assertEquals("Setting property with Node.setProperty(String, > Calendar) and parentNode.save() not working", > - c1, > - testNode.getProperty(propertyName1).getDate()); > + c1.getTimeInMillis(), > + > testNode.getProperty(propertyName1).getDate().getTimeInMillis()); > } > > /** > @@ -92,8 +92,8 @@ > testNode.setProperty(propertyName1, c2); > testRootNode.save(); > assertEquals("Modifying property with Node.setProperty(String, > Calendar) and parentNode.save() not working", > - c2, > - testNode.getProperty(propertyName1).getDate()); > + c2.getTimeInMillis(), > + > testNode.getProperty(propertyName1).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