From 0416d6b54c83585ace5fab8280151b2af0c4c354 Mon Sep 17 00:00:00 2001 From: Catalina Wei Date: Sat, 7 Feb 2009 17:16:22 +0000 Subject: [PATCH] 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 --- .../jpql/expressions/TestJPQLScalarExpressions.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestJPQLScalarExpressions.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestJPQLScalarExpressions.java index fd3a9815c..bfc89d990 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestJPQLScalarExpressions.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestJPQLScalarExpressions.java @@ -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]);