public void testAggregateAndProjection() {
// Postgres bug
Broker broker = _factory.newBroker();
// group avoids postgres bug
Query q = broker
.newQuery(JPQLParser.LANG_JPQL, "select a.name, avg(a.age) FROM " +
CacheObjectAChild1.class.getSimpleName() +
" a group by a.name");
List l = (List) q.execute();
CacheTestHelper.iterate(l);
assertEquals(Object[].class, l.get(0).getClass());
assertEquals(2, ((Object[]) l.get(0)).length);
assertEquals(String.class, ((Object[]) l.get(0))[0].getClass());
CacheTestHelper.assertInCache(this, q, Boolean.TRUE);
l = (List) q.execute();
assertEquals(Object[].class, l.get(0).getClass());
assertEquals(2, ((Object[]) l.get(0)).length);
assertEquals(String.class, ((Object[]) l.get(0))[0].getClass());
}