I think I found a bug in 
WorkspaceCloneReferenceableTest.testCloneNodesRemoveExistingFalse but I would 
like a second opinion.

When I run the test I fail with an ItemExistsException on the first clone 
statement, as follows.

public void testCloneNodesRemoveExistingFalse() throws RepositoryException {
    // add mixin referenceable to node1
    addMixinReferenceableToNode(node1);

    // clone a node from default workspace to have the same uuid on second 
workspace
    workspaceW2.clone(workspace.getName(), node1.getPath(), 
testRootNodeW2.getPath() + "/" + nodeName2, false);
*** I fail on the above

    // clone node1 from default workspace to second workspace
    try {
        workspaceW2.clone(workspace.getName(), node1.getPath(), 
testRootNodeW2.getPath() + "/" + nodeName3, false);
        fail("If removeExisting is false then a UUID collision should throw a 
ItemExistsException");
    } catch (ItemExistsException e) {
        // successful
    }
}

Upon examination I notice that node1 and node2 are created in both workspaces 
by the setUp code. Therefore, I would expect the first clone to fail.

1. Am I seeing this correctly? 
2. Does the test have a bug? 
3. Should the first clone be removed since it appears to have already been done?

Doug McComsey
Computer Associates
[EMAIL PROTECTED]
 


Reply via email to