You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by David Caruana <da...@alfresco.org> on 2005/09/23 13:20:26 UTC

Node.hasProperty clarification

What is the expected behaviour if Node.hasProperty is called with a
malformed path?  I believe it can throw a RepositoryException, but the
spec isn't explicit.

If that is the case, there may be an issue with the TCK
NodeReadMethodsTest.testHasProperty().  It builds a non-existent
property name by cycling through the existing property names and
concatenating them.  In our test data, we have namespaced property names
resulting in a path that contains many ':' seperated elements.  Our
hasProperty() implementation is throwing an invalid name exception and
thus the test fails.

Is that an issue with the test or should we return false in the case of
malformed paths?

Regards,
David Caruana
www.alfresco.org


Re: Node.hasProperty clarification

Posted by Marcel Reutegger <ma...@gmx.net>.
this is indeed an issue with the tests. I've fixed three test cases: 
testGetPropertiesNamePatter(), testHasNode() and testHasProperty()

svn revision is: 291168

regards
  marcel

Stefan Guggisberg wrote:
> On 9/23/05, David Caruana <da...@alfresco.org> wrote:
> 
>>What is the expected behaviour if Node.hasProperty is called with a
>>malformed path?  I believe it can throw a RepositoryException, but the
>>spec isn't explicit.
> 
> 
> i agree. passing a syntactically invalid relative path should result in a
> RepositoryException (malformed path/name). this would be consistent
> with the rest of the api. and the spec should be more explicit in this case.
> 
> 
>>If that is the case, there may be an issue with the TCK
>>NodeReadMethodsTest.testHasProperty().  It builds a non-existent
>>property name by cycling through the existing property names and
>>concatenating them.  In our test data, we have namespaced property names
>>resulting in a path that contains many ':' seperated elements.  Our
>>hasProperty() implementation is throwing an invalid name exception and
>>thus the test fails.
>>
>>Is that an issue with the test or should we return false in the case of
>>malformed paths?
> 
> 
> i guess this is an issue with the test and should be fixed.
> 
> cheers
> stefan
> 
> 
>>Regards,
>>David Caruana
>>www.alfresco.org
>>
>>
>>
> 
> 
> 

Re: Node.hasProperty clarification

Posted by Stefan Guggisberg <st...@gmail.com>.
On 9/23/05, David Caruana <da...@alfresco.org> wrote:
> What is the expected behaviour if Node.hasProperty is called with a
> malformed path?  I believe it can throw a RepositoryException, but the
> spec isn't explicit.

i agree. passing a syntactically invalid relative path should result in a
RepositoryException (malformed path/name). this would be consistent
with the rest of the api. and the spec should be more explicit in this case.

>
> If that is the case, there may be an issue with the TCK
> NodeReadMethodsTest.testHasProperty().  It builds a non-existent
> property name by cycling through the existing property names and
> concatenating them.  In our test data, we have namespaced property names
> resulting in a path that contains many ':' seperated elements.  Our
> hasProperty() implementation is throwing an invalid name exception and
> thus the test fails.
>
> Is that an issue with the test or should we return false in the case of
> malformed paths?

i guess this is an issue with the test and should be fixed.

cheers
stefan

>
> Regards,
> David Caruana
> www.alfresco.org
>
>
>