Package org.apache.jackrabbit.core.util

Examples of org.apache.jackrabbit.core.util.RepositoryLock.acquire()


     *
     * @throws RepositoryException if an error occurs
     */
    public void testNoFilesLeftBehind() throws RepositoryException {
        RepositoryLock lock = new RepositoryLock(directory.getPath());
        lock.acquire();
        lock.release();
        assertEquals(
                "Some files left behind by a lock",
                0, directory.listFiles().length);
    }
View Full Code Here


    public void testTwoLocks() throws RepositoryException {
        RepositoryLock lockA = new RepositoryLock(directory.getPath());
        RepositoryLock lockB = new RepositoryLock(directory.getPath());
        lockA.acquire();
        try {
            lockB.acquire();
            fail("Can acquire an already acquired lock");
        } catch (RepositoryException e) {
        }
        lockA.release();
        try {
View Full Code Here

            fail("Can acquire an already acquired lock");
        } catch (RepositoryException e) {
        }
        lockA.release();
        try {
            lockB.acquire();
        } catch (RepositoryException e) {
            fail("Can not acquire a released lock");
        }
        lockB.release();
    }
View Full Code Here

     * @see https://issues.apache.org/jira/browse/JCR-933
     * @throws RepositoryException
     */
    public void testCanonicalPath() throws RepositoryException {
        RepositoryLock lockA = new RepositoryLock(directory.getPath());
        lockA.acquire();
        try {
            File parent = new File(directory, "..");
            RepositoryLock lockB = new RepositoryLock(
                    new File(parent, directory.getName()).getPath());
            lockB.acquire();
View Full Code Here

        lockA.acquire();
        try {
            File parent = new File(directory, "..");
            RepositoryLock lockB = new RepositoryLock(
                    new File(parent, directory.getName()).getPath());
            lockB.acquire();
            fail("Can acquire an already acquired lock using a different path");
        } catch (RepositoryException e) {
        }
        lockA.release();
    }
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.