Examples of holdsLock()


Examples of javax.jcr.Node.holdsLock()

    public boolean isDeep() {
        boolean isDeep = true;
        Node n = lock.getNode();
        try {
            // find out about deepness. if node does not hold the lock its deep anyway
            if (n.holdsLock() && n.hasProperty(JcrConstants.JCR_LOCKISDEEP)) {
                isDeep = n.getProperty(JcrConstants.JCR_LOCKISDEEP).getBoolean();
            }
        } catch (RepositoryException e) {
            // ignore and keep default depth settings
        }
View Full Code Here

Examples of javax.jcr.Node.holdsLock()

        // unlock parent node
        n1.unlock();

        // child node must still hold lock
        assertTrue("child node must still hold lock", n2.holdsLock());
    }

    /**
     * Test parent/child lock
     */
 
View Full Code Here

Examples of javax.jcr.Node.holdsLock()

        testNode.save();
        testNode.checkin();

        // do the unlock
        testNode.unlock();
        assertFalse("Could not unlock a locked, checked-in node", testNode.holdsLock());
    }

    /**
     * Tests if locks are maintained when child nodes are reordered
     */
 
View Full Code Here

Examples of javax.jcr.Node.holdsLock()

    public void testLockVisibility() throws RepositoryException {
        Session otherSession = getHelper().getReadWriteSession();
        try {
            Node ln = (Node) otherSession.getItem(lockedNode.getPath());
            assertTrue("Locked node must also be locked for another session", ln.isLocked());
            assertTrue("Locked node must also be locked for another session", ln.holdsLock());
            assertTrue("Locked node must also be locked for another session", getLockManager(otherSession).holdsLock(ln.getPath()));
        } finally {
            otherSession.logout();
        }
    }
View Full Code Here

Examples of javax.jcr.Node.holdsLock()

    }

    public void testHoldsLockNewChild() throws RepositoryException {
        Node newChild = lockedNode.addNode(nodeName3, testNodeType);
        assertFalse("Child node below a locked node must never be lock holder",
                newChild.holdsLock());
        assertFalse("Child node below a locked node must never be lock holder",
                lockMgr.holdsLock(newChild.getPath()));
    }

    public void testGetLockOnChild() throws RepositoryException {
View Full Code Here

Examples of javax.jcr.Node.holdsLock()

        testNode.save();
        testNode.checkin();

        // do the unlock
        testNode.unlock();
        assertFalse("Could not unlock a locked, checked-in node", testNode.holdsLock());
    }

    /**
     * Tests if locks are maintained when child nodes are reordered
     */
 
View Full Code Here

Examples of javax.jcr.Node.holdsLock()

        // unlock parent node
        n1.unlock();

        // child node must still hold lock
        assertTrue("child node must still hold lock", n2.holdsLock());
    }

    /**
     * Test parent/child lock
     */
 
View Full Code Here

Examples of javax.jcr.Node.holdsLock()

    public boolean isDeep() {
        boolean isDeep = true;
        Node n = lock.getNode();
        try {
            // find out about deepness. if node does not hold the lock its deep anyway
            if (n.holdsLock() && n.hasProperty(JcrConstants.JCR_LOCKISDEEP)) {
                isDeep = n.getProperty(JcrConstants.JCR_LOCKISDEEP).getBoolean();
            }
        } catch (RepositoryException e) {
            // ignore and keep default depth settings
        }
View Full Code Here

Examples of javax.jcr.Node.holdsLock()

    public void testLockVisibility() throws RepositoryException {
        Session otherSession = helper.getReadWriteSession();
        try {
            Node ln = (Node) otherSession.getItem(lockedNode.getPath());
            assertTrue("Locked node must also be locked for another session", ln.isLocked());
            assertTrue("Locked node must also be locked for another session", ln.holdsLock());
            assertTrue("Locked node must also be locked for another session", getLockManager(otherSession).holdsLock(ln.getPath()));
        } finally {
            otherSession.logout();
        }
    }
View Full Code Here

Examples of javax.jcr.Node.holdsLock()

    }

    public void testHoldsLockNewChild() throws RepositoryException {
        Node newChild = lockedNode.addNode(nodeName3, testNodeType);
        assertFalse("Child node below a locked node must never be lock holder",
                newChild.holdsLock());
        assertFalse("Child node below a locked node must never be lock holder",
                lockMgr.holdsLock(newChild.getPath()));
    }

    public void testGetLockOnChild() throws RepositoryException {
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.