Reputation: 8322
i am using datasource in weblogic server and, using the datasource in Hibernate. With HibernateUtil class am getting the SessionFactory, now i want write test cases for my DAO layer by using JUnit.
is there any better way of writing test classes in this environment?
Upvotes: 1
Views: 1599
Reputation: 2118
You can get the datasource JNDI, using javax.naming.InitialContext. But I think wouldn't be a good idea make the test dependent on container (weblogic).
I had only 2 ideas:
Loading this test-file-configuration can be done using reflection or a mock.
Upvotes: 1