@SmallTest
@MediumTest
@LargeTest
public void testCanCastCollectionOfGraphObjects() throws JSONException {
JSONObject jsonSeattle = new JSONObject();
jsonSeattle.put("city", "Seattle");
JSONArray jsonArray = new JSONArray();
jsonArray.put(jsonSeattle);
GraphObjectList<GraphObject> collection = GraphObject.Factory
.createList(jsonArray, GraphObject.class);
GraphObjectList<GraphLocation> locationCollection = collection.castToListOf(GraphLocation.class);
assertTrue(locationCollection != null);
GraphLocation seattle = locationCollection.iterator().next();
assertTrue(seattle != null);
assertEquals("Seattle", seattle.getCity());
}
GraphObjectFactoryTests.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:LostAndFound
作者:
评论列表
文章目录