Not too much is required to run those tests in OpenEJB 3.

The basic thing is that the test suite is a JUnit app that maven2 will run like any other test via the surefire plugin. So generally running unit tests against your ejbs in OpenEJB requires no extra work and the concept of an "itest" no longer exists strictly speaking.

This example shows an EJB that's compiled and unit tested via Maven2 and OpenEJB with no extra steps than any other Maven2 projects. You don't even need any extra OpenEJB-specific plugins.

http://svn.apache.org/repos/asf/incubator/openejb/trunk/openejb3/ examples/helloworld-stateful-pojo/

Now, our grueling set of tests that check our dear OpenEJB for basic EJB compliance are a slightly different breed. When they were originally written we extended JUnit a bit so we could have a "setUp" and "tearDown" hook that could apply to the entire test suite (used for starting stopping the server and database), and another mod that made it so on a per test basis "setUp" would be called once, each test method would be invoked in order on the same Test instance, then "tearDown" would be called and the Test instance discarded. Regardless, the tests themselves are still JUnit tests at heart.

We still call these tests "itests" because of the extra suite-wide startup/shutdown steps need to run the tests. But in the end we were able to run them as normal JUnit tests, for the most part. We still don't have them running as part of the build when you run the assemblies. Haven't figured that part out yet. Best I've been able to come up with is a set of jelly/ant (i.e. maven1) scripts that unpack and start the final server assembly, run tests, then shut everything down. This works but it would be nice to have something more maven2 integrated.

Anyway, here's my initial doc contribution as requested. Will delve into more detail as further requested :)

-David


On Nov 20, 2006, at 3:58 AM, Jacek Laskowski wrote:

Hi,

I've been following the conversations around iTests and have even
committed some changes of Mohammad and Manu, but there's nothing more
than this. I can't find any documentation about how to write an iTest
and have it run as part of the suite. So, I'd like to solicit any
information about it, test it out and finally write a doc about the
steps involved.

What are your steps writing iTests? Share every detail involved, every
awkward step you're forced to do to write a iTest. Everything. I'd
like to find out as much as I can and eventually come up with some
ideas how to improve it. I don't mean only iTests alone, but the whole
machinery to execute them.

There's been a couple of requests for the ways to contribute and I
think the subject might be of interest.

Jacek

--
Jacek Laskowski
http://www.jaceklaskowski.pl


Reply via email to