Package javax.jcr.retention

Examples of javax.jcr.retention.RetentionPolicy


    /**
     * Creates a node with a RetentionPolicy
     */
    private void addRetentionTestData(Node node) throws RepositoryException {
        RetentionPolicy rp = RetentionPolicyImpl.createRetentionPolicy("testRetentionPolicy", node.getSession());
        node.getSession().getRetentionManager().setRetentionPolicy(node.getPath(), rp);
    }
View Full Code Here


    protected void tearDown() throws Exception {
        if (otherS != null) {
            otherS.logout();
        }
        superuser.refresh(false);
        RetentionPolicy rp = retentionMgr.getRetentionPolicy(testNodePath);
        if (rp != null) {
            retentionMgr.removeRetentionPolicy(testNodePath);
            superuser.save();
        }
        super.tearDown();
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();

        // make sure there is no retention policy defined at testNodePath.
        RetentionPolicy p = retentionMgr.getRetentionPolicy(testNodePath);
        if (p != null) {
            retentionMgr.removeRetentionPolicy(testNodePath);
            superuser.save();
        }
    }
View Full Code Here

    }
   
    public void testGetRetentionPolicy() throws RepositoryException, NotExecutableException {
        retentionMgr.setRetentionPolicy(testNodePath, getApplicableRetentionPolicy());
       
        RetentionPolicy policy = retentionMgr.getRetentionPolicy(testNodePath);
        assertNotNull("RetentionManager.getRetentionPolicy must return the policy set before.", policy);
    }
View Full Code Here

        assertNull("RetentionManager.getRetentionPolicy called on child must not return the policy set before.",
                retentionMgr.getRetentionPolicy(childPath));
    }

    public void testRetentionPolicyGetName() throws RepositoryException, NotExecutableException {
        RetentionPolicy p = getApplicableRetentionPolicy();
        retentionMgr.setRetentionPolicy(testNodePath, p);

        RetentionPolicy policy = retentionMgr.getRetentionPolicy(testNodePath);
        assertEquals("RetentionPolicy.getName() must match the name of the policy set before.", p.getName(), policy.getName());
    }
View Full Code Here

        }
    }

    public void testInvalidName() {
        try {
            RetentionPolicy rp = new RetentionPolicy() {
                public String getName() throws RepositoryException {
                    return "*.[y]";
                }
            };
            retentionMgr.setRetentionPolicy(testNodePath, rp);
View Full Code Here

    /**
     * Creates a node with a RetentionPolicy
     */
    private  void addRetentionTestData(Node node) throws RepositoryException {
        RetentionPolicy rp = RetentionPolicyImpl.createRetentionPolicy("testRetentionPolicy", node.getSession());
        node.getSession().getRetentionManager().setRetentionPolicy(node.getPath(), rp);
    }
View Full Code Here

            throw new IllegalStateException("Not initialized.");
        }
        if (retentionCnt <= 0) {
            return false;
        }
        RetentionPolicy rp = null;
        PathMap.Element<RetentionPolicyImpl> element = retentionMap.map(nodePath, true);
        if (element != null) {
            rp = element.get();
        }
        if (rp == null && checkParent && (!nodePath.denotesRoot())) {
View Full Code Here

*/
public class RetentionPolicyTest extends AbstractRetentionTest {

    public void testSetInvalidRetentionPolicy() {
        try {
            RetentionPolicy invalidRPolicy = new RetentionPolicy() {
                public String getName() throws RepositoryException {
                    return "anyName";
                }
            };
            retentionMgr.setRetentionPolicy(testNodePath, invalidRPolicy);
View Full Code Here

    protected void tearDown() throws Exception {
        if (otherS != null) {
            otherS.logout();
        }
        superuser.refresh(false);
        RetentionPolicy rp = retentionMgr.getRetentionPolicy(testNodePath);
        if (rp != null) {
            retentionMgr.removeRetentionPolicy(testNodePath);
            superuser.save();
        }
        super.tearDown();
View Full Code Here

TOP

Related Classes of javax.jcr.retention.RetentionPolicy

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.