jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r577845 - in /jackrabbit/branches/1.3: jackrabbit-core/applications/test/repositoryStubImpl.properties jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyAssumeTypeTest.java
Date Thu, 20 Sep 2007 18:10:53 GMT
Author: jukka
Date: Thu Sep 20 11:10:52 2007
New Revision: 577845

URL: http://svn.apache.org/viewvc?rev=577845&view=rev
Log:
1.3: Merged revision 566247 (JCR-811)

Modified:
    jackrabbit/branches/1.3/jackrabbit-core/applications/test/repositoryStubImpl.properties
    jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyAssumeTypeTest.java

Modified: jackrabbit/branches/1.3/jackrabbit-core/applications/test/repositoryStubImpl.properties
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-core/applications/test/repositoryStubImpl.properties?rev=577845&r1=577844&r2=577845&view=diff
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-core/applications/test/repositoryStubImpl.properties
(original)
+++ jackrabbit/branches/1.3/jackrabbit-core/applications/test/repositoryStubImpl.properties
Thu Sep 20 11:10:52 2007
@@ -116,6 +116,12 @@
 javax.jcr.tck.SetValueValueFormatExceptionTest.testBoolean.propertyname1=Date
 javax.jcr.tck.SetValueValueFormatExceptionTest.testNode.propertyname1=Boolean
 
+# Test class: SetPropertyAssumeTypeTest
+javax.jcr.tck.SetPropertyAssumeTypeTest.nodetype=test:canSetProperty
+javax.jcr.tck.SetPropertyAssumeTypeTest.testStringConstraintViolationExceptionBecauseOfInvalidTypeParameter.propertyname1=String
+javax.jcr.tck.SetPropertyAssumeTypeTest.testValueConstraintViolationExceptionBecauseOfInvalidTypeParameter.propertyname1=String
+javax.jcr.tck.SetPropertyAssumeTypeTest.testValuesConstraintViolationExceptionBecauseOfInvalidTypeParameter.propertyname1=StringMultiple
+
 # Test class: UndefinedPropertyTest
 javax.jcr.tck.UndefinedPropertyTest.testroot=/testdata
 

Modified: jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyAssumeTypeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyAssumeTypeTest.java?rev=577845&r1=577844&r2=577845&view=diff
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyAssumeTypeTest.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetPropertyAssumeTypeTest.java
Thu Sep 20 11:10:52 2007
@@ -68,6 +68,7 @@
 
     public void setUp() throws Exception {
         super.setUp();
+        testNode = testRootNode.addNode(nodeName1, testNodeType);
 
         binaryValue = NodeTypeUtil.getValueOfType(superuser, PropertyType.BINARY);
         booleanValue = NodeTypeUtil.getValueOfType(superuser, PropertyType.BOOLEAN);
@@ -432,24 +433,11 @@
     public void testValueConstraintViolationExceptionBecauseOfInvalidTypeParameter()
         throws NotExecutableException, RepositoryException {
 
-        // locate a property definition of type string
-        PropertyDefinition propDef =
-                NodeTypeUtil.locatePropertyDef(superuser, PropertyType.STRING, false, false,
false, false);
-
-        if (propDef == null) {
-            throw new NotExecutableException("No testable property has been found.");
-        }
-
-        // create a node of type propDef.getDeclaringNodeType()
-        String nodeType = propDef.getDeclaringNodeType().getName();
-        Node testNode = testRootNode.addNode(nodeName1, nodeType);
-        String testPropName = propDef.getName();
-
         try {
             Calendar cal = Calendar.getInstance();
             cal.setTime(new Date(0));
             Value v = superuser.getValueFactory().createValue(ISO8601.format(cal));
-            testNode.setProperty(testPropName, v, PropertyType.DATE);
+            testNode.setProperty(propertyName1, v, PropertyType.DATE);
             testRootNode.save();
             fail("Node.setProperty(String, Value, int) must throw a " +
                  "ConstraintViolationExcpetion if the type parameter and the " +
@@ -469,23 +457,10 @@
     public void testStringConstraintViolationExceptionBecauseOfInvalidTypeParameter()
         throws NotExecutableException, RepositoryException {
 
-        // locate a property definition of type string
-        PropertyDefinition propDef =
-                NodeTypeUtil.locatePropertyDef(superuser, PropertyType.STRING, false, false,
false, false);
-
-        if (propDef == null) {
-            throw new NotExecutableException("No testable property has been found.");
-        }
-
-        // create a node of type propDef.getDeclaringNodeType()
-        String nodeType = propDef.getDeclaringNodeType().getName();
-        Node testNode = testRootNode.addNode(nodeName1, nodeType);
-        String testPropName = propDef.getName();
-
         try {
             Calendar cal = Calendar.getInstance();
             cal.setTime(new Date(0));
-            testNode.setProperty(testPropName, ISO8601.format(cal), PropertyType.DATE);
+            testNode.setProperty(propertyName1, ISO8601.format(cal), PropertyType.DATE);
             testRootNode.save();
             fail("Node.setProperty(String, Value, int) must throw a " +
                  "ConstraintViolationExcpetion if the type parameter and the " +
@@ -505,21 +480,8 @@
     public void testValuesConstraintViolationExceptionBecauseOfInvalidTypeParameter()
         throws NotExecutableException, RepositoryException {
 
-        // locate a property definition of type string
-        PropertyDefinition propDef =
-                NodeTypeUtil.locatePropertyDef(superuser, PropertyType.STRING, true, false,
false, false);
-
-        if (propDef == null) {
-            throw new NotExecutableException("No testable property has been found.");
-        }
-
-        // create a node of type propDef.getDeclaringNodeType()
-        String nodeType = propDef.getDeclaringNodeType().getName();
-        Node testNode = testRootNode.addNode(nodeName1, nodeType);
-        String testPropName = propDef.getName();
-
         try {
-            testNode.setProperty(testPropName, stringValues, PropertyType.DATE);
+            testNode.setProperty(propertyName1, stringValues, PropertyType.DATE);
             testRootNode.save();
             fail("Node.setProperty(String, Value, int) must throw a " +
                     "ConstraintViolationExcpetion or a ValueFormatException if " +



Mime
View raw message