I am now looking at Struts in order to write the test suite (I have only
looked at build.bat and build.xml so
far ...) and I have notice the following details that may need to be
corrected/improved :

1- In build.bat, the CP variable does not define an XML parser.
%ANT_HOME%\lib\jaxp.jar and %ANT_HOME%\lib\parser.jar should be added. Or,
is that voluntarily because you want to leave the choice to the developer to
choose his one jaxp compliant parser ? Personnaly, I prefer to force it to a
choice that will always work. I prefer to leave my CLASSPATH always empty
because otherwise it creates lots of problems when you switch from one
project to another ...

2- In build.bat, the CP variable adds %ANT_HOME%\lib\ant.jar (and
optional.jar) but in the jakarta-ant distribution that I got using CVS, the
ant.jar and optional.jar are generated and put in dist\lib.

3- Is that an Apache choice not to bundle the needed external jars within
your own project ? I would tend to prefer to bundle ant
jars and servletapi jars for Struts because (a) they are only used to build
struts, not for runtime and (b)otherwise the building of struts will fail or
succeed depending on the state of these other projects, thus you might get
lots of posts on the mailing list from persons trying to build Struts but
failing just because they have a bad version of Ant for instance (I speak
from experience as for J2EEUnit I tried several Ant release and I can tell
you they were not all working, far from that, and I had to struggle to find
the good one. At least I know that the one I bundle is going to work with no
problem and from time to time I upgrade it. In other words I certify my app
to work with such version. However if the enn developer want to use a
newer/older version, he is free to try it ...). Thoughts ? (Sorry if this
way of doing it has already been discussed at length ... :( )

4- build.xml need more comments, better formatting and some minor additional
refactorings (to my opinion). Am I allowed to do that ?

5- What do you think about creating a build directory where you put the
files that are needed to run the build of struts. They would be : build.xml,
build.bat, all Ant jars (that's only if you agree with point 3 of course ...
:) ), maybe some other batch files to help start other targets from Windows.
The output of the build will go in a directory named out/ for example (I
have always found the name build/ for the output to be confusing. It means
"a build" but also "to build" ...)

6- If you agree on point 3, creating a lib directory at the top level to put
the servletapi jar would be a good idea. Also I need to put the j2eeunit +
junit jars. Putting them in lib/ would be a good idea I think.

7- Why do you have a conf/ directory under src ? Wouldn't you prefer it to
have
at the top level (or is it a Jakarta requirement) ? Something like :

jakarta-struts
  |_ out (generated by the build script)
  |_ build
  |_ conf
  |_ doc
  |_ src
    |_ example
    |_ share
    |_ test
  |_ web

8- I'd like to use the src/test/ directory to put the struts unit tests.
What is the already existing test directory ? Was it done for that purpose ?

9- I'd like to create a test/ subdirectory un conf/ where I'll put all the
configuration files needed for the struts unit tests. Is that ok?

10- The strategy I have followed with J2EEUnit for it's tests was to run the
tests in the out/ directory, i.e. not deploy to the servlet engine install
directory. I like to control the files that I generate. By being located
under out/, they (a) are easy to clean up, (b) do not affect any other
webapp running on my system, (c) I can use the setting I want for my servlet
engine for the tests without affecting the main config of my servlet engine.
I would suggest the following directory hierarchy :

jakarta-struts
  |_ out
    |_ tests
      |_ tomcat-3.2
        |_ conf
        |_ webapps
        |_ work
      |_ tomcat-4.0
        |_ ...
      |_ resin-1.2
        |_ ...
      |_ ...
  |_ conf
    |_ test
      |_ j2eeunit.properties
      |_ tomcat
        |_ testserver-3.2.xml
        |_ testserver-4.0.xml

11- Does Struts support only one servlet api at a time (like the 2.2 one) or
is it your plan to support several, like 2.2 and 2.3 ?

Please feel free to discard anything that I have said that does not fit your
plan. I understand that I am new here ... However, I just wanted to let you
know my thoughts in case I bring forward something that can improve Struts.

Tell me what you think of these and tell me how I have to proceed for
building the test suite ? Do I
change the files and send the to you by email ? What can I apply from the
above mentionned points ? Is there a CVS branch that I
should work on instead of the main one ?

Thanks.
Vincent.





Reply via email to