David Blevins wrote:
On Nov 26, 2007, at 11:26 AM, Paul Spencer wrote:
David,
To summarize things:
Relative to testing EJBs inside a Maven executed JUnit test, any
object instantiated by a class inside a JUnit test case is not
"container managed" thus the object will not receive the benefit of
DI. EJB known to the embedded EJB container, ejbd in this case, and
instantiated within that container will receive the benefit of DI, but
the beans must be retrieve by the test class via a JNDI lookup.
Now I can stop beating my head against the wall :)
Right :)
What I was just typing up in another email is that we would like to find
some way to support what you were trying to do; a standard JUnit
TestCase subclass with dependency injection annotations.
<snip>
Would something like that work for you or is the knowledge that the test
case would be relying on something outside the (current) EJB spec enough
to make those lookups look not so bad?
Right now just the knowledge of how things work is enough.
-David
Paul Spencer