use of org.apache.jackrabbit.spi.QValue in project jackrabbit by apache.
the class QValueTest method testPathValueEquality.
public void testPathValueEquality() throws IOException, RepositoryException {
QValue v = factory.create(ROOT_PATH);
QValue v2 = factory.create(ROOT_PATH.toString(), PropertyType.PATH);
assertTrue(v.equals(v2));
}
use of org.apache.jackrabbit.spi.QValue in project jackrabbit by apache.
the class QValueTest method testDateValueEquality.
public void testDateValueEquality() throws RepositoryException {
QValue v = factory.create(CALENDAR);
QValue otherV = factory.create(CALENDAR);
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 testDateValueStringRepresentation.
public void testDateValueStringRepresentation() throws RepositoryException {
QValue v = factory.create(CALENDAR);
String s = ISO8601.format(CALENDAR);
assertEquals("Expected String representation of date value to be ISO8601 compliant.", s, v.getString());
}
use of org.apache.jackrabbit.spi.QValue in project jackrabbit by apache.
the class QValueTest method testReferenceValueEquality.
public void testReferenceValueEquality() throws RepositoryException {
QValue v = factory.create(REFERENCE, PropertyType.REFERENCE);
QValue otherV = factory.create(REFERENCE, PropertyType.REFERENCE);
assertEquals("Reference 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 testBinaryFromFile.
public void testBinaryFromFile() throws RepositoryException, IOException {
File f = File.createTempFile("QValueFactoryImplTest", ".txt");
f.deleteOnExit();
FileWriter fw = new FileWriter(f);
fw.write("abc");
fw.close();
QValue v = factory.create(f);
assertEquals(PropertyType.BINARY, v.getType());
assertEquals(3, v.getLength());
assertEquals("abc", v.getString());
ByteArrayOutputStream out = new ByteArrayOutputStream();
spool(out, v.getStream());
assertEquals("abc", new String(out.toByteArray()));
}
Aggregations