assertSame(getAccessStackAdapter().getAdapter(), action.getAdapter());
assertSame(template, action.getQuery());
Connection c = getConnection();
try {
MockOperationObserver observer = new MockOperationObserver();
action.performAction(c, observer);
int[] batches = observer.countsForQuery(template);
assertNotNull(batches);
assertEquals(2, batches.length);
assertEquals(1, batches[0]);
assertEquals(1, batches[1]);
}
finally {
c.close();
}
MockOperationObserver observer = new MockOperationObserver();
SelectQuery query = new SelectQuery(Artist.class);
query.addOrdering("db:ARTIST_ID", true);
getDomain().performQueries(Collections.singletonList(query), observer);
List data = observer.rowsForQuery(query);
assertEquals(2, data.size());
Map row1 = (Map) data.get(0);
assertEquals(bindings1.get("id"), row1.get("ARTIST_ID"));
assertEquals(bindings1.get("name"), row1.get("ARTIST_NAME"));
// to compare dates we need to create the binding correctly