Package javax.jcr

Examples of javax.jcr.Session.nodeExists()


    public void expandedName() throws RepositoryException {
        Session session = getAdminSession();
        session.setNamespacePrefix("foo", "http://example.com/");
        session.getRootNode().addNode("{0} test");
        session.save();
        assertTrue(session.nodeExists("/{0} test"));
    }

    @Test
    public void testGetDefinitionWithSNS() throws RepositoryException, IOException {
        Session session = getAdminSession();
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

            }

            // ... must not be present in the alternate-workspace
            UserManager umgr = ((JackrabbitSession) s).getUserManager();
            assertNull(umgr.getAuthorizable("testUser"));
            assertFalse(s.nodeExists(userPath));

            String clonePath = userPath;
            String parentPath = Text.getRelativeParent(clonePath, 1);
            while (!s.nodeExists(parentPath)) {
                clonePath = parentPath;
View Full Code Here

            assertNull(umgr.getAuthorizable("testUser"));
            assertFalse(s.nodeExists(userPath));

            String clonePath = userPath;
            String parentPath = Text.getRelativeParent(clonePath, 1);
            while (!s.nodeExists(parentPath)) {
                clonePath = parentPath;
                parentPath = Text.getRelativeParent(parentPath, 1);
            }

            // clone the user into the second workspace
View Full Code Here

            s.getWorkspace().clone(superuser.getWorkspace().getName(), clonePath, clonePath, true);

            // ... now the user must be visible
            assertNotNull(umgr.getAuthorizable("testUser"));
            if (userPath != null) {
                assertTrue(s.nodeExists(userPath));               
            }
            // ... and able to login to that workspace
            Session us = getHelper().getRepository().login(new SimpleCredentials("testUser", "testUser".toCharArray()), altWsp);
            us.logout();
View Full Code Here

            }

            // ... must not be present in the alternate-workspace
            UserManager umgr = ((JackrabbitSession) s).getUserManager();
            assertNull(umgr.getAuthorizable("testUser"));
            assertFalse(s.nodeExists(userPath));

            User u2 = umgr.createUser("testUser", "testUser");
            s.save();
            assertTrue(s.nodeExists(userPath));
View Full Code Here

            assertNull(umgr.getAuthorizable("testUser"));
            assertFalse(s.nodeExists(userPath));

            User u2 = umgr.createUser("testUser", "testUser");
            s.save();
            assertTrue(s.nodeExists(userPath));

            Value value = superuser.getValueFactory().createValue("anyValue");
            u.setProperty(propertyName1, value);
            superuser.save();
View Full Code Here

            s2 = getHelper().getSuperuserSession();

            admin = userMgr.getAuthorizable(adminId);
            assertNotNull(admin);
            // the colliding node must have been removed.
            assertFalse(s2.nodeExists(collidingPath));

        } finally {
            if (s2 != null) {
                s2.logout();
            }
View Full Code Here

            s2 = getHelper().getSuperuserSession();

            admin = userMgr.getAuthorizable(adminId);
            assertNotNull(admin);
            // the colliding node must have been removed.
            assertFalse(s2.nodeExists(collidingPath));

        } finally {
            if (s2 != null) {
                s2.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.