Hi David, Great advice, I can see the problems associated with a 20..30 second 'embed+launch+deploy+test' method vs the 1..3 second 'ejb context creation+test' method of OpenEJB. Considering this, (for anyone reading) I think its important to distinctly recognize these as two distinctly separate testing methods. Both have a legitimate reason for existing, but like anything both are "fit for purpose". I would expect to see the 1..3 second 'ejb context creation+test' method bound to the default profile's test phase and the 'embed+lanuch+deploy+test' method bound to the integration-test as a profile/plugin that will run on the CI server.
I'm repeating myself here.. but for reference... ...the openejb-examples-3.1.4.tar.gz<http://www.apache.org/dyn/closer.cgi/openejb/3.1.4/openejb-examples-3.1.4.tar.gz> > and > openejb-examples-3.1.4.zip<http://www.apache.org/dyn/closer.cgi/openejb/3.1.4/openejb-examples-3.1.4.zip> > from http://openejb.apache.org/download.html contain "simple-mdb" and > "simple-mdb-with-descriptor" examples that are both maven projects. Thanks OpenEJB ppl, examples are often worth their weight in gold! I'll have to peruse integration testing next :) --AH On Mon, Apr 11, 2011 at 7:02 PM, David Blevins <[email protected]>wrote: > > On Apr 11, 2011, at 8:04 AM, Andrew Hughes wrote: > > > Thanks to both of you. > > > > The OpenEJB solution seems very clean, the > > openejb-examples-3.1.4.tar.gz< > http://www.apache.org/dyn/closer.cgi/openejb/3.1.4/openejb-examples-3.1.4.tar.gz > > > > and openejb-examples-3.1.4.zip< > http://www.apache.org/dyn/closer.cgi/openejb/3.1.4/openejb-examples-3.1.4.zip > > > > from http://openejb.apache.org/download.html contain "simple-mdb" and > > "simple-mdb-with-descriptor" examples that are both maven projects. > > > > This might be enough for me to get integration tests working, however... > > > > I would also like to persue embedded container deployment (such as > Glassfish > > and/or JBoss... or ?????). > > Note that the Embedded EJBContainer API came from the OpenEJB > InitialContext embedding approach. At the spec level we almost went with it > as-is but decided since we were going to make it an official part of the > spec, we might as well have control over the interfaces (InitialContext is a > different spec group). So we ended up with > 'EJBContainer.createEJBContainer(Map).getContext()' instead of 'new > InitialContext(Hashmap)'. > > I'm not sure if either of those support MDBs as anything JMS related is not > part of EJB Lite and therefore not an embedded requirement. > > Speed wise there still seems to be a big gap. Based on this netbeans > howto[1] it looks like Glassfish is in the 23 - 31 second range to run a > test. OpenEJB is in the 1, 2 and 3 second range[2][3]. > > [1] http://netbeans.org/kb/docs/javaee/javaee-entapp-junit.html > [2] https://gist.github.com/913283 > [3] https://gist.github.com/913286 > > > > I am not sure if http://www.jboss.org/arquillian is > > a good solution or not, I'll look at this when the openejb solution is > > working. > > I like what the Arquallian guys are doing. It isn't a container so you'd > still need one of those. It's more a second attempt at something like > Codehaus Cargo. > > Though I will note that if OpenEJB is the embedded container you end up > using, you will get better test case injection support using OpenEJB > directly. Though their OpenEJB adapter digs quite deep into OpenEJB > internals so that could easily be improved. > > > -David > > > > On Mon, Apr 11, 2011 at 3:53 PM, Aldrin Leal <[email protected]> wrote: > > > >> To test an MDB you need a container. > >> > >> Either wrap as an integration test (probably using FailSafe) and/or, > better > >> yet: Use OpenEJB and plain JUnit for that. > >> > >> -- > >> -- Aldrin Leal, <[email protected]> / > http://www.leal.eng.br/mnemetica/ > >> > >> > >> > >> On Mon, Apr 11, 2011 at 1:16 AM, Andrew Hughes <[email protected]> > wrote: > >> > >>> Howdy, > >>> > >>> I want to be able to check that the MDB's created actually execute and > >>> behave as expected. > >>> > >>> For reference, the EE5 tutorial ( > >>> http://download.oracle.com/javaee/5/tutorial/doc/bnbpq.html) covers > two > >>> equivalent "tests" : > >>> > >>> - *Building, Deploying, and Running the simplemessage Application > Using > >>> NetBeans IDE* > >>> - *Building, Deploying, and Running the simplemessage Application > Using > >>> Ant* > >>> > >>> I can't work out how this is best done in Maven (because surprise, > >>> surprise, > >>> the NetBean's ant scrips are less than intuitive) and I can't find any > >>> doco > >>> examples on this. > >>> > >>> Help would be excellent :) > >>> > >>> Cheers. > >>> > >> > >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
