use of org.apache.jena.sparql.expr.aggregate.AggSum in project jena by apache.
the class SelectHandlerTest method testAddStringWithPrefixVar.
@Test
public void testAddStringWithPrefixVar() {
query.setPrefix("xsd", "http://www.w3.org/2001/XMLSchema#");
Var v = Var.alloc("foo");
handler.addVar("sum(xsd:integer(?V3))", 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 contain an AggSum", ((ExprAggregator) e).getAggregator() instanceof AggSum);
}
Aggregations