use of io.vertx.core.json.pointer.JsonPointer in project vert.x by eclipse.
the class JsonPointerTest method testURIParsing.
@Test
public void testURIParsing() {
JsonPointer pointer = JsonPointer.fromURI(URI.create("http://www.example.org#/hello/world"));
assertEquals("/hello/world", pointer.toString());
assertEquals(URI.create("http://www.example.org#/hello/world"), pointer.toURI());
}
use of io.vertx.core.json.pointer.JsonPointer in project vert.x by eclipse.
the class JsonPointerTest method testEmptyBuilding.
@Test
public void testEmptyBuilding() {
JsonPointer pointer = JsonPointer.create();
assertEquals("", pointer.toString());
assertEquals(URI.create("#"), pointer.toURI());
}
use of io.vertx.core.json.pointer.JsonPointer in project vert.x by eclipse.
the class JsonPointerTest method testRootPointerWrite.
@Test
public void testRootPointerWrite() {
JsonPointer pointer = JsonPointer.create();
JsonObject obj = new JsonObject();
JsonArray arr = new JsonArray();
assertSame(arr, pointer.writeJson(obj, arr, false));
}
use of io.vertx.core.json.pointer.JsonPointer in project vert.x by eclipse.
the class JsonPointerTest method testURIBuilding.
@Test
public void testURIBuilding() {
JsonPointer pointer = JsonPointer.create().append("hello").append("world");
assertEquals(URI.create("#/hello/world"), pointer.toURI());
}
use of io.vertx.core.json.pointer.JsonPointer in project vert.x by eclipse.
the class JsonPointerTest method testIsParentDifferentURI.
@Test
public void testIsParentDifferentURI() {
JsonPointer parent = JsonPointer.fromURI(URI.create("yaml/valid/refs/Circular.yaml#/properties"));
JsonPointer child = JsonPointer.fromURI(URI.create("json/valid/refs/Circular.yaml#/properties/parent"));
assertFalse(parent.isParent(child));
assertFalse(child.isParent(parent));
}
Aggregations