@SmallTest @MediumTest @LargeTest public void testCollectionPutOfWrapperPutsJSONObject() throws JSONException { JSONObject jsonObject = new JSONObject(); GraphObject graphObject = GraphObject.Factory.create(jsonObject); graphObject.setProperty("hello", "world"); graphObject.setProperty("hocus", "pocus"); GraphObjectList<GraphObject> parentList = GraphObject.Factory.createList(GraphObject.class); parentList.add(graphObject); JSONArray jsonArray = parentList.getInnerJSONArray(); Object obj = jsonArray.opt(0); assertNotNull(obj); assertEquals(jsonObject, obj); parentList.set(0, graphObject); obj = jsonArray.opt(0); assertNotNull(obj); assertEquals(jsonObject, obj); }
@SmallTest @MediumTest @LargeTest public void testCanGetInnerJSONArray() throws JSONException { JSONArray jsonArray = new JSONArray(); GraphObjectList<GraphObject> collection = GraphObject.Factory.createList(jsonArray, GraphObject.class); assertEquals(jsonArray, collection.getInnerJSONArray()); }