public void shouldBeAbleToCreateAndExecuteJcrSql2QueryToFindAllCarsUnderHybrid() throws RepositoryException {
String sql = "SELECT car.[car:maker], car.[car:model], car.[car:year], car.[car:msrp], car.[jcr:path] FROM [car:Car] AS car WHERE PATH(car) LIKE '%/Hybrid/%' ORDER BY [car:model]";
Query query = session.getWorkspace().getQueryManager().createQuery(sql, Query.JCR_SQL2);
QueryResult result = query.execute();
String[] columnNames = {"car:maker", "car:model", "car:year", "car:msrp", "jcr:path"};
validateQuery().rowCount(3).hasColumns(columnNames).onEachRow(new Predicate() {
@Override
public void validate( int rowNumber,
Row row ) throws RepositoryException {
if (rowNumber == 1) {
assertThat(row.getValue("car:model").getString(), is("Altima"));