Package cc.plural.jsonij

Examples of cc.plural.jsonij.JSON.toJSON()


        String testOutput = json.toJSON();
        System.out.println(String.format("\tInput: %s\r\n\tOutput: %s", testInput, testOutput));
        assertEquals(testSoultion, testOutput);
        testInput = "{  \t     \"PI\" :\t   \t3.141e-10    }";
        json = JSON.parse(testInput);
        testOutput = json.toJSON();
        System.out.println(String.format("\tInput: %s\r\n\tOutput: %s", testInput, testOutput));
        assertEquals(testSoultion, testOutput);
    }

    @Test
View Full Code Here


    public void testSupportBigintNumberSupport() throws ParserException, IOException {
        System.out.println("Bigint number support");
        String testInput = "{ \"v\":123456789123456789123456789}";
        String testSoultion = "{\"v\":123456789123456789123456789}";
        JSON json = JSON.parse(testInput);
        String testOutput = json.toJSON();
        System.out.println(String.format("\tInput: %s\r\n\tOutput: %s", testInput, testOutput));
        assertEquals(testSoultion, testOutput);
        testInput = "{ \t\t  \"v\"  :   123456789123456789123456789    \t }";
        json = JSON.parse(testInput);
        testOutput = json.toJSON();
View Full Code Here

        String testOutput = json.toJSON();
        System.out.println(String.format("\tInput: %s\r\n\tOutput: %s", testInput, testOutput));
        assertEquals(testSoultion, testOutput);
        testInput = "{ \t\t  \"v\"  :   123456789123456789123456789    \t }";
        json = JSON.parse(testInput);
        testOutput = json.toJSON();
        System.out.println(String.format("\tInput: %s\r\n\tOutput: %s", testInput, testOutput));
        assertEquals(testSoultion, testOutput);
    }

    @Test
View Full Code Here

    public void testSupportArrayOfEmptyObject() throws ParserException, IOException {
        System.out.println("Array of empty Object");
        String testInput = "[ { }, { },[]]";
        String testSoultion = "[{},{},[]]";
        JSON json = JSON.parse(testInput);
        String testOutput = json.toJSON();
        System.out.println(String.format("\tInput: %s\r\n\tOutput: %s", testInput, testOutput));
        assertEquals(testSoultion, testOutput);
        testInput = "[   \t { }  \t, { }\t,[  ]]";
        json = JSON.parse(testInput);
        testOutput = json.toJSON();
View Full Code Here

        String testOutput = json.toJSON();
        System.out.println(String.format("\tInput: %s\r\n\tOutput: %s", testInput, testOutput));
        assertEquals(testSoultion, testOutput);
        testInput = "[   \t { }  \t, { }\t,[  ]]";
        json = JSON.parse(testInput);
        testOutput = json.toJSON();
        System.out.println(String.format("\tInput: %s\r\n\tOutput: %s", testInput, testOutput));
        assertEquals(testSoultion, testOutput);
    }

    @Test
View Full Code Here

    public void testSupportDoublePrecisionPostiveFloatingPoint() throws ParserException, IOException {
        System.out.println("Double precision postive floating point");
        String testInput = "{ \"v\":1.7976931348623157E308}";
        String testSoultion = "{\"v\":1.7976931348623157E+308}";
        JSON json = JSON.parse(testInput);
        String testOutput = json.toJSON();
        System.out.println(String.format("\tInput: %s\r\n\tOutput: %s", testInput, testOutput));
        assertEquals(testSoultion, testOutput);
        testInput = "{   \t \"v\"  \t :  1.7976931348623157E308  }";
        json = JSON.parse(testInput);
        testOutput = json.toJSON();
View Full Code Here

        String testOutput = json.toJSON();
        System.out.println(String.format("\tInput: %s\r\n\tOutput: %s", testInput, testOutput));
        assertEquals(testSoultion, testOutput);
        testInput = "{   \t \"v\"  \t :  1.7976931348623157E308  }";
        json = JSON.parse(testInput);
        testOutput = json.toJSON();
        System.out.println(String.format("\tInput: %s\r\n\tOutput: %s", testInput, testOutput));
        assertEquals(testSoultion, testOutput);
    }
   
   
View Full Code Here

    public void testSupportDoublePrecisionNegativeFloatingPoint() throws ParserException, IOException {
        System.out.println("Double precision negative floating point");
        String testInput = "{ \"v\":-9.87654321921234567E-200}";
        String testSoultion = "{\"v\":-9.87654321921234567E-200}";
        JSON json = JSON.parse(testInput);
        String testOutput = json.toJSON();
        System.out.println(String.format("\tInput: %s\r\n\tOutput: %s", testInput, testOutput));
        assertEquals(testSoultion, testOutput);
        testInput = "{   \t \"v\"  \t :  -9.87654321921234567E-200  }";
        json = JSON.parse(testInput);
        testOutput = json.toJSON();
View Full Code Here

        String testOutput = json.toJSON();
        System.out.println(String.format("\tInput: %s\r\n\tOutput: %s", testInput, testOutput));
        assertEquals(testSoultion, testOutput);
        testInput = "{   \t \"v\"  \t :  -9.87654321921234567E-200  }";
        json = JSON.parse(testInput);
        testOutput = json.toJSON();
        System.out.println(String.format("\tInput: %s\r\n\tOutput: %s", testInput, testOutput));
        assertEquals(testSoultion, testOutput);
    }

    @Test
View Full Code Here

    public void testUnicode() throws ParserException, IOException {
        System.out.println("Unicode");
        String testInput = "{\"lastname\":\"\\u44ff\",\"date\":\"\\u44aa\\u44ff\",\"len\":\"\\u44AA\"}";
        String testSoultion = "{\"lastname\":\"\\u44ff\",\"date\":\"\\u44aa\\u44ff\",\"len\":\"\\u44aa\"}";
        JSON json = JSON.parse(testInput);
        String testOutput = json.toJSON();
        System.out.println(String.format("\tInput: %s\r\n\tOutput: %s", testInput, testOutput));
        assertEquals(testSoultion, testOutput);
    }

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.