Package org.apache.sling.commons.json.util

Examples of org.apache.sling.commons.json.util.DespacedRendering.expect()


    public void testWriteJsonArray() throws JSONException {
        final JSONArray a = j.toJSONArray(j.names());
        final StringWriter w = new StringWriter();
        a.write(w);
        final DespacedRendering r = new DespacedRendering("{array:" + w.toString() + "}");
        r.expect("_thisstring_","12","42","true","json.stringhere");
    }
   
    @Test(expected=JSONException.class)
    public void testWriteJsonArrayException() throws JSONException {
        final JSONArray a = j.toJSONArray(j.names());
View Full Code Here


    @Test
    public void testWrite() throws JSONException {
        final StringWriter w = new StringWriter();
        j.write(w);
        final DespacedRendering r = new DespacedRendering(w.toString());
        r.expect(
                "_long_:42",
                "_string_:_thisstring_",
                "_int_:12",
                "_k0_:{",
                "_name_:_k0_",
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.