Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-513

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.1
    • test
    • None

    Description

      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 + }

      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            dpitfiel David Pitfield
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: