public void testCreateQueryFromSourceWithConstraintAndOrdering() throws RepositoryException {
Source selector = qomFactory.selector(testNodeType);
PropertyExistence propExist = qomFactory.propertyExistence(propertyName1);
PropertyValue propValue = qomFactory.propertyValue(propertyName1);
Ordering ordering = qomFactory.ascending(propValue);
QueryObjectModel qom = qomFactory.createQuery(selector, propExist,
new Ordering[]{ordering}, null);
assertTrue("Not a selector source", qom.getSource() instanceof Selector);
assertTrue("Not a property existence constraint", qom.getConstraint() instanceof PropertyExistence);
assertEquals("Wrong size of orderings", 1, qom.getOrderings().length);
assertEquals("Wrong size of columns", 0, qom.getColumns().length);
}