This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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?
Joined: Feb 25, 2007
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.