Package javax.jcr

Examples of javax.jcr.Session.move()


        node.addNode("source").addNode("node").addMixin("mix:referenceable");
        node.addNode("target");
        session.save();

        session.refresh(true);
        session.move(TEST_PATH + "/source/node", TEST_PATH + "/target/moved");

        assertFalse(node.hasNode("source/node"));
        assertTrue(node.hasNode("source"));
        assertTrue(node.hasNode("target/moved"));
View Full Code Here


        String destPath = testRootNode.getPath() + '/' + name;

        Session session2 = getHelper().getSuperuserSession();
        try {
            assertFalse(session2.hasPendingChanges());
            session2.move(node.getPath(), destPath);
            assertTrue(session2.hasPendingChanges());
            session2.save();

        } finally {
            session2.logout();
View Full Code Here

                            addFile(n, tmpFile);
                            s.save();
                            String srcPath = n.getPath() + "/" + tmpFile;
                            String destPath = n.getPath() + "/file-" + i + ".bin";
                            // rename
                            s.move(srcPath, destPath);
                            s.save();
                        }

                    } catch (RepositoryException e) {
                        exceptions.put(path, e);
View Full Code Here

        // assert: child node locked
        assertTrue("Child node locked", testNode2.isLocked());

        // move child node up
        String newPath = testRootNode.getPath() + "/" + testNode2.getName();
        session.move(testNode2.getPath(), newPath);

        // assert: child node locked, before save
        assertTrue("Child node locked before save", testNode2.isLocked());
        session.save();
View Full Code Here

        node.addNode("target");
        session.save();

        session.refresh(true);
        Node sourceNode = session.getNode("/source/node");
        session.move("/source/node", "/target/moved");
        // assertEquals("/target/moved", sourceNode.getPath());  // passes on JR2, fails on Oak
        try {
            sourceNode.getPath();
        }
        catch (InvalidItemStateException expected) {
View Full Code Here

        Session session = getAdminSession();
        session.getRootNode().addNode("new");
        session.save();

        Node n = session.getNode("/new");
        session.move("/new", "/moved");

        assertEquals("/moved", n.getPath());
    }

    @Test
View Full Code Here

    public void moveNewNode() throws RepositoryException {
        Session session = getAdminSession();
        session.getRootNode().addNode("new");

        Node n = session.getNode("/new");
        session.move("/new", "/moved");

        assertEquals("/moved", n.getPath());
    }

    @Test
View Full Code Here

        session.getRootNode().addNode("parent").addNode("new");
        session.save();

        Node p = session.getNode("/parent");
        Node n = session.getNode("/parent/new");
        session.move("/parent", "/moved");

        assertEquals("/moved", p.getPath());
        assertEquals("/moved/new", n.getPath());
    }
View Full Code Here

    public void moveNewNodeParent() throws RepositoryException {
        Session session = getAdminSession();
        session.getRootNode().addNode("parent").addNode("new");

        Node n = session.getNode("/parent/new");
        session.move("/parent", "/moved");

        assertEquals("/moved/new", n.getPath());
    }

    @Test
View Full Code Here

        node.addNode("target");
        session.save();

        session.refresh(true);
        Node sourceNode = session.getNode("/source/node");
        session.move("/source/node", "/target/moved");
        // assertEquals("/target/moved", sourceNode.getPath());  // passes on JR2, fails on Oak
        try {
            sourceNode.getPath();
        }
        catch (InvalidItemStateException expected) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.