Package javax.jcr

Examples of javax.jcr.Session.refresh()


            // assert: child node locked, after save
            assertTrue("Child node locked after save", childNode.isLocked());

        } finally {
            session.refresh(false);
            childNode.unlock();
        }
    }

    /**
 
View Full Code Here


                fail("Node.setPrimaryType(String) must throw ConstraintViolationException if the specified node type name refers to a mixin.");
            } catch (ConstraintViolationException e) {
                // success
            } finally {
                // reset the changes.
                session.refresh(false);
            }
        }
    }

    /**
 
View Full Code Here

                    fail("Node.setPrimaryType(String) must throw ConstraintViolationException if the specified node type name refers to an abstract node type.");
                } catch (ConstraintViolationException e) {
                    // success
                } finally {
                    // reset the changes.
                    session.refresh(false);
                }
            }
        }
    }
View Full Code Here

            s.save();
            fail("Missing write privilege.");
        } catch (AccessDeniedException e) {
            // success
        } finally {
            s.refresh(false);
        }

        // with simple write privilege moving a node is not allowed.
        modifyPrivileges(parentPath, Privilege.JCR_WRITE, true);
        try {
View Full Code Here

            s.save();
            fail("Missing privilege jcr:nodeTypeManagement.");
        } catch (AccessDeniedException e) {
            // success
        } finally {
            s.refresh(false);
        }

        // adding jcr:nodeTypeManagement privilege will grant permission to move.
        modifyPrivileges(parentPath, PrivilegeRegistry.REP_WRITE, true);
        s.importXML(parentPath, getXmlForImport(), ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
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

            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

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.