Package javax.jcr

Examples of javax.jcr.Node.save()


     */
    public void testRemove() throws Exception {
        try {
            Node vHistoryParent = vHistory.getParent();
            vHistory.remove();
            vHistoryParent.save();
            fail("VersionHistory should be read-only: VersionHistory.remove() did not throw a ConstraintViolationException");
        } catch (ConstraintViolationException success) {
        }
    }

View Full Code Here


            Node n = (Node) s.getItem(n1.getPath());
            n.addNode(nodeName3, ntBase);
            n = (Node) s.getItem(n2.getPath());
            n.addNode(nodeName3, nodetype2);
            n = (Node) s.getItem(testRoot);
            n.save();
        } finally {
            s.logout();
        }
        obsMgr.removeEventListener(listener);
        Event[] events = listener.getEvents(DEFAULT_WAIT_TIMEOUT);
View Full Code Here

        testNode.addMixin(mixLockable);
        testRootNode.save();

        // lock and check-in
        testNode.lock(false, true);
        testNode.save();
        testNode.checkin();

        // do the unlock
        testNode.unlock();
        assertFalse("Could not unlock a locked, checked-in node", testNode.holdsLock());
View Full Code Here

        // add a node
        Node testNode = defaultRootNode.addNode(nodeName1, testNodeType);

        try {
            // try to call save on newly created node
            testNode.save();
            fail("Calling Node.save() on a newly created node should throw RepositoryException");
        } catch (RepositoryException e) {
            // ok, works as expected.
        }
    }
View Full Code Here

        // create a node
        Node newNode = defaultRootNode.addNode(nodeName1, testNodeType);

        try {
            newNode.save();
            fail("Calling Node.save() on a newly added node should throw a RepositoryException");
        } catch (RepositoryException success) {
            // ok
        }
    }
View Full Code Here

        node.checkin();

        try {
            property.setValue(referenceableNode);
            node.save();
            fail("Property.setValue(Node) must throw a VersionException " +
                 "immediately or on save if the parent node of this property " +
                 "is checked-in.");
        }
        catch (VersionException e) {
View Full Code Here

        // test of signature setValue(InputStream value)
        InputStream in = valueNotSatisfied1.getStream();
        try {
            prop.setValue(in);
            node.save();
            fail("setValue(InputStream value) must throw a ConstraintViolationException " +
                    "if the change would violate a node type constraint " +
                    "either immediately or on save");
        } catch (ConstraintViolationException e) {
            // success
View Full Code Here

        }

        // test of signature setValue(Value value)
        try {
            prop.setValue(valueNotSatisfied2);
            node.save();
            fail("setValue(Value value) must throw a ConstraintViolationException " +
                    "if the change would violate a node type constraint " +
                    "either immediately or on save");
        } catch (ConstraintViolationException e) {
            // success
View Full Code Here

        }

        // test of signature setValue(boolean value)
        try {
            prop.setValue(valueNotSatisfied.getBoolean());
            node.save();
            fail("setValue(boolean value) must throw a ConstraintViolationException " +
                    "if the change would violate a node type constraint " +
                    "either immediately or on save");
        } catch (ConstraintViolationException e) {
            // success
View Full Code Here

        }

        // test of signature setValue(Value value)
        try {
            prop.setValue(valueNotSatisfied);
            node.save();
            fail("setValue(Value value) must throw a ConstraintViolationException " +
                    "if the change would violate a node type constraint " +
                    "either immediately or on save");
        } catch (ConstraintViolationException e) {
            // success
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.