OPENJPA-1580: fix test case problem

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@926816 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Fay Wang 2010-03-23 22:28:29 +00:00
parent 53dddbeb8f
commit e6ba2e9ed9
1 changed files with 4 additions and 4 deletions

View File

@ -983,20 +983,20 @@ public class TestPreparedQueryCache extends TestCase {
l = getAllCompaniesPaged(0, 1);
assertEquals(1, l.size());
assertEquals("BEA", l.get(0).getName());
assertEquals(1900, l.get(0).getStartYear());
l = getAllCompaniesPaged(1, 1);
assertEquals(1, l.size());
assertEquals("IBM", l.get(0).getName());
assertEquals(2000, l.get(0).getStartYear());
l = getAllCompaniesPaged(2, 1);
assertEquals(1, l.size());
assertEquals("acme.org", l.get(0).getName());
assertEquals(2010, l.get(0).getStartYear());
}
public List<Company> getAllCompaniesPaged(int start, int max) {
EntityManager em = emf.createEntityManager();
Query q = em.createQuery("select p from Company p order by p.name");
Query q = em.createQuery("select p from Company p order by p.startYear");
q.setFirstResult(start);
q.setMaxResults(max);
return (List<Company>) q.getResultList();