Package javax.jcr

Examples of javax.jcr.Node.unlock()


            } catch (LockException e) {
                // success
            }

            // unlock to remove node at tearDown()
            node2.unlock();
        } finally {
            session2.logout();
        }
    }
View Full Code Here


                workspace.copy(node1.getPath(), dstAbsPath);
                fail("LockException was expected.");
            } catch (LockException e) {
                // successful
            } finally {
                lockTarget.unlock();
            }
        } finally {
            otherSession.logout();
        }
    }
View Full Code Here

                workspace.move(node1.getPath(), dstAbsPath);
                fail("LockException was expected.");
            } catch (LockException e) {
                // successful
            } finally {
                lockTarget.unlock();
            }
        } finally {
            otherSession.logout();
        }
    }
View Full Code Here

        testNode.lock(false, true);
        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

            assertFalse("Node.canAddMixin(String mixinName) must return false " +
                    "if the node is locked.",
                    node.canAddMixin(mixinName));

            node2.unlock();
        } finally {
            session2.logout();
        }
    }
View Full Code Here

            } catch (LockException e) {
                // success
            }

            // unlock to remove node at tearDown()
            node2.unlock();
        } finally {
            session2.logout();
        }
    }
View Full Code Here

            } catch (LockException e) {
                // success
            }

            // unlock to remove node at tearDown()
            node2.unlock();
        } finally {
            session2.logout();
        }
    }
View Full Code Here

        String lockOwnerPath = testRoot + "/" + nodeName1 + "/" + jcrLockOwner;
        assertTrue("No event created for jcr:lockOwner", paths.contains(lockOwnerPath));
        String lockIsDeepPath = testRoot + "/" + nodeName1 + "/" + jcrlockIsDeep;
        assertTrue("No event created for jcr:lockIsDeep", paths.contains(lockIsDeepPath));

        lockable.unlock();
    }

    /**
     * Tests if unlocking a node triggers property removed events for the
     * properties jcr:lockOwner and jcr:lockIsDeep.
View Full Code Here

        // lock the node
        lockable.lock(false, true);

        EventResult result = new EventResult(log);
        addEventListener(result, Event.PROPERTY_REMOVED);
        lockable.unlock();
        removeEventListener(result);

        Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
        assertEquals("Wrong number of events.", 2, events.length);
        for (int i = 0; i < events.length; i++) {
View Full Code Here

            fail("Query.storeAsNode() must throw LockException, parent node is locked.");
        } catch (LockException e) {
            // expected behaviour
        } finally {
            readWrite.logout();
            lockable.unlock();
        }
    }

    /**
     * Tests if the a {@link javax.jcr.RepositoryException} is thrown when
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.