" <TestTable TheId='1' TheText='Text 1'/>\n"+
" <TestTable TheId='2' TheText='Text 2'/>\n"+
" <TestTable TheId='3' TheText='Text 3'/>"+
"</data>");
ModelBasedResultSetIterator it = (ModelBasedResultSetIterator)getPlatform().query(getModel(),
"SELECT * FROM TestTable",
new Table[] { getModel().getTable(0) });
assertTrue(it.hasNext());
// we call the method a second time to assert that the result set does not get advanced twice
assertTrue(it.hasNext());
DynaBean bean = (DynaBean)it.next();
assertEquals(new Integer(1),
getPropertyValue(bean, "TheId"));
assertEquals("Text 1",
getPropertyValue(bean, "TheText"));
assertTrue(it.hasNext());
bean = (DynaBean)it.next();
assertEquals(new Integer(2),
getPropertyValue(bean, "TheId"));
assertEquals("Text 2",
getPropertyValue(bean, "TheText"));
assertTrue(it.hasNext());
bean = (DynaBean)it.next();
assertEquals(new Integer(3),
getPropertyValue(bean, "TheId"));
assertEquals("Text 3",
getPropertyValue(bean, "TheText"));
assertFalse(it.hasNext());
assertFalse(it.isConnectionOpen());
}