Package org.slim3.repackaged.org.json

Examples of org.slim3.repackaged.org.json.JSONObject.optInt()


    }

    @Test
    public void optInt() throws Exception {
        JSONObject j = new JSONObject("{str: \"hello\", int: 3}");
        Assert.assertEquals(0, j.optInt("v"));
        Assert.assertEquals(0, j.optInt("str"));
        Assert.assertEquals("hello", j.optString("str"));
        Assert.assertEquals("3", j.optString("int"));
    }
View Full Code Here


    @Test
    public void optInt() throws Exception {
        JSONObject j = new JSONObject("{str: \"hello\", int: 3}");
        Assert.assertEquals(0, j.optInt("v"));
        Assert.assertEquals(0, j.optInt("str"));
        Assert.assertEquals("hello", j.optString("str"));
        Assert.assertEquals("3", j.optString("int"));
    }

    @Test
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.