jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gennady Azarenkov <gazaren...@gmail.com>
Subject TCK: SessionTest.testMoveItemExistsException()
Date Mon, 21 Nov 2005 12:38:29 GMT
hi,

it seems to me that SessionTest.testMoveItemExistsException() is not 
completely correct:

here testNodeType is "nt:unstructured"
Node moveNode = srcParentNode.addNode(nodeName2, testNodeType);

here getProperty("nodetype2") is "nt:folder"
Node destParentNode = defaultRootNode.addNode(nodeName3, 
getProperty("nodetype2"));
// add a valid child
Node destNode = destParentNode.addNode(nodeName2, getProperty("nodetype3"));

So,
superuser.move(moveNode.getPath(), destNode.getPath());
can throw ConstraintViolationException (not only ItemExistsException)
because of attempt to add node of nt:unstructured type to nt:folder parent 
and it is depend on
implementation what will be thrown in fact (our impl throws 
ConstraintViolationException first :) ).

i would replace
Node moveNode = srcParentNode.addNode(nodeName2, testNodeType);
with
Node moveNode = srcParentNode.addNode(nodeName2, getProperty("nodetype3"));

regards,
gena

Gennady Azarenkov
eXo platform 


Mime
View raw message