title: what's the "correct" way to write a JUnit test against an EJB?
body: <p>I'm using IBM RAD 7 (aka Eclipse 3.4) and WebSphere 7.</p>
  
  <p>I have an EJB project that contains an <code>@Stateless EntityService</code> and an <code>@Stateless EntityDAO</code> and so on.</p>
  
  <p>I have an Web project that contains a JAX-RS restful web service that looks up the EntityService with this JNDI URL:</p>
  
  <pre><code>ejblocal:entityEAR/entityEJB.jar/EntityService@com.test.EntityServiceLocal
  </code></pre>
  
  <p>That all works great.</p>
  
  <p>My question is, what would be the "correct" way to write <strong>JUnit</strong> tests to test the <code>EntityService</code> and <code>EntityDAO</code> classes?  </p>
  
  <p>Since the system needs to be running in the WebLogic server to function, I thought I would get the app running, then launch the JUnit test which does a look up of the same JNDI that the web service is using, but I get an error: </p>
  
  <p><code>Naming Manager ... getURLContext cannot find the factory for this scheme: ejbLocal</code></p>
  
  <p>Any suggestions are useful, how should I approach writing JUnit tests?</p>