Package org.apache.wink.json4j

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


            obj.put("key3", "key3");
            String[] keys = {"key1", "key3"};
            JSONObject testObj = new JSONObject(obj, keys);
            assertTrue(testObj.size() == 2);
            assertTrue(testObj.opt("key2") == null);
            assertTrue(testObj.opt("key3").equals("key3"));
            assertTrue(testObj.opt("key1").equals("key1"));
        }
        catch (JSONException jex) {
            jex.printStackTrace();
            assertTrue(false);
View Full Code Here


            String[] keys = {"key1", "key3"};
            JSONObject testObj = new JSONObject(obj, keys);
            assertTrue(testObj.size() == 2);
            assertTrue(testObj.opt("key2") == null);
            assertTrue(testObj.opt("key3").equals("key3"));
            assertTrue(testObj.opt("key1").equals("key1"));
        }
        catch (JSONException jex) {
            jex.printStackTrace();
            assertTrue(false);
        }
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.