Hi Maxim,
you are right, the test fails if the property is multi-valued. Unfortunately it is not just the BooleanPropertyTest. It seems that most of the XXXPropertyTest classes have this flaw :-/
I've fixed the test cases accordingly (svn revision: 164063)
thanks very much for reporting this issue!
regards marcel
Maxim wrote:
Hello jackrabbit-dev.
In the file: /jackrabbit/src/test/org/apache/jackrabbit/test/api/BooleanPropertyTest.java
from line 52 it says: ----------------------------------------------------------- public void testValue() throws RepositoryException { if (multiple) { try { prop.getBoolean(); fail("Property.getBoolean() called on a multivalue property " + "should throw a ValueFormatException."); } catch (ValueFormatException vfe) { // ok } } boolean bool = prop.getValue().getBoolean(); boolean otherBool = prop.getBoolean(); assertTrue("Value.getBoolean() and Property.getBoolean() " + "return different values.", bool == otherBool) ; } -----------------------------------------------------------
As far as I understand the specification, if current property is indeed multi-valued, calling call prop.getValue() should throw ValueFormatException.
So, shouldn't it say instead: ----------------------------------------------------------- public void testValue() throws RepositoryException { if (multiple) { try { prop.getBoolean(); fail("Property.getBoolean() called on a multivalue property " + "should throw a ValueFormatException."); } catch (ValueFormatException vfe) { // ok } } else { boolean bool = prop.getValue().getBoolean(); boolean otherBool = prop.getBoolean(); assertTrue("Value.getBoolean() and Property.getBoolean() " + "return different values.", bool == otherBool) ; } } -----------------------------------------------------------
Thank you.
