Package javax.jcr

Examples of javax.jcr.Session.nodeExists()


        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


        /* allow READ/WRITE privilege for testUser at 'childPath' */
        givePrivileges(childNPath, testUser.getPrincipal(), privileges, getRestrictions(superuser, path));

        Session testSession = getTestSession();

        assertTrue(testSession.nodeExists(childNPath));
        assertTrue(testSession.hasPermission(childNPath, Session.ACTION_REMOVE));

        Node n = testSession.getNode(childNPath);

        // removing the child node must succeed as both remove-node and
View Full Code Here

                privilegesFromNames(new String[] {Privilege.JCR_READ}),
                getRestrictions(superuser, path));

        Session testSession = getTestSession();

        assertTrue(testSession.nodeExists(childNPath));
        assertTrue(testSession.hasPermission(childNPath, Session.ACTION_REMOVE));

        Node n = testSession.getNode(childNPath);

        // removing the child node must succeed as both remove-node and
View Full Code Here

                privileges,
                getRestrictions(superuser, path));

        Session testSession = getTestSession();

        assertTrue(testSession.nodeExists(childNPath));
        assertTrue(testSession.hasPermission(childNPath, Session.ACTION_REMOVE));

        Node n = testSession.getNode(childNPath);

        // removing the child node must fail as a hidden child node cannot
View Full Code Here

            session2.logout();
        }

        Session session3 = createAnonymousSession();
        try {
            assertFalse(session3.nodeExists(TEST_PATH + "/newNode"));
            assertFalse(session3.getNode(TEST_PATH).isModified());
        } finally {
            session3.logout();
        }
    }
View Full Code Here

        Session session3 = createAdminSession();
        try {
            session1.getRootNode().addNode("newNode");
            session1.save();
            assertTrue(session2.nodeExists("/newNode"));
            assertTrue(session3.nodeExists("/newNode"));
        } finally {
            session1.logout();
            session2.logout();
            session3.logout();
        }
View Full Code Here

        Node foo = parent.addNode("foo");
        session.save();

        ((JackrabbitNode) foo).rename("renamed");
        assertEquals("renamed", foo.getName());
        assertFalse(session.nodeExists("/parent/foo"));
        assertTrue(session.nodeExists("/parent/renamed"));
    }

    @Test(expected = RepositoryException.class)
    public void moveToDescendant() throws RepositoryException {
View Full Code Here

        session.save();

        ((JackrabbitNode) foo).rename("renamed");
        assertEquals("renamed", foo.getName());
        assertFalse(session.nodeExists("/parent/foo"));
        assertTrue(session.nodeExists("/parent/renamed"));
    }

    @Test(expected = RepositoryException.class)
    public void moveToDescendant() throws RepositoryException {
        Session session = getAdminSession();
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

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.