openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fa...@apache.org
Subject svn commit: r745706 - /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestEntityTypeExpression.java
Date Thu, 19 Feb 2009 02:13:02 GMT
Author: fancy
Date: Thu Feb 19 02:13:02 2009
New Revision: 745706

URL: http://svn.apache.org/viewvc?rev=745706&view=rev
Log:
OPENJPA-906 fix testcase TestEntityTypeExpression
committing patch from Tim McConnell

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

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestEntityTypeExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestEntityTypeExpression.java?rev=745706&r1=745705&r2=745706&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestEntityTypeExpression.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestEntityTypeExpression.java
Thu Feb 19 02:13:02 2009
@@ -135,10 +135,16 @@
         type = ((Object[]) rs2.get(0))[1];
         assertEquals(type, FemaleUser.class);
         
-        query = "SELECT e FROM CompUser e where TYPE(e) = :typeName";
+        query = "SELECT e FROM CompUser e where TYPE(e) = :typeName " +
+            " ORDER BY e.name";
         rs =  em.createQuery(query).
             setParameter("typeName", FemaleUser.class).getResultList();
+        assertTrue(rs.size()==3);
         user = rs.get(0);
+        assertEquals("Famzy", user.getName());
+        user = rs.get(1);
+        assertEquals("Shade", user.getName());
+        user = rs.get(2);
         assertEquals("Shannon", user.getName());
 
         query = "SELECT e FROM CompUser e where TYPE(e) = ?1 ORDER BY e.name";
@@ -147,7 +153,8 @@
         user = rs.get(0);
         assertEquals("Famzy", user.getName());
         
-        query = "SELECT e FROM CompUser e where TYPE(e) in (?1) ORDER BY e.name DESC";
+        query = "SELECT e FROM CompUser e where TYPE(e) in (?1)" +
+            " ORDER BY e.name DESC";
         rs = em.createQuery(query).
             setParameter(1, MaleUser.class).getResultList();
         user = rs.get(0);



Mime
View raw message