Package cc.plural.jsonij

Examples of cc.plural.jsonij.ReaderJSONReader


    @Test
    public void testParseString2() throws IOException, ParserException {
        String testString = "\"John\"\"Marsden\"";
        ByteArrayInputStream targetArrayStream = new ByteArrayInputStream(testString.getBytes());
        InputStreamReader targetReader = new InputStreamReader(targetArrayStream);
        JSONReader target = new ReaderJSONReader(targetReader);
        JSON.String value1 = parser.parseString(target);
        JSON.String value2 = parser.parseString(target);
        targetReader.close();
        targetArrayStream.close();
        assertEquals("John", value1.toString());
View Full Code Here


    @Test
    public void testParseString3() throws IOException, ParserException {
        String testString = "\"John\\tcool\"";
        ByteArrayInputStream targetArrayStream = new ByteArrayInputStream(testString.getBytes());
        InputStreamReader targetReader = new InputStreamReader(targetArrayStream);
        JSONReader target = new ReaderJSONReader(targetReader);
        JSON.String value = parser.parseString(target);
        targetReader.close();
        targetArrayStream.close();
        assertEquals("John\tcool", value.toString());
    }
View Full Code Here

    @Test
    public void testParseString4() throws IOException, ParserException {
        String testString = "\"Gah: \\u5b66\"";
        ByteArrayInputStream targetArrayStream = new ByteArrayInputStream(testString.getBytes());
        InputStreamReader targetReader = new InputStreamReader(targetArrayStream);
        JSONReader target = new ReaderJSONReader(targetReader);
        JSON.String value = parser.parseString(target);
        targetReader.close();
        targetArrayStream.close();
        assertEquals("Gah: \u5b66", value.toString());
    }
View Full Code Here

    @Test
    public void testParseString5() throws IOException, ParserException {
        String testString = "\"Gah: \\ud801\\udc01\"";
        ByteArrayInputStream targetArrayStream = new ByteArrayInputStream(testString.getBytes());
        InputStreamReader targetReader = new InputStreamReader(targetArrayStream);
        JSONReader target = new ReaderJSONReader(targetReader);
        JSON.String value = parser.parseString(target);
        targetReader.close();
        targetArrayStream.close();
        assertEquals("Gah: \ud801\udc01", value.toString());
    }
View Full Code Here

TOP

Related Classes of cc.plural.jsonij.ReaderJSONReader

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.