Package javax.jcr

Examples of javax.jcr.Node.refresh()


        superuser.move(refNode.getPath(), destParentNode.getPath() + "/" + nodeName2);
        superuser.save();

        try {
            refNode2.refresh(true);
            Node parent = refNode2.getParent();
            if (parent.isSame(testSession.getItem(destParentNode.getPath()))) {
                // node has been automatically moved to new place
                assertItemStatus(refNode2, Status.EXISTING);
            } else {
View Full Code Here


        superuser.move(refNode.getPath(), destParentNode.getPath() + "/" + nodeName2);
        superuser.save();

        try {
            refNode2.refresh(true);
            Node parent = refNode2.getParent();
            if (parent.isSame(testSession.getItem(destParentNode.getPath()))) {
                // node has been automatically moved to new place
                assertItemStatus(refNode2, Status.EXISTING_MODIFIED);
            } else if (!isItemStatus(refNode2, Status.EXISTING_MODIFIED)) {
View Full Code Here

        testSession.getItem(destParentNode.getPath() + "/" + nodeName2);

        assertItemStatus(refNode2, Status.STALE_DESTROYED);
        try {
            refNode2.refresh(false);
            fail();
        } catch (InvalidItemStateException e) {
            // correct behaviour
        }
    }
View Full Code Here

        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

        try {
            Node otherNode = (Node) otherSession.getItem(srcPath);

            testRootNode.getSession().getWorkspace().move(srcPath, destPath);

            otherNode.refresh(false);
            try {
                assertTrue(n.isSame(otherNode));
            } catch (InvalidItemStateException e) {
                // ok as well.
            }
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

        // 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

        // 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

           for (int i = 0; i < threads.length; i++) {
               threads[i].join();
           }
          
           //Node folderNode = repo.getAreaNode(RulesRepository.RULE_PACKAGE_AREA);
           folderNode.refresh(true);
           NodeIterator results = folderNode.getNodes("testConcurrentCopyPackage2");
           assertEquals(1, results.getSize());
       }        }

      class ConcurrentCopySession implements Runnable {
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

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.