Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Over the years, OpenEJB has innovated the art of the embedded/Java SE EJB container usable as a plain library much the way an embedded databases work. In a simple 1, 2, 3 step of 1) add OpenEJB to your classpath, 2) add a META-INF/ejb-jar.xml containing at minimum "<ejb-jar/>", then 3) use the org.apache.openejb.client.LocalInitialContextFactory when creating your client InitialContext and , you've got a Java SE EJB container that can be used in unit tests, your IDE, or anyway you'd like to drop in EJB functionality. Configuration can be done through an openejb.xml file or can be encapsulated 100% in the test case through the parameters passed to the InitialContext. For example, to create a JTA DataSource for JPA usage, you can simply:

...