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