use of javax.jcr.query.qom.Ordering in project jackrabbit by apache.
the class QueryObjectModelFactoryTest method testOrderingAscending.
/**
* Test case for {@link QueryObjectModelFactory#ascending(DynamicOperand)}
*/
public void testOrderingAscending() throws RepositoryException {
PropertyValue op = qf.propertyValue(SELECTOR_NAME1, propertyName1);
Ordering asc = qf.ascending(op);
assertEquals("Ordering.getOrder() must return QueryObjectModelConstants.ORDER_ASCENDING", QueryObjectModelConstants.JCR_ORDER_ASCENDING, asc.getOrder());
assertTrue("Not a PropertyValue operand", asc.getOperand() instanceof PropertyValue);
}
use of javax.jcr.query.qom.Ordering in project jackrabbit-oak by apache.
the class QomTest method descending.
@Test
public void descending() throws RepositoryException {
PropertyValue p = f.propertyValue("selectorName", "propertyName");
Ordering o = f.descending(p);
assertEquals(p, o.getOperand());
assertEquals(QueryObjectModelConstants.JCR_ORDER_DESCENDING, o.getOrder());
assertEquals("[selectorName].[propertyName] DESC", o.toString());
}
use of javax.jcr.query.qom.Ordering in project jackrabbit-oak by apache.
the class QomTest method ascending.
@Test
public void ascending() throws RepositoryException {
PropertyValue p = f.propertyValue("selectorName", "propertyName");
Ordering o = f.ascending(p);
assertEquals(p, o.getOperand());
assertEquals(QueryObjectModelConstants.JCR_ORDER_ASCENDING, o.getOrder());
assertEquals("[selectorName].[propertyName]", p.toString());
}
Aggregations