use of org.apache.jackrabbit.spi.QValue in project jackrabbit by apache.
the class QValueTest method testDateValueEquality2.
public void testDateValueEquality2() throws RepositoryException {
QValue v = factory.create(CALENDAR);
QValue otherV = factory.create(v.getString(), PropertyType.DATE);
assertEquals("Equality of date value must be calculated based on their String representation.", v, otherV);
}
use of org.apache.jackrabbit.spi.QValue in project jackrabbit by apache.
the class QValueTest method testEmptyBinaryFromByteArray.
public void testEmptyBinaryFromByteArray() throws RepositoryException, IOException {
QValue v = factory.create(new byte[0]);
assertEquals(PropertyType.BINARY, v.getType());
assertEquals(0, v.getLength());
assertEquals("", v.getString());
ByteArrayOutputStream out = new ByteArrayOutputStream();
spool(out, v.getStream());
assertEquals("", new String(out.toByteArray()));
}
use of org.apache.jackrabbit.spi.QValue in project jackrabbit by apache.
the class QValueTest method testEqualityDifferentTypes2.
public void testEqualityDifferentTypes2() throws RepositoryException {
QValue v = factory.create(REFERENCE, PropertyType.WEAKREFERENCE);
QValue v2 = factory.create(REFERENCE, PropertyType.STRING);
assertFalse(v.equals(v2));
}
use of org.apache.jackrabbit.spi.QValue in project jackrabbit by apache.
the class QValueTest method testCreateTrueFromString.
public void testCreateTrueFromString() throws ValueFormatException, RepositoryException {
QValue v = factory.create(Boolean.TRUE.toString(), PropertyType.STRING);
assertEquals("Boolean value must be true", true, v.getBoolean());
}
use of org.apache.jackrabbit.spi.QValue in project jackrabbit by apache.
the class PathConstraintTest method createNonMatchingValues.
protected QValue[] createNonMatchingValues() throws RepositoryException {
QValue root = valueFactory.create(resolver.getQPath("/"));
QValue abs = valueFactory.create(resolver.getQPath("/uvw/xyz"));
QValue rel = valueFactory.create(resolver.getQPath("uvw/xyz"));
return new QValue[] { abs, abs, rel, root, abs };
}
Aggregations