use of org.apache.jena.atlas.json.JsonValue in project jena by apache.
the class TestAdmin method checkInTasks.
private static void checkInTasks(String x) {
String url = ServerCtl.urlRoot() + "$/tasks";
JsonValue v = httpGetJson(url);
assertTrue(v.isArray());
JsonArray array = v.getAsArray();
int found = 0;
for (int i = 0; i < array.size(); i++) {
JsonValue jv = array.get(i);
assertTrue(jv.isObject());
JsonObject obj = jv.getAsObject();
checkTask(obj);
if (obj.get("taskId").getAsString().value().equals(x)) {
found++;
}
}
assertEquals("Occurence of taskId count", 1, found);
}
use of org.apache.jena.atlas.json.JsonValue in project jena by apache.
the class TestAdmin method stats_2.
@Test
public void stats_2() {
addTestDataset();
JsonValue v = execGetJSON(ServerCtl.urlRoot() + "$/" + opStats + ServerCtl.datasetPath());
checkJsonStatsAll(v);
deleteDataset(dsTest);
}
use of org.apache.jena.atlas.json.JsonValue in project jena by apache.
the class TestAdmin method list_datasets_2.
@Test
public void list_datasets_2() {
try (TypedInputStream in = execHttpGet(ServerCtl.urlRoot() + "$/" + opDatasets)) {
assertEqualsIgnoreCase(WebContent.contentTypeJSON, in.getContentType());
JsonValue v = JSON.parseAny(in);
assertNotNull(v.getAsObject().get("datasets"));
checkJsonDatasetsAll(v);
}
}
use of org.apache.jena.atlas.json.JsonValue in project jena by apache.
the class TestAdmin method stats_1.
// ---- Backup
// ---- Server
// ---- Stats
@Test
public void stats_1() {
JsonValue v = execGetJSON(ServerCtl.urlRoot() + "$/" + opStats);
checkJsonStatsAll(v);
}
use of org.apache.jena.atlas.json.JsonValue in project jena by apache.
the class TestAdmin method checkJsonStatsAll.
private static void checkJsonStatsAll(JsonValue v) {
assertNotNull(v.getAsObject().get("datasets"));
JsonObject a = v.getAsObject().get("datasets").getAsObject();
for (String dsname : a.keys()) {
JsonValue obj = a.get(dsname).getAsObject();
checkJsonStatsOne(obj);
}
}
Aggregations