[ 
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:<Ugo>
>       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.

Reply via email to