Package org.apache.isis.runtimes.dflt.objectstores.nosql

Examples of org.apache.isis.runtimes.dflt.objectstores.nosql.StateWriter


        assertEquals("{\"number\": null}", writer.getData());
    }

    @Test
    public void addAggregate() throws Exception {
        final StateWriter aggregate = writer.addAggregate("#4");
        aggregate.writeField("number", "string-data");
        assertEquals("{\"#4\": {\"number\": \"string-data\"}}", writer.getData());
    }
View Full Code Here


    }

    @Test
    public void elementData() throws Exception {
        final List<StateWriter> elements = new ArrayList<StateWriter>();
        final StateWriter elementWriter1 = writer.createElementWriter();
        elementWriter1.writeField("number", "1");
        elements.add(elementWriter1);
        final StateWriter elementWriter2 = writer.createElementWriter();
        elementWriter2.writeField("number", "4");
        elements.add(elementWriter2);

        writer.writeCollection("coll", elements);

        assertEquals("{\"coll\": [\n    {\"number\": \"1\"},\n    {\"number\": \"4\"}\n]}", writer.getData());
View Full Code Here

        assertEquals("{\"number\": null}", writer.getData());
    }

    @Test
    public void addAggregate() throws Exception {
        StateWriter aggregate = writer.addAggregate("#4");
        aggregate.writeField("number", "string-data");
        assertEquals("{\"#4\": {\"number\": \"string-data\"}}", writer.getData());
    }
View Full Code Here

    }

    @Test
    public void elementData() throws Exception {
        List<StateWriter> elements = new ArrayList<StateWriter>();
        StateWriter elementWriter1 = writer.createElementWriter();
        elementWriter1.writeField("number", "1");
        elements.add(elementWriter1);
        StateWriter elementWriter2 = writer.createElementWriter();
        elementWriter2.writeField("number", "4");
        elements.add(elementWriter2);
       
        writer.writeCollection("coll", elements);
       
        assertEquals("{\"coll\": [\n    {\"number\": \"1\"},\n    {\"number\": \"4\"}\n]}", writer.getData());
View Full Code Here

TOP

Related Classes of org.apache.isis.runtimes.dflt.objectstores.nosql.StateWriter

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.