Search in sources :

Example 31 with QValue

use of org.apache.jackrabbit.spi.QValue in project jackrabbit by apache.

the class QValueTest method testPathValueType.

public void testPathValueType() throws IOException, RepositoryException {
    QValue v = factory.create(ROOT_PATH);
    assertTrue(v.getType() == PropertyType.PATH);
    v = factory.create(ROOT_PATH.toString(), PropertyType.PATH);
    assertTrue(v.getType() == PropertyType.PATH);
}
Also used : QValue(org.apache.jackrabbit.spi.QValue)

Example 32 with QValue

use of org.apache.jackrabbit.spi.QValue in project jackrabbit by apache.

the class QValueTest method testGetDecimalOnBooleanValue.

public void testGetDecimalOnBooleanValue() throws RepositoryException {
    try {
        QValue v = factory.create(true);
        v.getDecimal();
        fail("'true' cannot be converted to a valid decimal value.");
    } catch (ValueFormatException e) {
    // ok
    }
}
Also used : QValue(org.apache.jackrabbit.spi.QValue) ValueFormatException(javax.jcr.ValueFormatException)

Example 33 with QValue

use of org.apache.jackrabbit.spi.QValue in project jackrabbit by apache.

the class QValueTest method testNameValueEquality.

public void testNameValueEquality() throws IOException, RepositoryException {
    QValue v = factory.create(NameConstants.JCR_DATA);
    QValue v2 = factory.create(NameConstants.JCR_DATA.toString(), PropertyType.NAME);
    assertTrue(v.equals(v2));
}
Also used : QValue(org.apache.jackrabbit.spi.QValue)

Example 34 with QValue

use of org.apache.jackrabbit.spi.QValue in project jackrabbit by apache.

the class QValueTest method testEqualityDifferentTypes.

public void testEqualityDifferentTypes() throws RepositoryException {
    QValue v = factory.create(REFERENCE, PropertyType.REFERENCE);
    QValue v2 = factory.create(REFERENCE, PropertyType.STRING);
    assertFalse(v.equals(v2));
}
Also used : QValue(org.apache.jackrabbit.spi.QValue)

Example 35 with QValue

use of org.apache.jackrabbit.spi.QValue in project jackrabbit by apache.

the class QValueTest method testNameValueGetName.

public void testNameValueGetName() throws RepositoryException {
    QValue v = factory.create(NameConstants.JCR_DATA);
    assertTrue(v.getName().equals(NameConstants.JCR_DATA));
}
Also used : QValue(org.apache.jackrabbit.spi.QValue)

Aggregations

QValue (org.apache.jackrabbit.spi.QValue)125 Name (org.apache.jackrabbit.spi.Name)40 RepositoryException (javax.jcr.RepositoryException)23 Value (javax.jcr.Value)21 NodeId (org.apache.jackrabbit.spi.NodeId)21 Batch (org.apache.jackrabbit.spi.Batch)19 PropertyInfo (org.apache.jackrabbit.spi.PropertyInfo)18 QPropertyDefinition (org.apache.jackrabbit.spi.QPropertyDefinition)12 IOException (java.io.IOException)9 ArrayList (java.util.ArrayList)9 ByteArrayOutputStream (java.io.ByteArrayOutputStream)8 ValueFormatException (javax.jcr.ValueFormatException)8 Path (org.apache.jackrabbit.spi.Path)8 QValueConstraint (org.apache.jackrabbit.spi.QValueConstraint)8 HashMap (java.util.HashMap)7 ValueConstraint (org.apache.jackrabbit.spi.commons.nodetype.constraint.ValueConstraint)7 InputStream (java.io.InputStream)5 Node (javax.jcr.Node)5 ConstraintViolationException (javax.jcr.nodetype.ConstraintViolationException)5 PropertyId (org.apache.jackrabbit.spi.PropertyId)5