Package javax.jcr.retention

Examples of javax.jcr.retention.Hold


                // by a hold on the node itself, by a hold on the parent or
                // by a deep hold on any ancestor.
                return true;
            } else {
                for (Iterator it = holds.iterator(); it.hasNext();) {
                    Hold h = (Hold) it.next();
                    if (h.isDeep()) {
                        return true;
                    }
                }
            }
        }
View Full Code Here


                // by a hold on the node itself, by a hold on the parent or
                // by a deep hold on any ancestor.
                return true;
            } else {
                for (Iterator it = holds.iterator(); it.hasNext();) {
                    Hold h = (Hold) it.next();
                    if (h.isDeep()) {
                        return true;
                    }
                }
            }
        }
View Full Code Here

        }
        return false;
    }

    public void testAddHold() throws RepositoryException, NotExecutableException {
        Hold hold = retentionMgr.addHold(testNodePath, getHoldName(), false);
        Hold[] holds = retentionMgr.getHolds(testNodePath);
        assertTrue("getHolds must return the hold added before.", holds.length >= 1);
        assertTrue("getHolds doesn't return the hold added before", containsHold(holds, hold));
    }
View Full Code Here

        assertTrue("getHolds doesn't return the hold added before", containsHold(holds, hold));
    }

    public void testAddHold2() throws RepositoryException, NotExecutableException {
        Hold[] holdsBefore = retentionMgr.getHolds(testNodePath);
        Hold hold = retentionMgr.addHold(testNodePath, getHoldName(), false);
        assertFalse("The hold added must not have been present before.", containsHold(holdsBefore, hold));
    }
View Full Code Here

        Hold hold = retentionMgr.addHold(testNodePath, getHoldName(), false);
        assertFalse("The hold added must not have been present before.", containsHold(holdsBefore, hold));
    }

    public void testAddHoldIsTransient() throws RepositoryException, NotExecutableException {
        Hold hold = retentionMgr.addHold(testNodePath, getHoldName(), false);
        Hold[] holds = retentionMgr.getHolds(testNodePath);

        // revert the changes made
        superuser.refresh(false);
        Hold[] holds2 = retentionMgr.getHolds(testNodePath);
View Full Code Here

        assertFalse("Reverting transient changes must revert the hold added.",
                containsHold(holds2, hold));
    }
   
    public void testRemoveHold() throws RepositoryException, NotExecutableException {
        Hold hold = retentionMgr.addHold(testNodePath, getHoldName(), false);

        Hold[] holds = retentionMgr.getHolds(testNodePath);

        retentionMgr.removeHold(testNodePath, hold);
        Hold[] holds2 = retentionMgr.getHolds(testNodePath);
View Full Code Here

        assertFalse("RetentionManager.removeHold should removed the hold added before.",
                containsHold(holds2, hold));
    }

    public void testRemoveHoldIsTransient() throws RepositoryException, NotExecutableException {
        Hold hold = retentionMgr.addHold(testNodePath, getHoldName(), false);
        superuser.save();
        try {
            Hold[] holds = retentionMgr.getHolds(testNodePath);

            retentionMgr.removeHold(testNodePath, hold);
View Full Code Here

        }
    }

    public void testRemoveHoldFromChild() throws RepositoryException, NotExecutableException {
        String childPath = testRootNode.addNode(nodeName2, testNodeType).getPath();
        Hold hold = retentionMgr.addHold(testNodePath, getHoldName(), false);

        try {
            retentionMgr.removeHold(childPath, hold);
            fail("Removing hold from another node must fail");
        } catch (RepositoryException e) {
View Full Code Here

            fail("Adding a hold at an invalid path must throw RepositoryException.");
        } catch (RepositoryException e) {
            // success
        }
        try {
            Hold h = retentionMgr.addHold(testNodePath, getHoldName(), true);
            retentionMgr.removeHold(invalidPath, h);
            fail("Removing a hold at an invalid path must throw RepositoryException.");
        } catch (RepositoryException e) {
            // success
        }
View Full Code Here

            fail("Adding a hold for a non-existing node must throw PathNotFoundException.");
        } catch (PathNotFoundException e) {
            // success
        }
        try {
            Hold h = retentionMgr.addHold(testNodePath, getHoldName(), true);
            retentionMgr.removeHold(invalidPath, h);
            fail("Removing a hold at a non-existing node must throw PathNotFoundException.");
        } catch (PathNotFoundException e) {
            // success
        }
View Full Code Here

TOP

Related Classes of javax.jcr.retention.Hold

Copyright © 2018 www.massapicom. 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.