TCK: SetPropertyAssumeTypeTest doesn't allow ValueFormatException upon type 
conversion failure
----------------------------------------------------------------------------------------------

                 Key: JCR-513
                 URL: http://issues.apache.org/jira/browse/JCR-513
             Project: Jackrabbit
          Issue Type: Bug
          Components: test
            Reporter: David Pitfield


SetPropertyAssumeTypeTest# 
testValuesConstraintVioloationExceptionBecauseOfInvalidTypeParameter

This test should allow an implementation to throw ValueFormatException.  In 
Section 7.1.5, the Javadoc for setProperty(String, Value[] int) states: "If the 
property type of the supplied Value objects is different from that specified, 
then a best-effort conversion is attempted. If the conversion fails, a 
ValueFormatException is thrown."

Proposal: catch and consume ValueFormatException.

--- SetPropertyAssumeTypeTest.java      (revision 422074)
+++ SetPropertyAssumeTypeTest.java      (working copy)
@@ -28,6 +28,7 @@
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
 import javax.jcr.Property;
+import javax.jcr.ValueFormatException;
 import java.util.Calendar;
 import java.util.Date;
  
@@ -525,6 +526,9 @@
         catch (ConstraintViolationException e) {
             // success
         }
+        catch (ValueFormatException e) {
+            // success
+        }
     }


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to