Return-Path: Delivered-To: apmail-incubator-jackrabbit-commits-archive@www.apache.org Received: (qmail 60580 invoked from network); 1 Jul 2005 12:50:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Jul 2005 12:50:55 -0000 Received: (qmail 88396 invoked by uid 500); 1 Jul 2005 12:50:55 -0000 Mailing-List: contact jackrabbit-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jackrabbit-dev@incubator.apache.org Delivered-To: mailing list jackrabbit-commits@incubator.apache.org Received: (qmail 88383 invoked by uid 500); 1 Jul 2005 12:50:55 -0000 Delivered-To: apmail-incubator-jackrabbit-cvs@incubator.apache.org Received: (qmail 88371 invoked by uid 99); 1 Jul 2005 12:50:55 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 01 Jul 2005 05:50:55 -0700 Received: (qmail 60568 invoked by uid 65534); 1 Jul 2005 12:50:53 -0000 Message-ID: <20050701125053.60567.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r208753 - /incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java Date: Fri, 01 Jul 2005 12:50:52 -0000 To: jackrabbit-cvs@incubator.apache.org From: mreutegg@apache.org X-Mailer: svnmailer-1.0.2 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: mreutegg Date: Fri Jul 1 05:50:51 2005 New Revision: 208753 URL: http://svn.apache.org/viewcvs?rev=208753&view=rev Log: JCR-156: Review test cases and cross check with 1.0 specification - Test case testNode() might locate a NodeType with mandatory properties, apart from the reference property it is looking for. This will cause a ConstraintViolationException. NodeType as well as name for reference property is now configurable. Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java?rev=208753&r1=208752&r2=208753&view=diff ============================================================================== --- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java (original) +++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java Fri Jul 1 05:50:51 2005 @@ -18,18 +18,14 @@ import org.apache.jackrabbit.test.AbstractJCRTest; import org.apache.jackrabbit.test.NotExecutableException; -import org.apache.jackrabbit.test.api.nodetype.NodeTypeUtil; import javax.jcr.Session; import javax.jcr.Property; -import javax.jcr.PropertyType; import javax.jcr.Node; import javax.jcr.Value; import javax.jcr.Repository; import javax.jcr.RepositoryException; import javax.jcr.version.VersionException; -import javax.jcr.nodetype.PropertyDefinition; -import javax.jcr.nodetype.NodeType; import java.io.InputStream; import java.io.ByteArrayInputStream; import java.util.Calendar; @@ -261,6 +257,9 @@ /** * Tests if setValue(Node) throws a VersionException immediately * or on save if the parent node of this property is checked-in. + * @tck.config nodetype2 name of a node type with a reference property + * @tck.config propertyname3 name of a single value reference property + * declared in nodetype2 */ public void testNode() throws NotExecutableException, RepositoryException { @@ -269,14 +268,10 @@ Node referenceableNode = testRootNode.addNode(nodeName3); referenceableNode.addMixin(mixReferenceable); - // create a node with a reference property - PropertyDefinition propDef = - NodeTypeUtil.locatePropertyDef(session, PropertyType.REFERENCE, false, false, false, false); - if (propDef == null) { - throw new NotExecutableException("Failed to set up required test items."); - } - NodeType nodeType = propDef.getDeclaringNodeType(); - Node node = testRootNode.addNode(nodeName4, nodeType.getName()); + String refPropName = getProperty("propertyname3"); + String nodeType = getProperty("nodetype2"); + + Node node = testRootNode.addNode(nodeName4, nodeType); // try to make it versionable if it is not if (!node.isNodeType(mixVersionable)) { @@ -287,7 +282,7 @@ } } - Property property = node.setProperty(propDef.getName(), referenceableNode); + Property property = node.setProperty(refPropName, referenceableNode); testRootNode.save();