TestNG and Spring 3 TestNG and Spring 3 spring spring

TestNG and Spring 3


Your test ckass needs to extend AbstractTestNGSpringContextTests. Or if your code is testing database acces another useful class to extend is AbstractTransactionalTestNGSpringContextTests.


Now the problem doesn't seem to be related to any of Spring or TestNG. The key part is:

 java.lang.IncompatibleClassChangeError: class org.hibernate.cfg.ExtendedMappings has interface org.hibernate.cfg.Mappings as super class

Are you sure your CLASSPATH is OK? I.e. you have compatible version of Hibernate modules and no repetitions there?

What if you create a simple TestNG test that does the following:

Class.forName("org.hibernate.cfg.ExtendedMappings");

?


Consult the chapter on TestNG in the Spring documentation: