From 1a407b6d6802202e9d7aa0f0882fbdb94213af55 Mon Sep 17 00:00:00 2001 From: Catalina Wei Date: Thu, 19 Feb 2009 02:13:02 +0000 Subject: [PATCH] OPENJPA-906 fix testcase TestEntityTypeExpression committing patch from Tim McConnell git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@745706 13f79535-47bb-0310-9956-ffa450edef68 --- .../jpql/expressions/TestEntityTypeExpression.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestEntityTypeExpression.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestEntityTypeExpression.java index 8a336ff96..ceba5c665 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestEntityTypeExpression.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestEntityTypeExpression.java @@ -135,10 +135,16 @@ public class TestEntityTypeExpression extends AbstractTestCase { 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 @@ public class TestEntityTypeExpression extends AbstractTestCase { 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);