use of org.apache.jena.sparql.expr.aggregate.AggCount in project jena by apache.
the class SelectHandlerTest method testAddAggregateStringVar.
@Test
public void testAddAggregateStringVar() {
Var v = Var.alloc("foo");
handler.addVar("count(*)", v);
VarExprList expr = query.getProject();
assertEquals(1, expr.size());
Expr e = expr.getExpr(Var.alloc("foo"));
assertNotNull("expression should not be null", e);
assertTrue("Should be an ExprAggregator", e instanceof ExprAggregator);
assertTrue("Should be AggCount", ((ExprAggregator) e).getAggregator() instanceof AggCount);
}
Aggregations