Search in sources :

Example 1 with JsonPathCursor

use of com.hazelcast.query.impl.getters.JsonPathCursor in project hazelcast by hazelcast.

the class AbstractJsonSchemaTest method validateJsonLiteral.

protected void validateJsonLiteral(JsonValue expectedValue, String originalString, JsonPattern expectedPattern, JsonSchemaNode description, NavigableJsonInputAdapter input, String path) throws IOException {
    JsonPathCursor pathArray = splitPath(path);
    JsonPattern pattern = JsonSchemaHelper.createPattern(input, description, pathArray);
    String failureString = String.format("Path ( %s ) failed on ( %s )", path, originalString);
    assertEquals(failureString, expectedPattern, pattern);
    pathArray.reset();
    input.reset();
    JsonValue foundValue = JsonSchemaHelper.findValueWithPattern(input, description, pattern, pathArray);
    assertEquals(failureString, expectedValue, foundValue);
}
Also used : JsonPathCursor(com.hazelcast.query.impl.getters.JsonPathCursor) JsonValue(com.hazelcast.internal.json.JsonValue) HazelcastJsonValue(com.hazelcast.core.HazelcastJsonValue)

Aggregations

HazelcastJsonValue (com.hazelcast.core.HazelcastJsonValue)1 JsonValue (com.hazelcast.internal.json.JsonValue)1 JsonPathCursor (com.hazelcast.query.impl.getters.JsonPathCursor)1