use of org.apache.jena.atlas.json.JsonObject in project jena by apache.
the class TestAdmin method checkJsonDatasetsOne.
private static void checkJsonDatasetsOne(JsonValue v) {
assertTrue(v.isObject());
JsonObject obj = v.getAsObject();
assertNotNull(obj.get("ds.name"));
assertNotNull(obj.get("ds.services"));
assertNotNull(obj.get("ds.state"));
assertTrue(obj.get("ds.services").isArray());
}
use of org.apache.jena.atlas.json.JsonObject 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.JsonObject in project jena by apache.
the class TestAdmin method checkJsonStatsCounters.
private static void checkJsonStatsCounters(JsonValue v) {
JsonObject obj = v.getAsObject();
assertTrue(obj.hasKey("Requests"));
assertTrue(obj.hasKey("RequestsGood"));
assertTrue(obj.hasKey("RequestsBad"));
}
use of org.apache.jena.atlas.json.JsonObject in project jena by apache.
the class TestAdmin method checkTask.
private static void checkTask(JsonValue v) {
assertNotNull(v);
assertTrue(v.isObject());
//System.out.println(v) ;
JsonObject obj = v.getAsObject();
try {
assertTrue(obj.hasKey("task"));
assertTrue(obj.hasKey("taskId"));
// Not present until it runs : "started"
} catch (AssertionError ex) {
System.out.println(obj);
throw ex;
}
}
use of org.apache.jena.atlas.json.JsonObject 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