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

Hardy Ferentschik hardy at hibernate.org
Fri Aug 3 20:09:31 EDT 2012


On 3 Jan 2012, at 11:21 PM, John Verhaeg wrote:

> 
> On Aug 3, 2012, at 6:39 AM, Hardy Ferentschik wrote:
> 
>> 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.
> 
> Again, not sure why you're saying this.  The annotation is indeed honored in the setup.   That's where most of the errors where occurring before the annotation was applied.

It is NOT! Not for the org.hibernate.testing.junit4.BeforeClassCallbackHandler:

	public void evaluate() throws Throwable {
		try {
			runner.getTestClassMetadata().performBeforeClassCallbacks( runner.getTestInstance() );
		}
		catch (CallbackException e) {
			// be nice to see the exception. but junit seems to be eating it...
			log.error( "Before class callback error : " + e.getLocalizedMessage(), e );
		}
		wrappedStatement.evaluate();
	}

the code in question throws a CallbackException which should gets logged and things move on. Take a debugger and step through it if you don't believe me.

> 
>> 
>> 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.
> 
> Until we finish work on the metamodel, it's still going to be important to run the tests twice, once with the metamodel flag on, once off, and check in only if there are no errors for either run.

-1 I don't think so. What do the others think?

--Hardy


More information about the hibernate-dev mailing list