jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maxim <maxi...@anahoret.com>
Subject TCK question
Date Thu, 21 Apr 2005 13:08:31 GMT
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.

-- 
Best regards, Maxim.
Anahoret Team.


Mime
View raw message