File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes How to use JUnit and EJB3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How to use JUnit and EJB3" Watch "How to use JUnit and EJB3" New topic
Author

How to use JUnit and EJB3

Georg Joo
Ranch Hand

Joined: Feb 24, 2004
Posts: 49
Hi

I want to test my EJB3 with JUnit. But I get allways following error :



The setup methode looks like :



My persistence.xml :


What can I do ? Where is the right place for the persistence.xml file ?


SCJP, SCWCD, SCBCD<br /> <br />Vienna, Austria
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9317
    
109

I havent worked with EJB3 much, but EJBs are server side components and they cannot be tested with JUnit. You might have to use Cactus instead, which is very similar to JUnit but allows you to test server side components.


[My Blog] [JavaRanch Journal]
Georg Joo
Ranch Hand

Joined: Feb 24, 2004
Posts: 49
Hi

I have the book "Pro EJB 3" of Apress. There is a description to test EJB3 with JUnit. It schoud be possible.

But I will take a look to Cactus.

Thanks
Georg


 
wood burning stoves
 
subject: How to use JUnit and EJB3
 
Similar Threads
problem in pro EJB3 chapter 2 code
hibernate persistence.xml question
I'm trying to build a JPA application , but i am getting an error NoClassFound
Working with DataNucleus: How I solved the "No persistence providers available" problem.
JPA not working with EJB3