Package org.nustaq.kson

Examples of org.nustaq.kson.Kson.readObject()


    public void testPojoConf() throws Exception {
        Kson kk = new Kson()
            .map("test", SomePojoConfig.class)
            .map("pojo", PojoConfigItem.class)
            .map("other", OtherPojoConfigItem.class);
        SomePojoConfig result = (SomePojoConfig) kk.readObject( new File("./src/test/kson/test.kson"));
        Assert.assertTrue(result.aList.get(1).nameList[0].equals("Short"));
        Assert.assertTrue(result.untypedList.size() == 2);

        String res = kk.writeObject(result);
        System.out.println(res);
View Full Code Here


        Assert.assertTrue(result.untypedList.size() == 2);

        String res = kk.writeObject(result);
        System.out.println(res);

        Object reRead = kk.readObject(res);
        Assert.assertTrue(DeepEquals.deepEquals(result, reRead));

        res = kk.writeJSonObject(result, true);
        System.out.println(res);
View Full Code Here

    {
        Kson kk = new Kson()
            .map("test", SomePojoConfig.class)
            .map("pojo", PojoConfigItem.class)
            .map("other", OtherPojoConfigItem.class);
        SomePojoConfig result = (SomePojoConfig) kk.readObject( new File("./src/test/kson/test.json"), "test" );

        String res = kk.writeJSonObject(result,true);
        System.out.println(res);
        Object reRead = kk.readObject(res);
        Assert.assertTrue(DeepEquals.deepEquals(result,reRead));
View Full Code Here

            .map("other", OtherPojoConfigItem.class);
        SomePojoConfig result = (SomePojoConfig) kk.readObject( new File("./src/test/kson/test.json"), "test" );

        String res = kk.writeJSonObject(result,true);
        System.out.println(res);
        Object reRead = kk.readObject(res);
        Assert.assertTrue(DeepEquals.deepEquals(result,reRead));
    }

    @Test
    public void testJSonInetSample() throws Exception {
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.