[hibernate-dev] Unit test failures using the new metamodel

Gail Badner gbadner at redhat.com
Fri Aug 3 17:06:28 EDT 2012



----- Original Message -----
> From: "Hardy Ferentschik" <hardy at hibernate.org>
> To: "Gail Badner" <gbadner at redhat.com>
> Cc: "Hibernate hibernate-dev" <hibernate-dev at lists.jboss.org>
> Sent: Friday, August 3, 2012 4:39:31 AM
> Subject: Re: [hibernate-dev] Unit test failures using the new metamodel
> 
> 
> On 3 Jan 2012, at 10:14 AM, Gail Badner wrote
> 
> > I've pushed a commit that takes care of these and changes the
> > default for both flags to true.
> 
> Cool, even though I would have expected that the build completes
> after the push. Anyways, ...
> 
> > VersionedLobTest.testVersionUnchangedByteArray is marked as
> > @FailureExpected but it incorrectly passes using the new
> > metamodel, so you'll see this test failing now due to
> > FailureExpectedHandler$FailureExpectedTestPassedException.
> 
> This one beats me. What do you mean it passes incorrectly? Switching
> to the new metamodel the test passes which would indicate to me
> that this test was fixed as a side effect of all metamodel work. If
> you are saying it passes wrongly, then the test itself must be based
> on wrong
> assertions. What is it?

I am not convinced that the metamodel work fixes this. I could be wrong, but AFAIK, HHH-5811 is still an issue. I can see where the assertions can be indeterminate. I've pushed a commit to make them determinate. It still passes with the new model, but fails with the old metadata (with -Dhibernate.test.new_metadata_mappings=false -Dhibernate.test.validatefailureexpected=true). 

My preference would be to keep @FailureExpected on this test, but I know this starts to complicate when we add/remove annotations.

Hopefully, if it really should fail, we'll find out soon when more work is done.

> 
> > In addition, these tests fail:
> > 
> > Test org.hibernate.test.annotations.interfaces.InterfacesTest
> > FAILED
> > Test
> > org.hibernate.test.annotations.idmanytoone.alphabetical.AlphabeticalIdManyToOneTest
> > FAILED
> > Test
> > org.hibernate.test.naturalid.mutable.cached.CachedMutableNaturalIdTest
> > FAILED
> 
> As I said before, the problem is that
> @FailureExpectedWithNewMetamodel is not honored by
> BaseCoreFunctionalTestCase when
> an error occurs in the setup (BeforeClass handlers). We could try to
> address this in BaseCoreFunctionalTestCase, but in this case I
> decided
> to move BaseAnnotationBindingTestCase into the testing module and
> make it the base class for these tests. I was using this base class
> for
> testing some annotation based binding tests and it is imo much more
> suitable for the tests above.

Thanks for addressing the tests using annotations. 

> 
> Right now we have the hibernate-core module passing with the new
> metamodel enabled and the expected failures validated. Hopefully we
> can
> keep it this way.

I chatted with Strong about CachedMutableNaturalIdTest.testChangedNaturalIdNotCachedAfterTransactionFailure and it really does look like a regression. It should work with the new metamodel so, IMO, it should not be annotated with @FailureExpectedWithNewMetamodel. He said he would look into it.

Gail

> 
> --Hardy


More information about the hibernate-dev mailing list