Package org.json.simple

Examples of org.json.simple.JSONObject


        assertFalse(mk.nodeExists("/a", null));
        assertTrue(mk.nodeExists("/c", null));

        String nodes = mk.getNodes("/c", null, 0 /*depth*/, 0 /*offset*/, -1 /*maxChildNodes*/, null /*filter*/);
        JSONObject obj = parseJSONObject(nodes);
        assertPropertyValue(obj, "key1", "value1");
    }
View Full Code Here


        assertFalse(mk.nodeExists("/a/b", null));
        assertTrue(mk.nodeExists("/c", null));
        assertTrue(mk.nodeExists("/c/b", null));

        String nodes = mk.getNodes("/c/b", null, 0 /*depth*/, 0 /*offset*/, -1 /*maxChildNodes*/, null /*filter*/);
        JSONObject obj = parseJSONObject(nodes);
        assertPropertyValue(obj, "key1", "value1");
    }
View Full Code Here

        assertFalse(mk.nodeExists("/a", null));
        assertTrue(mk.nodeExists("/b", null));
        assertTrue(mk.nodeExists("/c", null));

        String nodes = mk.getNodes("/c", null, 0 /*depth*/, 0 /*offset*/, -1 /*maxChildNodes*/, null /*filter*/);
        JSONObject obj = parseJSONObject(nodes);
        assertPropertyValue(obj, "key1", "value1");
    }
View Full Code Here

        assertFalse(mk.nodeExists("/a/b", null));
        assertTrue(mk.nodeExists("/c", null));
        assertTrue(mk.nodeExists("/c/b", null));

        String nodes = mk.getNodes("/c/b", null, 0 /*depth*/, 0 /*offset*/, -1 /*maxChildNodes*/, null /*filter*/);
        JSONObject obj = parseJSONObject(nodes);
        assertPropertyNotExists(obj, "key1");
    }
View Full Code Here

        assertFalse(mk.nodeExists("/a", null));
        assertTrue(mk.nodeExists("/c", null));

        String nodes = mk.getNodes("/c", null, 0 /*depth*/, 0 /*offset*/, -1 /*maxChildNodes*/, null /*filter*/);
        JSONObject obj = parseJSONObject(nodes);
        assertPropertyNotExists(obj, "key1");
    }
View Full Code Here

        assertFalse(mk.nodeExists("/a", null));
        assertTrue(mk.nodeExists("/b", null));
        assertTrue(mk.nodeExists("/c", null));

        String nodes = mk.getNodes("/c", null, 0 /*depth*/, 0 /*offset*/, -1 /*maxChildNodes*/, null /*filter*/);
        JSONObject obj = parseJSONObject(nodes);
        assertPropertyNotExists(obj, "key1");
    }
View Full Code Here

        String toRev = mk.commit("", toDiff, null, toMsg);

        JSONArray array = parseJSONArray(mk.getJournal(fromRev, toRev, "/"));
        assertEquals(2, array.size());

        JSONObject rev = getObjectArrayEntry(array, 0);
        assertPropertyExists(rev, "id", String.class);
        assertPropertyExists(rev, "ts", Long.class);
        assertPropertyValue(rev, "msg", fromMsg);
        assertPropertyValue(rev, "changes", fromDiff);
View Full Code Here

    public void commitAddWithDiffPaths() {
        // Commit with empty path and retrieve with root path
        String rev = mk.commit("", "+\"/a\":{}", null, "");
        String journalStr = mk.getJournal(rev, rev, "/");
        JSONArray array = parseJSONArray(journalStr);
        JSONObject entry = getObjectArrayEntry(array, 0);
        String expected = "+\"/a\":{}";
        assertPropertyValue(entry, "changes", expected);

        // Commit with root path and retrieve with root path
        rev = mk.commit("/", "+\"b\":{}", null, "");
View Full Code Here

        // Commit with empty path and retrieve with root path
        String rev = mk.commit("", "*\"/a\" : \"/b\"", null, null);
        String journalStr = mk.getJournal(rev, rev, "/");
        JSONArray array = parseJSONArray(journalStr);
        JSONObject entry = getObjectArrayEntry(array, 0);
        String expected = "*\"/a\":\"/b\"";
        assertPropertyValue(entry, "changes", expected);

        // Commit with root path and retrieve with root path
        rev = mk.commit("/", "*\"b\" : \"c\"", null, null);
View Full Code Here

        // Commit with empty path and retrieve with root path
        String rev = mk.commit("", ">\"/a\" : \"/b\"", null, null);
        String journalStr = mk.getJournal(rev, rev, "/");
        JSONArray array = parseJSONArray(journalStr);
        JSONObject entry = getObjectArrayEntry(array, 0);
        String expected = ">\"/a\":\"/b\"";
        assertPropertyValue(entry, "changes", expected);

        // Commit with root path and retrieve with root path
        rev = mk.commit("/", ">\"b\" : \"c\"", null, null);
View Full Code Here

TOP

Related Classes of org.json.simple.JSONObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.