Package javax.jcr

Examples of javax.jcr.Session.refresh()


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

        session.refresh(true);
        session.move(TEST_PATH + "/s", TEST_PATH + "/s/t");
    }

    @Test
    public void oak962() throws RepositoryException {
View Full Code Here


        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

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

            session2.refresh(false);

            // Make sure they are accessible through another session after refresh
            assertTrue(session2.itemExists("/node1"));
            assertTrue(session2.itemExists("/node1/node2"));
            assertTrue(session2.itemExists("/node1/node3"));
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

            fail();
        } catch (RepositoryException e) {
            // success
        } finally {
            if (s != null) {
                s.refresh(false);
            }
        }
    }

    public void testSessionRemoveItem()  throws RepositoryException, NotExecutableException {
View Full Code Here

            fail();
        } catch (RepositoryException e) {
            // success
        } finally {
            if (s != null) {
                s.refresh(false);
            }
        }
    }

    public void testSessionMoveAdminNode()  throws RepositoryException, NotExecutableException {
View Full Code Here

            fail();
        } catch (RepositoryException e) {
            // success
        finally {
            if (s != null) {
                s.refresh(false);
            }
        }
    }

    public void testSessionMoveParentNode()  throws RepositoryException, NotExecutableException {
View Full Code Here

            fail();
        } catch (RepositoryException e) {
            // success
        } finally {
            if (s != null) {
                s.refresh(false);
            }
        }
    }

    public void testWorkspaceMoveAdminNode()  throws RepositoryException, NotExecutableException {
View Full Code Here

                + getClass().getName(), throwable);
            htmlResponse.setError(throwable);
        } finally {
            try {
                if (session.hasPendingChanges()) {
                    session.refresh(false);
                }
            } catch (RepositoryException e) {
                log.warn("RepositoryException in finally block: {}",
                    e.getMessage(), e);
            }
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.