At 10:26  2/4/01 -0400, Geir Magnusson Jr. wrote:
>"Craig R. McClanahan" wrote:
>> >
>> One potential problem with this location (assuming the classes you are
>> testing are in org.apache.velocity) is that your tests will not have
>> access to package-private methods or variables.  If you put the tests in
>> the same directory (/src/java/org/apache/velocity) or a parallel directory
>> with the same package structure (/src/test/org/apache/velocity) you can
>> avoid this difficulty.
>> 
>
>That's true.  I was thinking about the 'motivational' aspect of the
>discussion when I wrote that, not the package issue.  This is a good
>point, and is a nice trick, the parallel package trees.
>
>However, 
>
>/src/java/org...
>/src/test/org...
>
>is a bit odd, not symmetric, in that the test tree is also java. (I like
>symmetry...)

Regarding functional names (ie test) vs structural names (ie java) I think
it should be up to individual project. You will always be possibility of
new dimensions in there. ie Avalon currently also uses src/compat for code
thats only use is backwards compatibility, other projects I have seen have
things like src/client (for client API) etc.

>I don't have a solution - I am a lousy namer.  I will try anyway...
>
>/src/java/src/org..
>/src/java/test/org..
>
>/src/java/???/org...
>/src/java/test/org...

Nice in theory - terribly in practice. It assumes that there is one primary
dimension (ie java) and multiple secondard dimensions. What happens when we
add a "compat" directory or "client" directory. We could end up with 

/src/java/test/client/compat/org..
/src/java/test/client/current/org..
/src/java/test/server/compat/org..
/src/java/test/server/current/org..
/src/java/???/client/compat/org..
/src/java/???/client/current/org..
/src/java/???/server/compat/org..
/src/java/???/server/current/org..

etc. It is much better IMHO to just have
src/java
src/compat
src/client
src/myfunction
src/mystructure

but YMMV.
Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*

Reply via email to