Package org.amplafi.json.renderers

Examples of org.amplafi.json.renderers.IterableJsonOutputRenderer


    public void testBasic() {
        Set<Object> s = new LinkedHashSet<Object>();
        s.add("abc");
        s.add("def");
        IterableJsonOutputRenderer renderer = new IterableJsonOutputRenderer(true);
        JSONStringer jsonWriter = new JSONStringer();
        jsonWriter.addRenderer(renderer);
        jsonWriter.value(s);
        assertEquals(jsonWriter.toString(), "[\"abc\",\"def\"]");
    }
View Full Code Here


    public void testNullFiltering() {
        Set<Object> s = new LinkedHashSet<Object>();
        s.add("abc");
        s.add(null);
        s.add("def");
        IterableJsonOutputRenderer renderer = new IterableJsonOutputRenderer(false);
        JSONStringer jsonWriter = new JSONStringer();
        jsonWriter.addRenderer(renderer);
        jsonWriter.value(s);
        assertEquals(jsonWriter.toString(), "[\"abc\",\"def\"]");
    }
View Full Code Here

    public void testAllowNulls() {
        Set<Object> s = new LinkedHashSet<Object>();
        s.add("abc");
        s.add(null);
        s.add("def");
        IterableJsonOutputRenderer renderer = new IterableJsonOutputRenderer(true);
        JSONStringer jsonWriter = new JSONStringer();
        jsonWriter.addRenderer(renderer);
        jsonWriter.value(s);
        assertEquals(jsonWriter.toString(), "[\"abc\",null,\"def\"]");
    }
View Full Code Here

TOP

Related Classes of org.amplafi.json.renderers.IterableJsonOutputRenderer

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.