noInitialCrset = newNoInitialInstance();
Listener listener = new Listener();
noInitialCrset.addRowSetListener(listener);
listener.clear();
noInitialCrset.rowSetPopulated(new RowSetEvent(crset), 20);
assertEquals(EVENT_ROWSET_CHANGED, listener.getTag());
assertEquals(noInitialCrset, listener.getEventSource());
for (int i = 1; i <= 10; i++) {
listener.clear();
noInitialCrset.rowSetPopulated(new RowSetEvent(noInitialCrset), i);
assertEquals(EVENT_ROWSET_CHANGED, listener.getTag());
}
rs = st.executeQuery("SELECT * FROM USER_INFO");
noInitialCrset.populate(rs);
noInitialCrset.setMaxRows(10);
noInitialCrset.setFetchSize(2);
listener.clear();
noInitialCrset.rowSetPopulated(new RowSetEvent(noInitialCrset), 2);
assertEquals(EVENT_ROWSET_CHANGED, listener.getTag());
listener.clear();
noInitialCrset.rowSetPopulated(new RowSetEvent(noInitialCrset), 3);
assertNull(listener.getTag());
listener.clear();
noInitialCrset.rowSetPopulated(new RowSetEvent(noInitialCrset), 4);
assertEquals(EVENT_ROWSET_CHANGED, listener.getTag());
listener.clear();
noInitialCrset.rowSetPopulated(new RowSetEvent(crset), 4);
assertEquals(EVENT_ROWSET_CHANGED, listener.getTag());
assertEquals(noInitialCrset, listener.getEventSource());
}