assertSame(adapter, action.getAdapter());
assertSame(template, action.getQuery());
Connection c = dataSourceFactory.getSharedDataSource().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", SortOrder.ASCENDING);
node.performQueries(Collections.singletonList((Query) query), observer);
List<DataRow> data = observer.rowsForQuery(query);
assertEquals(2, data.size());
DataRow row1 = 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