Package org.apache.wink.json4j

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


    public void test_optLong() {
        Exception ex = null;

        try {
            JSONObject jObject = new JSONObject("{\"long\":1}");
            assertTrue(jObject.optLong("long") == 1);
            assertTrue(jObject.optLong("long2", 2) == 2);
            assertTrue(jObject.optLong("long2") == 0);
        } catch (Exception ex1) {
            ex = ex1;
            ex.printStackTrace();
View Full Code Here


        Exception ex = null;

        try {
            JSONObject jObject = new JSONObject("{\"long\":1}");
            assertTrue(jObject.optLong("long") == 1);
            assertTrue(jObject.optLong("long2", 2) == 2);
            assertTrue(jObject.optLong("long2") == 0);
        } catch (Exception ex1) {
            ex = ex1;
            ex.printStackTrace();
        }
View Full Code Here

        try {
            JSONObject jObject = new JSONObject("{\"long\":1}");
            assertTrue(jObject.optLong("long") == 1);
            assertTrue(jObject.optLong("long2", 2) == 2);
            assertTrue(jObject.optLong("long2") == 0);
        } catch (Exception ex1) {
            ex = ex1;
            ex.printStackTrace();
        }
        assertTrue(ex == null);
View Full Code Here

    public void test_optLongNgative() {
        Exception ex = null;

        try {
            JSONObject jObject = new JSONObject("{\"long\":-1}");
            assertTrue(jObject.optLong("long") == -1);
        } 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.