Package javax.jcr

Examples of javax.jcr.Session.nodeExists()


         allow READ privilege for group at 'childNPath'
         */
        givePrivileges(path, group, privileges, getRestrictions(superuser, childNPath));

        Session testSession = getTestSession();
        assertFalse(testSession.nodeExists(childNPath));
    }

    public void testAllowGroupPathDenyUserChildPath() throws Exception {
        Privilege[] privileges = privilegesFromName(Privilege.JCR_READ);
        Principal group = getTestGroup().getPrincipal();
View Full Code Here


        deny READ privilege for testUser at 'childNPath'
        */
        withdrawPrivileges(path, testUser.getPrincipal(), privileges, getRestrictions(superuser, childNPath));

        Session testSession = getTestSession();
        assertFalse(testSession.nodeExists(childNPath));
    }

    public void testGlobRestriction() throws Exception {
        Session testSession = getTestSession();
        AccessControlManager testAcMgr = getTestACManager();
View Full Code Here

        givePrivileges(childNPath, testUser.getPrincipal(), privileges, getRestrictions(superuser, childNPath));


        Session testSession = getTestSession();

        assertFalse(testSession.nodeExists(path));

        // reading the node and it's definition must succeed.
        assertTrue(testSession.nodeExists(childNPath));
        Node n = testSession.getNode(childNPath);
View Full Code Here

        Session testSession = getTestSession();

        assertFalse(testSession.nodeExists(path));

        // reading the node and it's definition must succeed.
        assertTrue(testSession.nodeExists(childNPath));
        Node n = testSession.getNode(childNPath);

        n.addNode("someChild");
        n.save();
    }
View Full Code Here

    @Test
    public void addNode() throws RepositoryException {
        Session session = getAdminSession();
        String newNode = TEST_PATH + "/new";
        assertFalse(session.nodeExists(newNode));

        Node node = getNode(TEST_PATH);
        Node added = node.addNode("new");
        assertFalse(node.isNew());
        assertTrue(node.isModified());
View Full Code Here

        assertFalse(added.isModified());
        session.save();

        Session session2 = createAnonymousSession();
        try {
            assertTrue(session2.nodeExists(newNode));
            added = session2.getNode(newNode);
            assertFalse(added.isNew());
            assertFalse(added.isModified());
        } finally {
            session2.logout();
View Full Code Here

    public void addNodeWithSpecialChars() throws RepositoryException {
        Session session = getAdminSession();
        String nodeName = "foo{";

        String newNode = TEST_PATH + '/' + nodeName;
        assertFalse(session.nodeExists(newNode));

        Node node = getNode(TEST_PATH);
        node.addNode(nodeName);
        session.save();
View Full Code Here

        node.addNode(nodeName);
        session.save();

        Session session2 = createAnonymousSession();
        try {
            assertTrue(session2.nodeExists(newNode));
        } finally {
            session2.logout();
        }
    }
View Full Code Here

        try {
            VersionManager vm = session.getWorkspace().getVersionManager();

            // make sure that 'testNode' does not exist at the beginning
            // of the test
            while (session.nodeExists("/testNode")) {
                session.getNode("/testNode").remove();
                session.save();
            }

            // 1) create 'testNode' that has a child and a grandchild
View Full Code Here

        givePrivileges(childNPath, testUser.getPrincipal(), privileges, getRestrictions(superuser, childNPath));


        Session testSession = getTestSession();

        assertFalse(testSession.nodeExists(path));

        // reading the node and it's definition must succeed.
        assertTrue(testSession.nodeExists(childNPath));
        Node n = testSession.getNode(childNPath);
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.