| Author |
EasyMock- How to populate a ResultSet ?
|
Tiya Khambadkone
Ranch Hand
Joined: Sep 15, 2011
Posts: 40
|
|
EasyMock- How to populate a ResultSet for more than 1 row ?
This is how I am populating for a single row.
mockControl.expectAndReturn(mockRS.getString(1), "EmployeeId", 1);
mockControl.expectAndReturn(mockRS.getString(2), "EmployeeName", 1);
mockRS.next();
I tried this logic for 2nd row :
mockControl.expectAndReturn(mockRS.getString(1), "EmployeeId", 2);
mockControl.expectAndReturn(mockRS.getString(2), "EmployeeName", 2);
mockRS.next();
When inside the class-under-test,
while(rs.next())
excutes only once .
So, How to populate a ResultSet for more than 1 row ?
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26138
|
|
|
Where in the test are you specifying that mockRs.next() should return true?
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: EasyMock- How to populate a ResultSet ?
|
|
|