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