openejb-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacek Laskowski" <ja...@laskowski.net.pl>
Subject Re: Problems getting EJB via annotation in test class.
Date Mon, 26 Nov 2007 20:07:03 GMT
On Nov 26, 2007 8:26 PM, Paul Spencer <paulspencer@mindspring.com> wrote:

> 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.

Exactly. Nice we got it straightened out ;-) I wonder if we could
introduce a feature to help people run annotated tests. I think the
only way to achieve it would be to run the tests with a java agent
that would intercept test class loading. Any other ideas?

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Mime
View raw message