openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fa...@apache.org
Subject svn commit: r741916 - /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestJPQLScalarExpressions.java
Date Sat, 07 Feb 2009 17:16:22 GMT
Author: fancy
Date: Sat Feb  7 17:16:22 2009
New Revision: 741916

URL: http://svn.apache.org/viewvc?rev=741916&view=rev
Log:
OPENJPA-807 JPQ2 JPQL  fix testcase, enforce ordered results

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestJPQLScalarExpressions.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestJPQLScalarExpressions.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestJPQLScalarExpressions.java?rev=741916&r1=741915&r2=741916&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestJPQLScalarExpressions.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestJPQLScalarExpressions.java
Sat Feb  7 17:16:22 2009
@@ -135,12 +135,13 @@
             " 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]);
 



Mime
View raw message