use of org.apache.jackrabbit.spi.QValue in project jackrabbit by apache.
the class QValueTest method testReferenceValueType.
public void testReferenceValueType() throws RepositoryException {
QValue v = factory.create(REFERENCE, PropertyType.REFERENCE);
assertTrue("Type of a date value must be PropertyType.REFERENCE.", v.getType() == PropertyType.REFERENCE);
}
use of org.apache.jackrabbit.spi.QValue in project jackrabbit by apache.
the class QValueTest method testEqualityDifferentTypes3.
public void testEqualityDifferentTypes3() throws RepositoryException {
QValue v = factory.create(URI_STRING, PropertyType.URI);
QValue v2 = factory.create(URI_STRING, PropertyType.STRING);
assertFalse(v.equals(v2));
}
use of org.apache.jackrabbit.spi.QValue in project jackrabbit by apache.
the class QValueTest method testUriValueEquality.
public void testUriValueEquality() throws RepositoryException, URISyntaxException {
QValue v = factory.create(URI_STRING, PropertyType.URI);
QValue otherV = factory.create(URI_STRING, PropertyType.URI);
assertEquals("Uri values created from the same string must be equal.", v, otherV);
URI uri = new URI(URI_STRING);
v = factory.create(uri);
assertEquals("Uri values created from the same string must be equal.", v, otherV);
}
use of org.apache.jackrabbit.spi.QValue in project jackrabbit by apache.
the class QValueTest method testGetLongOnBooleanValue.
public void testGetLongOnBooleanValue() throws RepositoryException {
try {
QValue v = factory.create(true);
v.getLong();
fail("'true' cannot be converted to a valid long value.");
} catch (ValueFormatException e) {
// ok
}
}
use of org.apache.jackrabbit.spi.QValue in project jackrabbit by apache.
the class ValueFormatTest method testGetPathQValue.
/**
* Path values must never be normalized.
*
* @throws RepositoryException
*/
public void testGetPathQValue() throws RepositoryException {
List<String> l = new ArrayList<String>();
// a non-normalized absolute path
l.add("/a/.././b/c/.");
// an identifier based path
l.add("[" + UUID.randomUUID().toString() + "]");
for (String jcrPath : l) {
QValue qv = ValueFormat.getQValue(jcrPath, PropertyType.PATH, resolver, qvFactory);
assertFalse(qv.getPath().isNormalized());
assertEquals("Path values must not be normalized", jcrPath, ValueFormat.getJCRValue(qv, resolver, vFactory).getString());
}
}
Aggregations