Package javax.jcr

Examples of javax.jcr.Node.refresh()


        String destPath = destParentNode.getPath() + "/" + nodeName2;
        superuser.move(srcPath, destPath);
        superuser.save();

        try {
            refNode2.refresh(true);
            Node parent = refNode2.getParent();
        } catch (InvalidItemStateException e) {
        }

        assertItemStatus(refNode2, Status.REMOVED);
View Full Code Here


        // remove the node
        defaultRootNode.remove();

        try {
            testNode.refresh(true);
            fail("Calling Node.refresh() on deleted node should throw InvalidItemStateException!");
        } catch (InvalidItemStateException e) {
            // ok, works as expected
        }
    }
View Full Code Here

        String srcPath = moveNode.getPath();
        doMove(srcPath, destinationPath);
        Node afterMoveNode = (Node) testRootNode.getSession().getItem(destinationPath);

        try {
            afterMoveNode.refresh(false);
            fail("Node.refresh() on a transiently moved node should fail such as a 'save' would fail.");
        } catch (RepositoryException e) {
            // ok: works as expected. scope of 'refresh' is not complete
        }
    }
View Full Code Here

            childNode.remove();
            superuser.save();

            // try to remove already removed node with session 2
            try {
                childNode2.refresh(false);
                childNode2.remove();
                otherSession.save();
                fail("Removing a node already removed by other session should throw an InvalidItemStateException!");
            } catch (InvalidItemStateException e) {
                //ok, works as expected
View Full Code Here

        // complete transaction
        utx.commit();

        // unlock must now be visible to other session
        n2.refresh(false);
        assertFalse(lock2.isLive());
        assertFalse(n2.isLocked());
        assertFalse(n2.hasProperty(jcrLockOwner));
        assertFalse(n2.hasProperty(jcrlockIsDeep));
    }
View Full Code Here

        // complete transaction
        utx.commit();

        // unlock must now be visible to other session
        n2.refresh(false);
        assertFalse(lock2.isLive());
        assertFalse(n2.isLocked());
        assertFalse(n2.hasProperty(jcrLockOwner));
        assertFalse(n2.hasProperty(jcrlockIsDeep));
    }
View Full Code Here

        session.move(from, to);
        try {
            if (save) {
                node2.save();
            } else {
                node2.refresh(false);
            }
            fail("Refresh and Save should not work for moved nodes");
        } catch (RepositoryException e) {
            // expected
        }
View Full Code Here

                        if (autoSave) {
                            node.getSession().save();
                        }
                    } catch (RepositoryException e) {
                        // we ignore this as this folder might be created from a different task
                        node.refresh(false);
                    }
                }
                node = node.getNode(token);
            }
            path = path.substring(pos + 1);
View Full Code Here

        // complete transaction
        utx.commit();

        // unlock must now be visible to other session
        n2.refresh(false);
        assertFalse(lock2.isLive());
        assertFalse(n2.isLocked());
        assertFalse(n2.hasProperty(jcrLockOwner));
        assertFalse(n2.hasProperty(jcrlockIsDeep));
    }
View Full Code Here

        session.move(from, to);
        try {
            if (save) {
                node2.save();
            } else {
                node2.refresh(false);
            }
            fail("Refresh and Save should not work for moved nodes");
        } catch (RepositoryException e) {
            // 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.