Examples of holdsLock()


Examples of javax.jcr.Node.holdsLock()

        Node ln2 = (Node) otherSession.getItem(lockedNode.getPath());

        lockedNode.unlock();

        assertFalse("Node is not locked any more", ln2.isLocked());
        assertFalse("Node is not locked any more", ln2.holdsLock());
        try {
            ln2.getLock();
            fail("Node is not locked any more");
        } catch (LockException e) {
            // OK
View Full Code Here

Examples of javax.jcr.Node.holdsLock()

            // remove lock implicit by logout lock-holding session
            other.logout();

            // check if superuser session is properly informed about the unlock
            assertFalse(n.isLocked());
            assertFalse(n.holdsLock());
            try {
                n.getLock();
                fail("Upon logout of the session a session-scoped lock must be gone.");
            } catch (LockException e) {
                // ok
View Full Code Here

Examples of javax.jcr.Node.holdsLock()

    /**
     * @see javax.jcr.lock.LockManager#holdsLock(String)
     */
    public boolean holdsLock(String absPath) throws RepositoryException {
        Node n = itemManager.getNode(resolver.getQPath(absPath));
        return n.holdsLock();
    }

    /**
     * @see javax.jcr.lock.LockManager#lock(String, boolean, boolean, long, String)
     */
 
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()

    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()

            // remove lock implicit by logout lock-holding session
            other.logout();

            // check if superuser session is properly informed about the unlock
            assertFalse(n.isLocked());
            assertFalse(n.holdsLock());
            try {
                n.getLock();
                fail("Upon logout of the session a session-scoped lock must be gone.");
            } catch (LockException e) {
                // ok
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
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.