ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Quail <>
Subject Re: another unit-test question
Date Tue, 04 Mar 2003 23:29:20 GMT

It is perfectly acceptable and legal (and desirable) to have the same package 
under two different source trees. So you may have a and a 
in package ""; but you can have them in two different directory structures:


When you compile them, you can compile them to different directories:

or to the same directory, if you wanted:


Erik Price wrote:
> I have one other question (where I am uncertain of the "best practice"). 
>  Following along in "Java Development with Ant", in the context of using 
> JUnit for unit testing.
> It is recommended to keep test code separate from production code in the 
> filesystem, using unique directory trees.  This makes sense, because you 
> want to be able to easily copy or access your production code without 
> filtering through files ending with "*".  But if you don't put 
> the test code in with the production code, how can they share the same 
> package?  It seems to be recommended that unit tests share the same 
> package as the code that they are testing (this is also evident in the 
> example in the book, in which "HtmlDocumentTest" [a unit test] is 
> declared to be in the same package as the production code).
> Should I be copying my production code source tree into a new tree with 
> the test code embedded alongside it?  If so then what happens when I 
> make a change to the source code, I have to first copy it into the test 
> tree so that I can run the unit tests again?
> Sorry, it's a little confusing to me.
> Erik
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message