use of com.hazelcast.internal.json.JsonValue in project hazelcast by hazelcast.
the class Mocking_Test method mockValue.
@Test
public void mockValue() {
JsonValue jsonValue = Mockito.mock(JsonValue.class);
assertNotNull(jsonValue);
}
use of com.hazelcast.internal.json.JsonValue in project hazelcast by hazelcast.
the class JsonParser_Test method parse_doesNotFailWithManyObjects.
@Test
public void parse_doesNotFailWithManyObjects() {
JsonArray array = new JsonArray();
for (int i = 0; i < 1001; i++) {
array.add(new JsonObject().add("a", 7));
}
final String input = array.toString();
JsonValue result = parse(input);
assertTrue(result.isArray());
}
use of com.hazelcast.internal.json.JsonValue in project hazelcast by hazelcast.
the class JsonParser_Test method parse_doesNotFailWithManyArrays.
@Test
public void parse_doesNotFailWithManyArrays() {
JsonArray array = new JsonArray();
for (int i = 0; i < 1001; i++) {
array.add(new JsonArray().add(7));
}
final String input = array.toString();
JsonValue result = parse(input);
assertTrue(result.isArray());
}
use of com.hazelcast.internal.json.JsonValue in project hazelcast by hazelcast.
the class MapPredicateJsonTest method testNestedQuery_whenOneObjectMissingFirstLevelProperty.
@Test
public void testNestedQuery_whenOneObjectMissingFirstLevelProperty() {
JsonObject object1 = Json.object();
JsonObject nested1 = Json.object();
JsonObject object2 = Json.object();
JsonObject nested2 = Json.object();
nested1.add("lim", 5);
nested2.add("someotherlim", 6);
object1.add("inner", nested1);
object2.add("inner", nested2);
IMap<String, JsonValue> map = instance.getMap(randomMapName());
HazelcastJsonValue p1 = putJsonString(map, "one", object1);
HazelcastJsonValue p2 = putJsonString(map, "two", object2);
Collection<JsonValue> vals = map.values(Predicates.lessEqual("inner.lim", 6));
assertEquals(1, vals.size());
assertTrue(vals.contains(p1));
}
use of com.hazelcast.internal.json.JsonValue in project hazelcast by hazelcast.
the class MapPredicateJsonTest method testQueryOnNumberProperty.
@Test
public void testQueryOnNumberProperty() {
IMap<String, JsonValue> map = instance.getMap(randomMapName());
HazelcastJsonValue p1 = putJsonString(map, "a", 30, true);
HazelcastJsonValue p2 = putJsonString(map, "b", 20, false);
HazelcastJsonValue p3 = putJsonString(map, "c", 10, true);
Collection<JsonValue> vals = map.values(Predicates.greaterEqual("age", 20));
assertEquals(2, vals.size());
assertTrue(vals.contains(p1));
assertTrue(vals.contains(p2));
}
Aggregations