use of org.apache.jena.arq.querybuilder.handlers.SolutionModifierHandler in project jena by apache.
the class SolutionModifierHandlerTest method testAddAll.
@Test
public void testAddAll() throws ParseException {
SolutionModifierHandler solutionModifier2 = new SolutionModifierHandler(new Query());
solutionModifier2.addOrderBy(Var.alloc("orderBy"));
solutionModifier2.addGroupBy(Var.alloc("groupBy"));
solutionModifier2.addHaving("?having<10");
solutionModifier2.setLimit(500);
solutionModifier2.setOffset(200);
solutionModifier.addAll(solutionModifier2);
String[] s = byLine(query.toString());
assertContainsRegex(GROUP_BY + var("groupBy"), s);
assertContainsRegex(HAVING + OPEN_PAREN + var("having") + OPT_SPACE + LT + OPT_SPACE + "10" + CLOSE_PAREN, s);
assertContainsRegex(ORDER_BY + var("orderBy"), s);
assertContainsRegex(LIMIT + "500", s);
assertContainsRegex(OFFSET + "200", s);
}
use of org.apache.jena.arq.querybuilder.handlers.SolutionModifierHandler in project jena by apache.
the class SolutionModifierHandlerTest method setup.
@Before
public void setup() {
query = new Query();
solutionModifier = new SolutionModifierHandler(query);
}
Aggregations