As far as I can understand this is great when we have EJB container in the same VM, any ideas on how it could be done when the EJB container is in its own separate VM. The EJB container might be on the localhost, or may be on a remote host.
I also saw something interesting on maven cargo plugin. This is a new plugin for me, but looking at how it could be plugged in into different IDE's, it might be an option to add support for OpenEJB for maven cargo ( http://cargo.codehaus.org/Maven2+plugin). Again, looking at the explanation, I am not sure this is required, but if somebody is using OpenEJB standalone, this might give them a quick IDE integration option. On Wed, Mar 5, 2008 at 4:13 AM, David Blevins <[EMAIL PROTECTED]> wrote: > > On Mar 4, 2008, at 11:17 PM, Manu George wrote: > > > What about this including a few mojos for doing container driven > > testing? I am not very conversant with how you can do container driven > > testing in openejb (need to read alexander's articles). However a > > maven plugin using which your ejbs will be tested during the build > > process would be nice option to have. > > Pretty much all the examples we have use container driven testing. > The only one that doesn't is examples/webapps/ejb-examples/. Most > have ant and maven build files. > > The basic maven howto is this: > > Step 1: Add this to your pom.xml > > <dependency> > <groupId>org.apache.openejb</groupId> > <artifactId>openejb-core</artifactId> > <version>3.0-SNAPSHOT</version> > <scope>test</scope> > </dependency> > > Step 2: Add an ejb-jar.xml file > > Make sure you have an src/main/resources/META-INF/ejb-jar.xml. A > simple one need only contain "<ejb-jar/>". > > Step 3: Test Setup > > protected void setUp() throws Exception { > Properties properties = new Properties(); > properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, > "org.apache.openejb.client.LocalInitialContextFactory"); > initialContext = new InitialContext(properties); > } > > > Done. That really is all there is to it. And, yes, I'm serious :) > And, yes, that is very cool. And, no, no other vendor does it quite > that simply -- they all need plugins ;) You can configure nearly > anything in the entire container (pool sizes, datasources, topics, > queues, etc.) via the InitialContext properties so you can setup > things exactly how you want them for that exact set of tests. > > The same process works for any build system or IDE or any app. The > biggest variance will be Step #1, i.e. adding OpenEJB to the > classpath, everything else is always the same. > > If you're a maven user you can generate an eclipse or intellij project > will already be setup and ready to go. If you're an ant user you have > to create your IDE's classpath by hand and it maybe frustrating > getting all the right jars in your IDE. It would be cool if there was > one big openejb jar that had all our deps in it for to make that easier. > > Regardless of how simple it is and how it can be done in any > environment without a plugin, I'm not opposed to the idea of having > openejb plugins for various environments. We might find ways to make > it even simpler or new things to offer people. > > -David > > -- Karan Singh Malhi
