| Author |
Testing jpa part
|
Olivier Scalbert
Greenhorn
Joined: May 07, 2004
Posts: 25
|
|
Hello,
I am currently developing a JSF web app that uses services provided by a stateless session bean, that acts as a facade.
This session bean delegates to different pojos.
One of these pojos encapsulates all the JPA stuff. It uses an injected Persistent Context
@PersistenceContext(unitName = "myPU")
Everything work fine.
Now I would like to do some testing around this JPA pojo.
I woulld to use junit as all my other pojos are tested with junit.
But how can I do that ?
From my tests (out of container), how can I create a persistent manager based on the persistent unit name ?
I am using netbeans + glassfish.
Thanks for your help,
|
 |
Reza Rahman
author
Ranch Hand
Joined: Feb 01, 2005
Posts: 559
|
|
Olivier,
Have you looked into embedded GlassFish? It can be used inside JUnit.
Regards,
Reza
|
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
|
 |
Olivier Scalbert
Greenhorn
Joined: May 07, 2004
Posts: 25
|
|
Thanks for the info, Reza
I will have a look to embedded glassfish.
By the way I have your book opened on my desk !!!
;-)
Olivier
|
 |
Reza Rahman
author
Ranch Hand
Joined: Feb 01, 2005
Posts: 559
|
|
Olivier,
Good to hear :-). I hope that it is helping. Do let me know if you have questions or comments. I can be reached here: reza_rahman@lycos.com. I can put it on the plan for the second edition.
Cheers,
Reza
P.S.: If you get a chance, please do consider writing a review on Amazon or elsewhere. It really helps us out :-).
|
 |
 |
|
|
subject: Testing jpa part
|
|
|