@SmallTest @MediumTest @LargeTest public void testCanSetComplexTypes() { GraphLocation graphLocation = GraphObject.Factory.create(GraphLocation.class); graphLocation.setCity("Seattle"); GraphPlace graphPlace = GraphObject.Factory.create(GraphPlace.class); graphPlace.setLocation(graphLocation); assertEquals(graphLocation, graphPlace.getLocation()); assertEquals("Seattle", graphPlace.getLocation().getCity()); }
@SmallTest @MediumTest @LargeTest public void testCollectionIteratorOfGraphObject() throws JSONException { Collection<GraphLocation> collection = GraphObject.Factory.createList(GraphLocation.class); GraphLocation seattle = GraphObject.Factory.create(GraphLocation.class); seattle.setCity("Seattle"); collection.add(seattle); GraphLocation paris = GraphObject.Factory.create(GraphLocation.class); paris.setCity("Paris"); collection.add(paris); Iterator<GraphLocation> iter = collection.iterator(); assertTrue(iter.hasNext()); assertEquals(seattle, iter.next()); assertTrue(iter.hasNext()); assertEquals(paris, iter.next()); assertFalse(iter.hasNext()); for (GraphLocation location : collection) { assertTrue(location != null); } }