jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marlis Lamp (JIRA)" <j...@apache.org>
Subject [jira] [Created] (JCR-2974) Node.update does not update same named child nodes if the number of the child nodes does not change
Date Wed, 25 May 2011 13:07:47 GMT
Node.update does not update same named child nodes if the number of the child nodes does not
change
---------------------------------------------------------------------------------------------------

                 Key: JCR-2974
                 URL: https://issues.apache.org/jira/browse/JCR-2974
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-core
    Affects Versions: 2.2.5
            Reporter: Marlis Lamp


The following test case fails:

    public void testUpdate() throws Exception {
        Session s1 = getSession(); // session on workspace 1
        Session s2 = getSession("unittest_2"); // session on workspace 2
        
        // add node /a with referenceable child node b on workspace 1
        Node a = s1.getRootNode().addNode("a");
        Node b = a.addNode("b");
        b.addMixin(NodeType.MIX_REFERENCEABLE);
        s1.save();

        // clone node a from workspace 1 to workspace 2
        s2.getWorkspace().clone(s1.getWorkspace().getName(), a.getPath(), a.getPath(), true);
        s2.save();

        // remove node b from workspace 1
        b.remove();
        s1.save();

        // add new node b on workspace 1
        b = a.addNode("b");
        b.addMixin(NodeType.MIX_REFERENCEABLE);
        s1.save();

        // perform update on node a in workspace 2
        Node corresponding_a = s2.getNode(a.getPath());
        corresponding_a.update(s1.getWorkspace().getName());

        // test if the uuid of node b equals in workspace 1 and in workspace 2
        assertEquals("uuid of child b should equal in both workspaces", b.getIdentifier(),
                corresponding_a.getNode("b").getIdentifier()); // this fails

        s1.logout();
        s2.logout();
    }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message