Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 95174 invoked from network); 18 Feb 2009 03:58:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Feb 2009 03:58:23 -0000 Received: (qmail 67560 invoked by uid 500); 18 Feb 2009 03:58:22 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 67533 invoked by uid 500); 18 Feb 2009 03:58:22 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 67522 invoked by uid 99); 18 Feb 2009 03:58:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Feb 2009 19:58:22 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Feb 2009 03:58:22 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C1637234C48B for ; Tue, 17 Feb 2009 19:58:01 -0800 (PST) Message-ID: <1280291520.1234929481777.JavaMail.jira@brutus> Date: Tue, 17 Feb 2009 19:58:01 -0800 (PST) From: "Tim McConnell (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Updated: (OPENJPA-906) org.apache.openjpa.persistence.jpql.expressions.TestEntityTypeExpression In-Reply-To: <52667524.1233885726936.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-906?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tim McConnell updated OPENJPA-906: ---------------------------------- Attachment: OPENJPA-906.patch Hi Catalina, the problem with the TestEntityTypeExpression testcase is with the following query: query = "SELECT e FROM CompUser e where TYPE(e) = :typeName"; Since the query does not specify any ordering, then the ordering cannot be guaranteed, especially across multiple databases. So I've attached a patch that orders based on name, then checks the size of the subsequent result set and the order of the names returned. This should work across all databases and I've tested it with Derby, Oracle, and PostgreSQL. Please review. Thanks..... > org.apache.openjpa.persistence.jpql.expressions.TestEntityTypeExpression > ------------------------------------------------------------------------ > > Key: OPENJPA-906 > URL: https://issues.apache.org/jira/browse/OPENJPA-906 > Project: OpenJPA > Issue Type: Sub-task > Reporter: Tim McConnell > Assignee: Tim McConnell > Fix For: 2.0.0 > > Attachments: OPENJPA-906.patch > > > Running org.apache.openjpa.persistence.jpql.expressions.TestEntityTypeExpression > 0 TestConv INFO [main] openjpa.Runtime - Starting OpenJPA 2.0.0-SNAPSHOT > 46 TestConv INFO [main] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.PostgresDictionary" (PostgreSQL 8.3.5 ,PostgreSQL Native Driver PostgreSQL 8.3 JDBC3 with SSL (build 603)). > Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.5 sec <<< FAILURE! > testTypeExpression(org.apache.openjpa.persistence.jpql.expressions.TestEntityTypeExpression) Time elapsed: 0.5 sec <<< FAILURE! > junit.framework.ComparisonFailure: expected:<_Jacob> but was: > at junit.framework.Assert.assertEquals(Assert.java:81) > at junit.framework.Assert.assertEquals(Assert.java:87) > at org.apache.openjpa.persistence.jpql.expressions.TestEntityTypeExpression.testTypeExpression(TestEntityTypeExpression.java:113) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at junit.framework.TestCase.runTest(TestCase.java:154) > at junit.framework.TestCase.runBare(TestCase.java:127) > at org.apache.openjpa.persistence.test.PersistenceTestCase.runBare(PersistenceTestCase.java:443) > at junit.framework.TestResult$1.protect(TestResult.java:106) > at junit.framework.TestResult.runProtected(TestResult.java:124) > at junit.framework.TestResult.run(TestResult.java:109) > at junit.framework.TestCase.run(TestCase.java:118) > at org.apache.openjpa.persistence.test.PersistenceTestCase.run(PersistenceTestCase.java:173) > at junit.framework.TestSuite.runTest(TestSuite.java:208) > at junit.framework.TestSuite.run(TestSuite.java:203) > at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213) > at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) > at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) > at org.apache.maven.surefire.Surefire.run(Surefire.java:177) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:334) > at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:980) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.