Package com.github.jsonj

Examples of com.github.jsonj.JsonElement


        };
    }

    @Test(dataProvider="strings")
    public void shouldParseSerializedAndHandleEscapingBothWays(String text) {
        JsonElement e = object().put(text, "value").put("stringval", text).put("array", array(text,text)).get();

        String json = JsonSerializer.serialize(e);
        JsonElement parsed = new JsonParser().parse(json);
        AssertJUnit.assertEquals(e, parsed);
    }
View Full Code Here


        AssertJUnit.assertEquals(e, parsed);
    }

    @Test(dataProvider = "strings")
    public void shouldParseSerializedAndHandleEscapingBothWaysWithOutputStream(String text) throws IOException {
        JsonElement e = object().put(text, "value").put("stringval", text).put("array", array(text, text)).get();
        StringWriter sw = new StringWriter();

        JsonSerializer.serialize(e, sw);
        String string = sw.getBuffer().toString();
        JsonElement parsed = new JsonParser().parse(string);
        AssertJUnit.assertEquals(e, parsed);
    }
View Full Code Here

TOP

Related Classes of com.github.jsonj.JsonElement

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.