Hi Gennady,

first of all, sorry for the delay but I was busy with some other work.

you are right, the exception declarations with their documentation are not 100% clear. The test should therefore only create a situation where a ItemExistsException can be thrown.

Thanks for the suggestion. I have changed the test case accordingly in svn revision: 348915

regards
 marcel

Gennady Azarenkov wrote:
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

Reply via email to