use of org.apache.jena.atlas.json.JsonValue in project jena by apache.
the class ActionBackupList method perform.
@Override
protected void perform(HttpAction action) {
JsonValue result = description(action);
ServletOps.setNoCache(action.response);
ServletOps.sendJsonReponse(action, result);
}
use of org.apache.jena.atlas.json.JsonValue in project jena by apache.
the class TestAdmin method execSleepTask.
private static String execSleepTask(String name, int millis) {
String url = ServerCtl.urlRoot() + "$/sleep";
if (name != null) {
if (name.startsWith("/"))
name = name.substring(1);
url = url + "/" + name;
}
JsonResponseHandler x = new JsonResponseHandler();
HttpOp.execHttpPost(url + "?interval=" + millis, null, WebContent.contentTypeJSON, x);
JsonValue v = x.getJSON();
String id = v.getAsObject().get("taskId").getAsString().value();
return id;
}
use of org.apache.jena.atlas.json.JsonValue in project jena by apache.
the class TestAdmin method checkTask.
private static void checkTask(String x) {
String url = ServerCtl.urlRoot() + "$/tasks/" + x;
JsonValue v = httpGetJson(url);
checkTask(v);
}
use of org.apache.jena.atlas.json.JsonValue in project jena by apache.
the class TestAdmin method server_1.
// --- Server status
@Test
public void server_1() {
JsonValue jv = httpGetJson(ServerCtl.urlRoot() + "$/" + opServer);
JsonObject obj = jv.getAsObject();
// Now optional : assertTrue(obj.hasKey(JsonConst.admin)) ;
assertTrue(obj.hasKey(JsonConst.datasets));
assertTrue(obj.hasKey(JsonConst.uptime));
assertTrue(obj.hasKey(JsonConst.startDT));
}
use of org.apache.jena.atlas.json.JsonValue in project jena by apache.
the class TestAdmin method getDatasetDescription.
private static JsonValue getDatasetDescription(String dsName) {
try (TypedInputStream in = execHttpGet(ServerCtl.urlRoot() + "$/" + opDatasets + "/" + dsName)) {
assertEqualsIgnoreCase(WebContent.contentTypeJSON, in.getContentType());
JsonValue v = JSON.parse(in);
return v;
}
}
Aggregations