use of org.apache.jena.sparql.algebra.op.OpService in project jena by apache.
the class TestServiceSetup method testNumericTimeout.
@Test
public void testNumericTimeout() {
BasicPattern basicPattern = new BasicPattern();
basicPattern.add(Triple.ANY);
Node serviceNode = NodeFactory.createURI(SERVICE);
OpService opService = new OpService(serviceNode, new OpBGP(basicPattern), false);
Context context = new Context();
ARQ.setNormalMode(context);
context.set(Service.httpQueryTimeout, 10);
try {
Service.exec(opService, context);
Assert.fail("Expected QueryExceptionHTTP");
} catch (QueryExceptionHTTP expected) {
Throwable thrown = expected.getCause();
if (thrown instanceof SocketException || thrown instanceof HttpConnectTimeoutException || thrown instanceof UnknownHostException) {
// expected
} else {
Assert.fail(String.format("Expected SocketException or ConnectTimeoutException, instead got: %s %s", thrown.getClass().getName(), thrown.getMessage()));
}
}
}
use of org.apache.jena.sparql.algebra.op.OpService in project jena by apache.
the class OpRewriter method visit.
@Override
public void visit(OpService opService) {
opService.getSubOp().visit(this);
push(new OpService(changeNode(opService.getService()), pop(), opService.getSilent()));
}
Aggregations