OPENJPA-807 JPQ2 JPQL fix testcase, enforce ordered results

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@741916 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Catalina Wei 2009-02-07 17:16:22 +00:00
parent 16778feb29
commit 0416d6b54c
1 changed files with 5 additions and 4 deletions

View File

@ -135,12 +135,13 @@ public class TestJPQLScalarExpressions extends AbstractTestCase {
" CASE TYPE(e) WHEN FemaleUser THEN 'Female' " +
" ELSE 'Male' " +
" END as result" +
" FROM CompUser e";
" FROM CompUser e WHERE e.name like 'S%' " +
" ORDER BY e.name DESC";
List rs3 = em.createQuery(query3).getResultList();
Object[] result3 = (Object[]) rs3.get(rs3.size()-1);
Object[] result3 = (Object[]) rs3.get(0);
assertEquals("the result is not female", "Female", result3[1]);
assertEquals("the name is not shade", "Shade", result3[0]);
result3 = (Object[]) rs3.get(0);
assertEquals("the name is not shannon", "Shannon ", result3[0]);
result3 = (Object[]) rs3.get(2);
assertEquals("the result is not male", "Male", result3[1]);
assertEquals("the name is not seetha", "Seetha", result3[0]);