use of org.apache.jena.fuseki.server.DataService in project jena by apache.
the class TestEmbeddedFuseki method embedded_21.
@Test
public void embedded_21() {
DatasetGraph dsg = dataset();
int port = FusekiLib.choosePort();
DataService dSrv = new DataService(dsg);
dSrv.addEndpoint(OperationName.Query, "q");
dSrv.addEndpoint(OperationName.GSP_R, "gsp");
FusekiEmbeddedServer server = FusekiEmbeddedServer.create().add("/dsrv1", dSrv).setStaticFileBase(DIR).setPort(port).build();
server.start();
try {
query("http://localhost:" + port + "/dsrv1/q", "ASK{}", x -> {
});
String x1 = HttpOp.execHttpGetString("http://localhost:" + port + "/dsrv1/gsp");
assertNotNull(x1);
// Static
String x2 = HttpOp.execHttpGetString("http://localhost:" + port + "/test.txt");
assertNotNull(x2);
} finally {
server.stop();
}
}
Aggregations