Package javax.jcr

Examples of javax.jcr.Session.refresh()


        Node node = getNode(TEST_PATH);
        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


            assertFalse(session2.itemExists("/node1"));
            assertFalse(session2.itemExists("/node1/node2"));
            assertFalse(session2.itemExists("/node1/node3"));
            assertFalse(session2.itemExists("/node1/node3/property1"));

            session2.refresh(false);
            assertTrue(session2.itemExists("/node1"));
            assertTrue(session2.itemExists("/node1/node2"));
            assertTrue(session2.itemExists("/node1/node3"));
            assertTrue(session2.itemExists("/node1/node3/property1"));
        }
View Full Code Here

            Item property1 = session.getProperty("/node1/node3/property1");
            assertFalse(property1.isNode());
            assertEquals("value1", ((Property) property1).getString());

            // Make sure these items are still accessible after refresh(true);
            session.refresh(true);
            assertTrue(session.itemExists("/node1"));
            assertTrue(session.itemExists("/node1/node2"));
            assertTrue(session.itemExists("/node1/node3"));
            assertTrue(session.itemExists("/node1/node3/property1"));
View Full Code Here

            assertTrue(session.itemExists("/node1"));
            assertTrue(session.itemExists("/node1/node2"));
            assertTrue(session.itemExists("/node1/node3"));
            assertTrue(session.itemExists("/node1/node3/property1"));

            session.refresh(false);
            // Make sure these items are not accessible after refresh(false);
            assertFalse(session.itemExists("/node1"));
            assertFalse(session.itemExists("/node1/node2"));
            assertFalse(session.itemExists("/node1/node3"));
            assertFalse(session.itemExists("/node1/node3/property1"));
View Full Code Here

            session1.save();
            assertTrue(session1.getRootNode().hasNode("node"));
            assertTrue(session2.getRootNode().hasNode("node"));

            session2.refresh(true);
            assertTrue(session1.getRootNode().hasNode("node"));
            assertTrue(session2.getRootNode().hasNode("node"));

            session2.save();
            assertTrue(session1.getRootNode().hasNode("node"));
View Full Code Here

        // Move must not be visible in session
        assertTrue(node.hasNode("source/node"));
        assertFalse(node.hasNode("target/moved"));

        session.refresh(false);

        // Move must be visible in session after refresh
        assertFalse(node.hasNode("source/node"));
        assertTrue(node.hasNode("source"));
        assertTrue(node.hasNode("target/moved"));
View Full Code Here

        // Copy must not be visible in session
        assertTrue(node.hasNode("source/node"));
        assertFalse(node.hasNode("target/copied"));

        session.refresh(false);

        // Copy must be visible in session after refresh
        assertTrue(node.hasNode("source/node"));
        assertTrue(node.hasNode("target/copied"));
    }
View Full Code Here

            } catch (AccessControlException e) {
                // success
            }

            // latest after refresh privilege manager must be updated
            s2.refresh(true);
            Privilege priv = pm.getPrivilege(privName);
            assertEquals(privName, priv.getName());
            assertEquals(isAbstract, priv.isAbstract());
            assertFalse(priv.isAggregate());
        } finally {
View Full Code Here

            session1.save();
            assertTrue(session1.getRootNode().hasNode("node"));
            assertTrue(session2.getRootNode().hasNode("node"));

            session2.refresh(true);
            assertTrue(session1.getRootNode().hasNode("node"));
            assertTrue(session2.getRootNode().hasNode("node"));

            try {
                session2.save();
View Full Code Here

        Node node = getNode(TEST_PATH);
        Node source = node.addNode("source").addNode("node");
        node.addNode("target");
        session.save();

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

        assertFalse(node.hasNode("source/node"));
        assertTrue(node.hasNode("source"));
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.