I have a java application with Hibernate as ORM. Now is time to test the application. I want to use Junit (I used time ago and I thought I knew how its works :s). The first problem I find is creating an instance of a DaoImpl class where the method which retrieve data is (and I want to test this method). The error I got doing "new" is: java.Lang.ExceptionInitializerError. I think its come because of the class of the instance has Hibernate classes, try to connect to the DataBase and so on... and probaly I cannot create a instance of this class as easy because of hibernate in back.
If this, can annyone give a reference to configure for junit works with Hibernate. I find Hiberante with Spring. Is not valid to me because spring is not implemented in my application.
thanks all!!
|