Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-M2
    • Component/s: None
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      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)

      1. OPENJPA-906.patch
        1 kB
        Tim McConnell

        Activity

        Hide
        Catalina Wei added a comment -

        Fixed under r741665

        Show
        Catalina Wei added a comment - Fixed under r741665
        Hide
        Catalina Wei added a comment -

        Tim,
        If test failure on PostgreSQL still exists, please reopen the issue.

        Show
        Catalina Wei added a comment - Tim, If test failure on PostgreSQL still exists, please reopen the issue.
        Hide
        Tim McConnell added a comment -

        Same failure – reopening:

        Running org.apache.openjpa.persistence.jpql.expressions.TestEntityTypeExpression
        0 TestConv INFO [main] openjpa.Runtime - Starting OpenJPA 2.0.0-SNAPSHOT
        47 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.546 sec <<< FAILURE!
        testTypeExpression(org.apache.openjpa.persistence.jpql.expressions.TestEntityTypeExpression) Time elapsed: 0.546 sec <<< FAILURE!
        junit.framework.ComparisonFailure: expected:<...nnon> but was:<...de>
        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:142)
        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.GeneratedMethodAccessor48.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)

        Show
        Tim McConnell added a comment - Same failure – reopening: Running org.apache.openjpa.persistence.jpql.expressions.TestEntityTypeExpression 0 TestConv INFO [main] openjpa.Runtime - Starting OpenJPA 2.0.0-SNAPSHOT 47 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.546 sec <<< FAILURE! testTypeExpression(org.apache.openjpa.persistence.jpql.expressions.TestEntityTypeExpression) Time elapsed: 0.546 sec <<< FAILURE! junit.framework.ComparisonFailure: expected:<...nnon> but was:<...de> 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:142) 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.GeneratedMethodAccessor48.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)
        Hide
        Tim McConnell added a comment -

        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.....

        Show
        Tim McConnell added a comment - 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.....
        Hide
        Catalina Wei added a comment -

        Tim,
        Your patch that fixes the testcase error has been committed at r745706.
        Thank you so much.

        Show
        Catalina Wei added a comment - Tim, Your patch that fixes the testcase error has been committed at r745706. Thank you so much.
        Hide
        Tim McConnell added a comment -

        Works on DB2, Derby, PostgreSQL, Oracle databases.....

        Show
        Tim McConnell added a comment - Works on DB2, Derby, PostgreSQL, Oracle databases.....

          People

          • Assignee:
            Tim McConnell
            Reporter:
            Tim McConnell
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development