Package javax.jcr

Examples of javax.jcr.Node.unlock()


            workspaceW2.clone(workspace.getName(), node1.getPath(), dstAbsPath, true);
            fail("LockException was expected.");
        } catch (LockException e) {
            // successful
        } finally {
            lockTarget.unlock();
        }
    }
}
View Full Code Here


            workspaceW2.copy(workspace.getName(), node1.getPath(), dstAbsPath);
            fail("LockException was expected.");
        } catch (LockException e) {
            // successful
        } finally {
            lockTarget.unlock();
        }
    }

}
View Full Code Here

        lock = otherNode.getLock();

        // assert: session must hold lock token
        assertTrue("session must hold lock token", containsLockToken(other, lock.getLockToken()));       
       
        otherNode.unlock();
       
        assertFalse("Node is locked", otherNode.isLocked());
       
        otherNode.remove();
        other.save();
View Full Code Here

        lock = otherNode.getLock();

        // assert: session must hold lock token
        assertTrue("session must hold lock token", containsLockToken(superuser, lockToken));       
       
        otherNode.unlock();
       
        assertFalse("Node is locked", otherNode.isLocked());
       
        otherNode.remove();
        superuser.save();
View Full Code Here

        superuser.addLockToken(lockToken);
       
        // assert: session must not hold lock token
        assertTrue("session must hold lock token", containsLockToken(superuser, lockToken));

        n.unlock();
       
        // commit
        utx.commit();
    }
View Full Code Here

            lock = otherNode.getLock();

            // assert: session must hold lock token
            assertTrue("session must hold lock token", containsLockToken(other, lock.getLockToken()));

            otherNode.unlock();

            assertFalse("Node is locked", otherNode.isLocked());

            otherNode.setProperty(propertyName1, "foo");
            other.save();
View Full Code Here

        // verify node is locked
        assertTrue("Node locked", n.isLocked());

        // unlock node
        n.unlock();

        // commit
        utx.commit();

        // verify node is not locked
View Full Code Here

        // verify lock is live
        assertTrue("Lock live", lock.isLive());

        // unlock
        n.unlock();

        // verify lock is no longer live
        assertFalse("Lock not live", lock.isLive());

        // rollback
View Full Code Here

            // verify that the lock properties are present
            assertTrue(n.hasProperty(jcrLockOwner));
            assertTrue(n.hasProperty(jcrlockIsDeep));

            // unlock
            n.unlock();

            // verify that the lock properties have been removed.
            assertFalse(n.hasProperty(jcrLockOwner));
            assertFalse(n.hasProperty(jcrlockIsDeep));
View Full Code Here

            // verify lock is live again -> properties must be present
            assertTrue(n.hasProperty(jcrLockOwner));
            assertTrue(n.hasProperty(jcrlockIsDeep));
        } finally {
            n.unlock();
        }
    }

    /**
     * Test visibility of lock properties by another session.
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.