users@glassfish.java.net

Re: Obtain embedded EJB container EntityManager in TestNG test

From: <glassfish_at_javadesktop.org>
Date: Mon, 01 Mar 2010 06:35:55 PST

No, it's not possible to get a container-managed EE resource directly from the test code itself. The test code class is not an EJB component so it doesn't have access to a Java EE environment. The easiest workaround is to write an EJB component that does the query.
[Message sent by forum member 'ksak' (kenneth.saks_at_sun.com)]

http://forums.java.net/jive/thread.jspa?messageID=389377