Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dali-dev] Unit Testing JPA..

Hi Marshall,

  I didn't do anything special to get the JUnit testing working.  I wrote some tests for Entities and a Stateless SessionBean that ran out of container.  The only thing we needed to do that was persistence provider specific was initializing things like the database connection.  The tests were ignorant of what the provider was.  They just went to Persistence to obtain an EntityManagerFactory for the persistence unit.  We demoed both Hibernate and TopLink runtimes with the tests no problem.  Max did the Hibernate config and I did the TopLink.  To make it possible to run the same tests with different providers what I did was put the Entities and tests in a project and then used a second and third project to "boot" the tests.  The second project put the TopLink  runtime at the front of the classpath. And the third put Hibernate at the front.  If you ran the tests from the TopLink project you got the TopLink runtime and if you used the Hibernate project you got the Hibernate runtime.

   Bottom line: I don't think we need to anything in the tooling right now to support testing but maybe I'm not understanding your point.

       Shaun

Marshall Culpepper wrote:
Hey guys..

I remember Shaun showing us a demo of how you guys had wrapped the unit testing stuff somehow for Toplink Essentials. I was curious if this was a facility that we could create an extension point for, or if this was just a custom implementation for Toplink? We have something similar for our embedded implementation and I wanted to see if we could easily integrate....



--
Marshall Culpepper
marshall.culpepper@xxxxxxxxx
JBoss Eclipse IDE Lead, JBoss Inc.

_______________________________________________ dali-dev mailing list dali-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/dali-dev

-- 
Shaun Smith
Principal Product Manager
Oracle TopLink
shaun.smith@xxxxxxxxxx

Back to the top