File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Testing and the fly likes Mockito, testing org.hibernate.ScrollableResults count of 1000 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Mockito, testing org.hibernate.ScrollableResults count of 1000" Watch "Mockito, testing org.hibernate.ScrollableResults count of 1000" New topic
Author

Mockito, testing org.hibernate.ScrollableResults count of 1000

Santosh Ramachandrula
Ranch Hand

Joined: Apr 04, 2004
Posts: 252
Hi, Using Mockito I want to test the condition where I get to a count of 1000 in org.hibernate.ScrollableResults, One way to do this would be to have when(scrollableResults.next()).thenReturn(true).thenReturn(true).thenReturn(true).....................................; more than thousand times. Is there a shorter way of doing this? Please let me know if you need more information.



Thanks,
Santosh
Santosh Ramachandrula
Ranch Hand

Joined: Apr 04, 2004
Posts: 252
It can be done in the following way

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mockito, testing org.hibernate.ScrollableResults count of 1000
 
Similar Threads
Casting Arrays
Button Recording to a File
Mockito Help - Problem to sort a List of mock objects.
stubbing methods that throw a checked exception using Mockito
Mockito "when" problem