aspose file tools
The moose likes Testing and the fly likes OpenEJB + JUnit + Ant Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Reply Bookmark "OpenEJB + JUnit + Ant " Watch "OpenEJB + JUnit + Ant " New topic
Author

OpenEJB + JUnit + Ant

Marcus Didius Falco
Ranch Hand

Joined: Feb 25, 2007
Posts: 72
I have recently begun to write JUnit Tests for EJBs using OpenEJB.
From within Eclipse it works like a charm.

However cannot make it work from my Ant Script.
In the examples supplied with OpenEJB it stated that:
"As long as OpenEJB and it's required libraries are in the
<junit> classpath, the tests will run with OpenEJB embedded."

I don't think my tests run with OpenEJB embedded, because the tests fail for every class which uses dependency injection:


My ant script:


The classpath used for running the Junit test is (from the echo in target "test")

Clearly the OpenEJB jars are in the classpath.

Any ideas what I am doing wrong?

Many thanks,

Hans
Marcus Didius Falco
Ranch Hand

Joined: Feb 25, 2007
Posts: 72
I found out for myself:

You have to copy the META-INF directory with ejb-jar.xml into the build directory of your project classes.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: OpenEJB + JUnit + Ant
 
Similar Threads
Am I doing unit test right?
Problem when including unit test cases in build
Ant+JUnit
Juint task in Ant
Ant build fail, sometimes 'cause ant forgets property