query.create("select productGroup from " + ProductGroup.class.getName() + " where groupName=$1");
query.bind("id" + id);
Collection results = (Collection) query.execute();
Iterator it = results.iterator();
int foundCount = 0;
ProductGroupProxy temp = null;
while (it.hasNext())
{
foundCount++;
temp = (ProductGroupProxy) it.next();
if (temp.getAllArticles().size() != COUNT)
fail("ProductGroup should have had " + COUNT + " articles in it, we found " + temp.getAllArticles().size());
}
if (foundCount != 1)
fail("Should have found just one ProductGroup with id=id" + id + ", instead found " + foundCount);
}