I am the writer of J2EEUnit and I feel that I have to answer to this
thread ... which of course pains me when I hear that J2EEUnit has a
stiff learning curve and that it's not that easy to use.
One thing that needs to be clear is that I am dedicated to making
J2EEUnit the simplest tool to use ! Also, it is open source and
anyone can participate in making it a better tool !
That said, let me explain a bit the philsophy behing J2EEUnit because
it seems it is not that clear. Let's see the assumptions that are
behing it :
- assumption 1 : the test classes need to run on the server side (in
the servlet engine),
- assumption 2 : we need to be able to start these tests. So there
are 2 solutions : make a servlet to start these tests or use an EJB.
I have chosen a servlet because it is easier to use and some servlet
engine do not support EJBs.
- assumption 3 : we have to be able to call this servlet. Several
possibilities : (1) call it manually by typing it's URL ore (2) write
some code that use the URLConnection class to call it. This is the
part that I call the client side. Of course, the option (2) seem to
be the best because tests can be automated and the result can be
verified (this is the endXXX() method). So we can verify if a cookie
was returned, if a header was set, ...
- assumption 4 : in order to make option (2) above more sexy to use,
I could have developed a GUI .... or integrate with an existing test
framework. I have chosen to use the well renowned JUnit framework
because everyone use it. So, the tests are started by JUnit.
And as far as I have seen, JunitEE and JUnitServlet work on the same
principle. Tell me if I am wrong here ?
If you have any idea to make it simpler please tell me. If I
understand you correctly, you would like that the current J2EEUnit
Servlet actually returns HTML code with the test results ? Is that
right ? This will free J2EEUnit from JUnit. It seems ok to me to also
provide this feature. What I could do, is provide another Servlet
that will display the result of the tests as HTML. The J2EEUnit user
will have the choice or using JUnit or calling directly the URL of
this other servlet in his browser. Would that make sense to you ?
Thanks a lot.