use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class GetMapEntryRequestTest method testGetMapEntry.
@Test
public void testGetMapEntry() throws Exception {
GetMapEntryRequest request = new GetMapEntryRequest("string", "map", "key");
IMap<String, String> map = hz.getMap("map");
map.put("key", "value");
JsonObject jsonObject = new JsonObject();
request.writeResponse(managementCenterService, jsonObject);
JsonObject result = (JsonObject) jsonObject.get("result");
assertEquals("value", result.get("browse_value").asString());
assertEquals("java.lang.String", result.get("browse_class").asString());
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class MapConfigRequestTest method testUpdateMapConfig.
@Test
public void testUpdateMapConfig() {
MapConfigRequest request = new MapConfigRequest(mapName, dto, true);
JsonObject jsonObject = new JsonObject();
request.writeResponse(managementCenterService, jsonObject);
JsonObject result = (JsonObject) jsonObject.get("result");
assertEquals("success", request.readResponse(result));
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class LocalWanPublisherStatsImpl method toJson.
@Override
public JsonObject toJson() {
JsonObject root = new JsonObject();
root.add("isConnected", connected);
root.add("totalPublishLatencies", totalPublishLatency);
root.add("totalPublishedEventCount", totalPublishedEventCount);
root.add("outboundQueueSize", outboundQueueSize);
root.add("paused", paused);
return root;
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class LocalWanStatsImpl method fromJson.
@Override
public void fromJson(JsonObject json) {
for (JsonObject.Member next : json) {
LocalWanPublisherStats localPublisherStats = new LocalWanPublisherStatsImpl();
localPublisherStats.fromJson(next.getValue().asObject());
localPublisherStatsMap.put(next.getName(), localPublisherStats);
}
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class MemberPartitionStateImpl method toJson.
@Override
public JsonObject toJson() {
JsonObject root = new JsonObject();
JsonArray partitionsArray = new JsonArray();
for (Integer lsPartition : partitions) {
partitionsArray.add(lsPartition);
}
root.add("partitions", partitionsArray);
root.add("memberStateSafe", memberStateSafe);
root.add("migrationQueueSize", migrationQueueSize);
return root;
}
Aggregations