-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Hibernate 3.2.4.sp1 JUnit Test Errors, Failures
PostPosted: Thu May 31, 2007 11:32 am 
Newbie

Joined: Thu May 31, 2007 11:02 am
Posts: 1
My client company is hoping to use Hibernate as the persistence mechanism for its software components. We are trying to validate Hibernate using its own JUnit test suite and its own HSQLDB 1.8.0. However, in running the JUnit test suite, there are 8 failures and 8 errors in the 1,055 tests run. The following tests below are failing. We would appreciate any insight(s) into the JUnit failures and errors.


ASTParserLoadingTest.testParameterTypeMismatchFailureExpected Error java.lang.Integer

java.lang.ClassCastException: java.lang.Integer at org.hibernate.type.StringType.toString(StringType.java:44) at org.hibernate.type.NullableType.toLoggableString(NullableType.java:218) at org.hibernate.pretty.Printer.toString(Printer.java:76) at org.hibernate.engine.QueryParameters.traceParameters(QueryParameters.java:277) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:151) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at org.hibernate.test.hql.ASTParserLoadingTest.testParameterTypeMismatchFailureExpected(ASTParserLoadingTest.java:497) at org.hibernate.junit.functional.FunctionalTestCase.runTest(FunctionalTestCase.java:101) at org.hibernate.junit.UnitTestCase.runBare(UnitTestCase.java:34) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.runTest(FunctionalTestClassTestSuite.java:100) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.run(FunctionalTestClassTestSuite.java:69)


CriteriaHQLAlignmentTest.testCriteriaAggregationReturnTypeFailureExpected Error java.lang.Integer

java.lang.ClassCastException: java.lang.Integer at org.hibernate.test.hql.CriteriaHQLAlignmentTest.testCriteriaAggregationReturnTypeFailureExpected(CriteriaHQLAlignmentTest.java:124) at org.hibernate.junit.functional.FunctionalTestCase.runTest(FunctionalTestCase.java:101) at org.hibernate.junit.UnitTestCase.runBare(UnitTestCase.java:34) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.runTest(FunctionalTestClassTestSuite.java:100) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.run(FunctionalTestClassTestSuite.java:69)


HQLTest.testEmptyInListFailureExpected Failure Old query translator did not throw an exception, the new one did

junit.framework.AssertionFailedError: Old query translator did not throw an exception, the new one did at org.hibernate.test.hql.QueryTranslatorTestCase.assertTranslation(QueryTranslatorTestCase.java:190) at org.hibernate.test.hql.QueryTranslatorTestCase.assertTranslation(QueryTranslatorTestCase.java:112) at org.hibernate.test.hql.QueryTranslatorTestCase.assertTranslation(QueryTranslatorTestCase.java:102) at org.hibernate.test.hql.HQLTest.testEmptyInListFailureExpected(HQLTest.java:132) at org.hibernate.junit.functional.FunctionalTestCase.runTest(FunctionalTestCase.java:101) at org.hibernate.junit.UnitTestCase.runBare(UnitTestCase.java:34) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.runTest(FunctionalTestClassTestSuite.java:100) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.run(FunctionalTestClassTestSuite.java:69)

HQLTest.testMaxindexHqlFunctionInElementAccessorFailureExpected Failure SQL is not the same as the old SQL (scalar=true) expected:<...1_, Simple simple3_ where (simple3_.count_=2 and manytomany1_.elt=simple3_.id_ and container0_.container_id=manytomany1_.container_id2 and manytomany1_.list_index = (select max(manytomany2_.list_index) from manyToMany manytomany2_ where container0_.container_id=manytomany2_.container_id2))> but was:<...2_, Simple simple3_ where container0_.container_id=manytomany2_.container_id2 and manytomany2_.list_index = (select max(manytomany1_.list_index) from manyToMany manytomany1_ where container0_.container_id=manytomany1_.container_id2) and manytomany2_.elt=simple3_.id_ and simple3_.count_=2>

HQLTest.testMultipleElementAccessorOperatorsFailureExpected Failure SQL is not the same as the old SQL (scalar=true) expected:<...Simple onetomany1_, manyToMany manytomany2_, Simple simple3_ where (onetomany1_.name='s' and manytomany2_.elt=simple3_.id_ and container0_.container_id=manytomany2_.container_id2 and manytomany2_.list_index = 0 and container0_.container_id=onetomany1_.container_id1 and onetomany1_.list_index = simple3_.count_)> but was:<...manyToMany manytomany1_, Simple simple2_, Simple onetomany3_ where container0_.container_id=manytomany1_.container_id2 and manytomany1_.list_index = 0 and manytomany1_.elt=simple2_.id_ and container0_.container_id=onetomany3_.container_id1 and onetomany3_.list_index = simple2_.count_ and onetomany3_.name='s'>

HQLTest.testKeyManyToOneJoinFailureExpected Failure New query translator did *NOT* throw an exception, the old one did : org.hibernate.QueryException: BY expected after GROUP or ORDER: o [from Order o left join fetch o.lineItems li left join fetch li.product p]

HQLTest.testDuplicateExplicitJoinFailureExpected Failure SQL is not the same as the old SQL (scalar=true) expected:<..., animal1_.id as col_2_0_...> but was:<......>


JPALockTest.testLockModeTypeRead Failure isolation not maintained expected:<lock test> but was:<updated>

junit.framework.ComparisonFailure: isolation not maintained expected:<lock test> but was:<updated> at org.hibernate.test.jpa.lock.JPALockTest.testLockModeTypeRead(JPALockTest.java:89) at org.hibernate.junit.functional.FunctionalTestCase.runTest(FunctionalTestCase.java:101) at org.hibernate.junit.UnitTestCase.runBare(UnitTestCase.java:34) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.runTest(FunctionalTestClassTestSuite.java:100) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.run(FunctionalTestClassTestSuite.java:69)


IJ2Test.testUnionSubclass Error Null value was assigned to a property of primitive type setter of org.hibernate.test.legacy.J.amount

org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of org.hibernate.test.legacy.J.amount at org.hibernate.property.DirectPropertyAccessor$DirectSetter.set(DirectPropertyAccessor.java:83) at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:337) at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:200) at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3566) at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:129) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:854) at org.hibernate.loader.Loader.doQuery(Loader.java:729) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) at org.hibernate.loader.Loader.loadEntity(Loader.java:1860) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42) at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3044) at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:395) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:375) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:179) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808) at org.hibernate.test.legacy.IJ2Test.testUnionSubclass(IJ2Test.java:47) at org.hibernate.junit.functional.FunctionalTestCase.runTest(FunctionalTestCase.java:101) at org.hibernate.junit.UnitTestCase.runBare(UnitTestCase.java:34) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.runTest(FunctionalTestClassTestSuite.java:100) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.run(FunctionalTestClassTestSuite.java:69)Caused by: java.lang.IllegalArgumentException at java.lang.reflect.Field.set(Field.java:656) at org.hibernate.property.DirectPropertyAccessor$DirectSetter.set(DirectPropertyAccessor.java:79) ... 39 more


SQLLoaderTest.testReturnPropertyComponentRenameFailureExpected Error could not execute query

org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2223) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) at org.hibernate.loader.Loader.list(Loader.java:2099) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289) at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695) at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142) at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152) at org.hibernate.test.legacy.SQLLoaderTest.testReturnPropertyComponentRenameFailureExpected(SQLLoaderTest.java:446) at org.hibernate.junit.functional.FunctionalTestCase.runTest(FunctionalTestCase.java:101) at org.hibernate.junit.UnitTestCase.runBare(UnitTestCase.java:34) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.runTest(FunctionalTestClassTestSuite.java:100) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.run(FunctionalTestClassTestSuite.java:69)Caused by: java.sql.SQLException: Column not found: id2465_0_ at org.hsqldb.jdbc.Util.sqlException(Unknown Source) at org.hsqldb.jdbc.Util.sqlException(Unknown Source) at org.hsqldb.jdbc.jdbcResultSet.findColumn(Unknown Source) at org.hsqldb.jdbc.jdbcResultSet.getInt(Unknown Source) at org.hibernate.type.IntegerType.get(IntegerType.java:28) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:163) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:154) at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:1097) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:572) at org.hibernate.loader.Loader.doQuery(Loader.java:701) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) at org.hibernate.loader.Loader.doList(Loader.java:2220) ... 26 more


EagerKeyManyToOneTest.testLoadEntityWithEagerFetchingToKeyManyToOneReferenceBackToSelfFailureExpected Failure get()/load() caused overflow condition

junit.framework.AssertionFailedError: get()/load() caused overflow condition at org.hibernate.test.keymanytoone.bidir.component.EagerKeyManyToOneTest.testLoadEntityWithEagerFetchingToKeyManyToOneReferenceBackToSelfFailureExpected(EagerKeyManyToOneTest.java:134) at org.hibernate.test.TestCase.runTest(TestCase.java:242) at org.hibernate.test.TestCase.runBare(TestCase.java:308) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.runTest(FunctionalTestClassTestSuite.java:90) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.run(FunctionalTestClassTestSuite.java:69)


ReadOnlyTest.testReadOnlyOnProxiesFailureExpected Error Instance was not associated with the session

org.hibernate.TransientObjectException: Instance was not associated with the session at org.hibernate.engine.StatefulPersistenceContext.setReadOnly(StatefulPersistenceContext.java:1144) at org.hibernate.impl.SessionImpl.setReadOnly(SessionImpl.java:1841) at org.hibernate.test.readonly.ReadOnlyTest.testReadOnlyOnProxiesFailureExpected(ReadOnlyTest.java:63) at org.hibernate.junit.functional.FunctionalTestCase.runTest(FunctionalTestCase.java:101) at org.hibernate.junit.UnitTestCase.runBare(UnitTestCase.java:34) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.runTest(FunctionalTestClassTestSuite.java:100) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.run(FunctionalTestClassTestSuite.java:69)


NativeSQLQueriesTest.testCompositeIdJoinsFailureExpected Error No column name found for property [id.orgid] for alias [product] [select product.orgid as {product.id.orgid}, product.productnumber as {product.id.productnumber}, {prod_orders}.orgid as orgid3_1_, {prod_orders}.ordernumber as ordernum2_3_1_, product.name as {product.name}, {prod_orders.element.*} from Product product inner join TBL_ORDER {prod_orders} on product.orgid={prod_orders}.PROD_ORGID and product.productnumber={prod_orders}.PROD_NO]


UnionSubclassFilterTest.testFiltersWithUnionSubclass Error Could not execute JDBC batch update

org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253) at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:92) at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:87) at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:222) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2479) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2697) at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:74) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:146) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at org.hibernate.test.subclassfilter.UnionSubclassFilterTest.testFiltersWithUnionSubclass(UnionSubclassFilterTest.java:87) at org.hibernate.junit.functional.FunctionalTestCase.runTest(FunctionalTestCase.java:101) at org.hibernate.junit.UnitTestCase.runBare(UnitTestCase.java:34) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.runTest(FunctionalTestClassTestSuite.java:100) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.run(FunctionalTestClassTestSuite.java:69)Caused by: java.sql.BatchUpdateException: failed batch at org.hsqldb.jdbc.jdbcStatement.executeBatch(Unknown Source) at org.hsqldb.jdbc.jdbcPreparedStatement.executeBatch(Unknown Source) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246) ... 34 more


UnionSubclassTest.testUnionSubclass Failure N/A

junit.framework.AssertionFailedError at org.hibernate.test.unionsubclass.UnionSubclassTest.testUnionSubclass(UnionSubclassTest.java:307) at org.hibernate.junit.functional.FunctionalTestCase.runTest(FunctionalTestCase.java:101) at org.hibernate.junit.UnitTestCase.runBare(UnitTestCase.java:34) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.runTest(FunctionalTestClassTestSuite.java:100) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.run(FunctionalTestClassTestSuite.java:69)

UnionSubclassTest.testUnionSubclassManyToOne Error attempt to create delete event with null entity

java.lang.IllegalArgumentException: attempt to create delete event with null entity at org.hibernate.event.DeleteEvent.<init>(DeleteEvent.java:24) at org.hibernate.impl.SessionImpl.delete(SessionImpl.java:744) at org.hibernate.test.unionsubclass.UnionSubclassTest.testUnionSubclassManyToOne(UnionSubclassTest.java:260) at org.hibernate.junit.functional.FunctionalTestCase.runTest(FunctionalTestCase.java:101) at org.hibernate.junit.UnitTestCase.runBare(UnitTestCase.java:34) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.runTest(FunctionalTestClassTestSuite.java:100) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.run(FunctionalTestClassTestSuite.java:69)


Top
 Profile  
 
 Post subject: Failures and errors on Hibernate Junit test suite
PostPosted: Wed Jun 27, 2007 5:39 am 
Pro
Pro

Joined: Tue Jun 12, 2007 4:13 am
Posts: 209
Location: Berlin, Germany
Hi,

as I can see from your error logs, you were using HSQLDB for the tests. This non production DB produces the fewest errors I got when I ran the Hibernate test suite against different databases.

After all, I'm wondering, if there is any database which will produce no failures and no errors? And the next thing I would like to know: if it is not unusual for any database / JDBC driver that the tests produces some errors and failures, what is the significance and impact of these tests? Does it only show me what is not supported by the tested database / JDBC driver? Or does it mean that the tests themselves are problematic? I didn't have the time for a deep scan of the test suite code, but I know there a things which a doing some aggressivley things...

My test runs on the following databases produced:
- MySQL: 21 failures, 201 errors (runtime on my desktop PC: ca. 48 min)
- PostgreSql: 16 failures, 195 errors (runtime: ca. 49 min)
- Ingres: 22 failures, 94 errors (runtime: about 120 minutes; ConnectionTests where uncommented)
- MaxDB (SAP-Db): 18 failures, 199 errors (runtime: about 5 hours!)
- HSQLDB: 6 failures, 5 errors (runtime: ca. 17 minutes)

Some errors can be expected, i.e. because the used JDBC doesn't support a feature like scrollable cursors. Others leave me helpless; i.e. I had a lot of java.sql.BatchUpdateException errors with PostgreSql. And others may be avoidable if you are an expert on the used database...

So I would like to hear a clearification from you Hibernate guys what these results of the Junit suite really mean for different databases, different JDBC drivers - and for Hibernate itself?

Anyone who would like to comment?

Carlo


Top
 Profile  
 
 Post subject: Same errors with Oracle 10G
PostPosted: Tue Aug 21, 2007 3:18 pm 
Newbie

Joined: Tue Aug 21, 2007 2:45 pm
Posts: 1
I see 2 errors and 5 failures when running the test suite against Oracle 10G with Hibernate 3.2.5

    ASTParserLoadingTest.testParameterTypeMismatchFailureExpected
    java.lang.ClassCastException: java.lang.Integer

    CriteriaHQLAlignmentTest.testCriteriaAggregationReturnTypeFailureExpected
    java.lang.ClassCastException: java.lang.Integer

    org.hibernate.test.hql.HQLTest.testEmptyInListFailureExpected
    junit.framework.AssertionFailedError: Old query translator did not throw an exception, the new one did

    org.hibernate.test.hql.HQLTest.testMaxindexHqlFunctionInElementAccessorFailureExpected
    junit.framework.ComparisonFailure: SQL is not the same as the old SQL (scalar=true) expected:<...1_, ...

    org.hibernate.test.hql.HQLTest.testMultipleElementAccessorOperatorsFailureExpected
    SQL is not the same as the old SQL (scalar=true) expected:<...Simple onetomany1_, ...

    org.hibernate.test.hql.HQLTest.testKeyManyToOneJoinFailureExpected
    New query translator did *NOT* throw an exception, the old one did : org.hibernate.QueryException: BY expected after GROUP or ORDER: o [from Order o left join fetch o.lineItems li left join fetch li.product p]

    org.hibernate.test.hql.HQLTest.testDuplicateExplicitJoinFailureExpected
    SQL is not the same as the old SQL (scalar=true) expected:<..., animal1_.id as col_2_0_...> but was:<......>

These problems are the same issues that were found by kwrosha with HSQLDB.

I investigated the JDBC driver logs and did not see any specific points of failure that might be causing these issues.

I would also like to hear from anyone with in depth knowledge of the test suite.

David


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 21, 2007 6:11 pm 
Expert
Expert

Joined: Fri Jul 13, 2007 8:18 am
Posts: 370
Location: london
I'm also seeing test failures with my latest download (3.2.5.ga).
MYSQL: 6 failures, 14 errors
HSQLDB: 8 failures, 8 errors

Although I've not contributed to open source projects before, I'm a great fan of hibernate and have recently been a frequent poster on the users forum. These test failures have discouraged me from looking into potential patches for issues I've investigated.

Also, and this was raised on the users forum earlier today (http://forum.hibernate.org/viewtopic.php?t=978693), the notes on the hibernate website about building the trunk (latest svn version) are very out of date.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.