Hi Sergey,

Sergey Kabashnyuk wrote:
Hi all.
I have some  questions about jackrabbit-jcr-tests.

First I want to ask about value constrains for boolean properties.
JCR -170 in section 6.7.16 Value Constraints is not paid due
attention to this moment, what can be interpreted as "implementation
can decide to support it or not", we decide not to implement this
feature as it seems it makes no sense but we could not pass the
following tests.

Could you move those tests from jackrabbit-jcr-tests to JR specific tests?

SetValueConstraintViolationExceptionTest.testBooleanProperty
SetValueConstraintViolationExceptionTest.testMultipleBooleanProperty
SetPropertyConstraintViolationExceptionTest.testBooleanProperty

reporting constraint information is option. that is, you may return null on PropertyDefinition.getValueConstraints(). in that case the tests should not yield a failure.

The next one is about test for "6.4.4 Escaping of Values"
in document view xml mapping. It AbstractImportXmlTest you have two
variables
     protected static final String encodedAttributeValue =
"Hello_x0009_&_x0009_GoodBye";
     protected static final String decodedAttributeValue =
"Hello\\t&\\tGoodBye";
Looks like the decodedAttributeValue is a decoded version of
encodedAttributeValue what is actually not.
It should be
   protected static final String decodedAttributeValue =
"Hello\t&\tGoodBye";

The other interesting place is in
DocumentViewImportTest.checkImportSimpleXMLTree() method
  This condition is very strange
// both possibilities
if (!propVal.equals(encodedAttributeValue)  ||
!propVal.equals(encodedAttributeValue)) {
    fail("");
}
may be it means something like  that?
// both possibilities
if (!propVal.equals(decodedAttributeValue)   ||
propVal.equals(encodedAttributeValue)) {
    fail("");
}

yes, I think you are right. this is because an implementation may treat the attribute as multi or single valued.

I've created a jira issue: https://issues.apache.org/jira/browse/JCR-1497

regards
 marcel

Reply via email to