use of javax.jcr.query.qom.PropertyValue in project jackrabbit by apache.
the class QueryObjectModelFactoryTest method testOrderingDescending.
/**
* Test case for {@link QueryObjectModelFactory#descending(DynamicOperand)}
*/
public void testOrderingDescending() throws RepositoryException {
PropertyValue op = qf.propertyValue(SELECTOR_NAME1, propertyName1);
Ordering desc = qf.descending(op);
assertEquals("Ordering.getOrder() must return QueryObjectModelConstants.ORDER_DESCENDING", QueryObjectModelConstants.JCR_ORDER_DESCENDING, desc.getOrder());
assertTrue("Not a PropertyValue operand", desc.getOperand() instanceof PropertyValue);
}
use of javax.jcr.query.qom.PropertyValue in project jackrabbit by apache.
the class QueryObjectModelFactoryTest method testUpperCase.
/**
* Test case for {@link QueryObjectModelFactory#upperCase(DynamicOperand)}
*/
public void testUpperCase() throws RepositoryException {
PropertyValue propValue = qf.propertyValue(SELECTOR_NAME1, propertyName1);
UpperCase upper = qf.upperCase(propValue);
assertTrue("Not a property value operand", upper.getOperand() instanceof PropertyValue);
}
use of javax.jcr.query.qom.PropertyValue in project jackrabbit by apache.
the class QueryObjectModelFactoryTest method testLength.
/**
* Test case for {@link QueryObjectModelFactory#length(PropertyValue)}
*/
public void testLength() throws RepositoryException {
PropertyValue propValue = qf.propertyValue(SELECTOR_NAME1, propertyName1);
Length len = qf.length(propValue);
assertNotNull("Property value must not be null", len.getPropertyValue());
}
use of javax.jcr.query.qom.PropertyValue in project jackrabbit-oak by apache.
the class QomTest method propertyValue.
@Test
public void propertyValue() throws RepositoryException {
PropertyValue pv = f.propertyValue("selectorName", "propertyName");
assertEquals("selectorName", pv.getSelectorName());
assertEquals("propertyName", pv.getPropertyName());
assertEquals("[selectorName].[propertyName]", pv.toString());
assertEquals("*", f.propertyValue(null, null).toString());
assertEquals("[s].*", f.propertyValue("s", null).toString());
assertEquals("[p]", f.propertyValue(null, "p").toString());
assertEquals("[s].[p]", f.propertyValue("s", "p").toString());
}
use of javax.jcr.query.qom.PropertyValue in project jackrabbit-oak by apache.
the class QomTest method lowerCase.
@Test
public void lowerCase() throws RepositoryException {
PropertyValue p = f.propertyValue("selectorName", "propertyName");
Length length = f.length(p);
LowerCase l = f.lowerCase(length);
assertEquals(length, l.getOperand());
assertEquals("LOWER(LENGTH([selectorName].[propertyName]))", l.toString());
}
Aggregations