You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "McComsey, Doug" <Do...@ca.com> on 2005/07/29 18:19:06 UTC

TCK; testEmptyMultiStringParent

The testEmptyMultiStringParent test in the TCK looks like this:

    public void testEmptyMultiStringParent() throws RepositoryException {
        String[] emptyStringArray = new String[]{null};
        property2.setValue(emptyStringArray);
        node.save();

        assertEquals("Property.setValue(emptyStringArray) did not set the property to an empty array",
                      0, property2.getValues().length);
    }
 
This test would make sense if emptyStringArray had been defined this way:

        String[] emptyStringArray = new String[0];

As it is defined, it is not an empty array. It has one value, a null, and a length of one. My implementation fails this test because it returns exactly what was given to it. Zero does not equal one.

Is the test wrong or should I be checking the content of the array and removing nulls? 

Regards,
Doug
 
Doug McComsey
Computer Associates
doug.mccomsey@ca.com