Package org.apache.wink.json4j

Examples of org.apache.wink.json4j.JSONObject.optBoolean()


    public void test_optBoolean() {
        Exception ex = null;

        try {
            JSONObject jObject = new JSONObject("{\"bool\":true}");
            assertTrue(jObject.optBoolean("bool"));
            assertTrue(jObject.optBoolean("bool2") == false);
            assertTrue(jObject.optBoolean("bool2", true) == true);

        } catch (Exception ex1) {
            ex = ex1;
View Full Code Here


        Exception ex = null;

        try {
            JSONObject jObject = new JSONObject("{\"bool\":true}");
            assertTrue(jObject.optBoolean("bool"));
            assertTrue(jObject.optBoolean("bool2") == false);
            assertTrue(jObject.optBoolean("bool2", true) == true);

        } catch (Exception ex1) {
            ex = ex1;
            ex.printStackTrace();
View Full Code Here

        try {
            JSONObject jObject = new JSONObject("{\"bool\":true}");
            assertTrue(jObject.optBoolean("bool"));
            assertTrue(jObject.optBoolean("bool2") == false);
            assertTrue(jObject.optBoolean("bool2", true) == true);

        } catch (Exception ex1) {
            ex = ex1;
            ex.printStackTrace();
        }
View Full Code Here

    public void test_optBoolean_StringValue() {
        Exception ex = null;

        try {
            JSONObject jObject = new JSONObject("{\"bool\":\"true\"}");
            assertTrue(jObject.optBoolean("bool"));
        } catch (Exception ex1) {
            ex = ex1;
            ex.printStackTrace();
        }
        assertTrue(ex == null);
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.