• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OpenEJB + JUnit + Ant

 
Markus Schmider
Ranch Hand
Posts: 130
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Markus Schmider
Ranch Hand
Posts: 130
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic