ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Price <>
Subject another unit-test question
Date Tue, 04 Mar 2003 23:07:14 GMT
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.


View raw message