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

Gail Badner gbadner at redhat.com
Thu Aug 2 20:39:37 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: Wednesday, August 1, 2012 11:26:40 PM
> Subject: Re: [hibernate-dev] Unit test failures using the new metamodel
> 
> 
> 
> 
> 
> On 2 Aug 2012, at 07:56, Gail Badner <gbadner at redhat.com> wrote:
> 
> > I'm seeing the following failures using
> > hibernate.test.new_metadata_mappings=true that appear to be
> > regressions:
> > 
> > - org.hibernate.jpa.test.connection.DataSourceInjectionTest fails
> > (also fails using the old metadata);
> > - org.hibernate.test.annotations.lob.LobTest.testSerializableToBlob
> 
> Don't know anything about the others, but LobTest is no regression.
> The tests did now work at all before, because building the sources
> would fail. This works now and now the test fails on the last
> assert. Some behavior in the engine must have changed. We can
> annotate this particular test with @FailureExpectedWithNewMetamodel
> or maybe you know what the problem is directly.

OK, I'll annotate org.hibernate.test.annotations.lob.LobTest with @FailureExpectedWithNewMetamodel.

> 
> > Also, there were numerous failures in hibernate-core when building
> > with hibernate.test.validatefailureexpected=true, which validates
> > that those tests annotated with @FailureExpected or
> > @FailureExpectedWithNewMetamodel actually fail. If an annotated
> > test does not fail as expected,
> > org.hibernate.testing.junit4.FailureExpectedHandler$FailureExpectedTestPassedException
> > is thrown causing the test to fail.
> 
> That flag should be the default. Why is it not turned on? In which
> case does it make sense to have this flag set to false?

IIRC, there were some tests that were annotated with @FailureExpected that were only expected to fail using some dialects. This was causing what looked like failures on the dialects where the test was expected to pass. When we were trying to clean up the test failures for the tested dialects, either hibernate.test.validatefailureexpected was introduced or the default for hibernate.test.validatefailureexpected was changed to false. Steve might remember exactly why this was done.

In any case, this is hindering more than helping when we're trying to get things working with the new metamodel.

> 
> > When hibernate.test.validatefailureexpected is false (the default),
> > the result from FailureExpected tests is simply ignored.
> 
> :-(
> 
> > I've gone ahead and pushed a fix that removes
> > @FailureExpectedWithNewMetamodel from those tests that succeed
> > without the annotation.
> > 
> > There are 2 tests where this does not work:
> >    org.hibernate.test.annotations.interfaces.InterfacesTest
> >    org.hibernate.test.annotations.idmanytoone.alphabetical.AlphabeticalIdManyToOneTest
> > 
> > These tests fail with org.hibernate.cfg.NotYetImplementedException
> > when the sources are being processed. For some reason. this
> > failure is not recognized as an expected failure. I'm not sure of
> > the reason for this.
> 
> Probably because it happens I'm the setup phase and not during the
> test execution.
> 

Is there a way to shift the failure so it happens during test execution so it would be handled properly?

> > It seems that now would be a good time to make both
> > hibernate.test.new_metadata_mappings=true and
> > hibernate.test.validatefailureexpected=true the default when
> > building.
> 
> +1

Agreed. I'll look into making these changes.

Thanks,
Gail

> 
> --hardy


More information about the hibernate-dev mailing list