Hi,
I will do this shortly. However, I am right now wrapping version 0.8 of
J2EEUnit which adds new nice features that will help a lot testing Struts
(see the J2EEUnit changelog in CVS if you wish to know the list of changes
so far for version 0.8).
To tell the truth, I have looked at Struts ActionServlet class to see if
J2EEUnit 0.7 would be able to unit test it ... and found that it had some
shortcomings and that one would need to modify the ActionServlet code to be
able to unit test it ... which is of course not acceptable ... So, I found
solutions and added these in version 0.8 of J2EEUnit. I have also added
limited support for testing custom JSP tags but this is still beta (I am
still not sure if unit tests are relevant for tag libraries. It seems to me
that functional tests are much better suited for that) .
Action plan :
- Release version 0.8 I hope today (7/3) or tomorrow (8/3),
- Go on holiday (I'm leaving today for a week) ! I'll work on some Struts
unit tests during that time (I'll try to do a comprehensive test suite for
ActionServlet and some others). I won't have access to internet so I'll work
locally on my laptop
- On my return (14/03), I'll put in CVS my work and will work with Rob to
finalize the directory structure and Ant build script to run the tests for
several servlet engines
- Then it will be up to anyone to help write other test cases using the one
written as sample on how to do it.
How does that sound ?
Thanks a lot.
P.S.: Sorry for not doing this faster but I can only work during parts of
the weekends (the other part I have to devote to my wife and kids ... :) ).
However, I'll try my best not to slow you guys down :)
Best regards,
Vincent
----- Original Message -----
From: "RAP" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 06, 2001 10:58 PM
Subject: RE: PROPOSAL - Testing Framework
> Hi Vincent,
>
> Any further news on Struts unit testing with J2EEUnit? Would you post a
> sample?
> I would like to see J2EEUnit in action testing the example that ships with
> Struts.
>
> Thanks for your time,
>
> RAP
>
> > -----Original Message-----
> > From: Vincent Massol [mailto:[EMAIL PROTECTED]]
> > Sent: 20 February 2001 09:45
> > To: [EMAIL PROTECTED]
> > Subject: Re: PROPOSAL - Testing Framework
> >
> >
> > +1
> >
> > Great idea ! :)
> >
> > I am the author of J2EEUnit (http://j2eeunit.sourceforge.net) and I'm
> > committed to help you implement this suite of tests. I have already been
> > implementing such a suite of tests for J2EEUnit itself and thus I
> > know very
> > well how to integrate it with Ant (actually I already have the build.xml
> > that starts J2EEUnit tests). I have successfully created a build.xml
file
> > that run the tests on several servlet engines : Tomcat 3.1.1,
> > Tomcat 3.2.1,
> > Tomcat 4.0, Resin 1.2, Resin 1.3, Orion 1.4, WebLogic 5.1 ...
> > That may be a
> > good idea for Struts to run its unit tests on several Servlet
> > engines. It is
> > very easy to do ! I also have an Ant task that let you start any servlet
> > engine in another thread, waits until it is finished starting and run
the
> > unit tests (it is still in CVS for the moment but I'll release a new 0.7
> > version this coming week end).
> >
> > Let me know where I can help. Also if you have any trouble to use
J2EEUnit
> > on any subject feel free to contact me and I'll help.
> > Thanks.
> >
> > Note: You should use the 0.7 version as much as possible as in
> > the previous
> > version it was not possible to test any method that wrote in the Servlet
> > output stream. It now works fine in version 0.7 (in CVS).
> >
> > Vincent Massol.
> >
> > ----- Original Message -----
> > From: "Rob Leland" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, February 19, 2001 7:36 PM
> > Subject: PROPOSAL - Testing Framework
> >
> >
> > >
> > > I would like to add some additional Unit tests to the struts
> > > framework.
> > > These would be tests for struts itself, not end user code.
> > > My thoughts are that as struts evolves and new functionality
> > > is added we want to verify that other functionality is not
> > > broken, as code is changed and refactored.
> > >
> > > I am proposing using JUnit 3.5 (http://junit.sourceforge.net/) and
> > > J2EEUnit (J2eeunit.sourceforge.org). I am going to force
> > > myself to do this in an upcoming project at work, and believe it
> > > makes sense to do it in struts also.
> > >
> > > I am targeting the 1.1 release time period. If Unit
> > > testing is approved, some small set of tests may make it into
> > > the struts 1.0 release, again assuming people here vote for its
> > > inclusion.
> > >
> > > My initial thoughts for providing testing is to start with the
> > > private methods of struts starting with the
> > > struts.action package,
> > > then later develop tests for the public methods of struts.action.
> > > I didn't want to start another package until I finished the majority
> > > of the private methods, only because I would need to debug
> > > my unit tests, and only by developing tests for some of the private
> > > methods the public could I do this.
> > >
> > >
> > > Then other packages would follow :
> > > struts.upload,
> > > struts.util,
> > > struts.digester,
> > > struts.actions,
> > > struts.taglib.X
> > >
> > > In about that order, only because that would be a usefull order for
me
> > > in the project I am working on. Infact, I only have plans to do
> > > struts.upload, and
> > > struts.util, and doubt I would have the time to produce tests for
the
> > > other packages.
> > >
> > >
> > > Thoughts ?
> > >
> > >
> > > -Rob
> > >
> > >
> >
>
>
>