Okay, so i really thought I understood the *right* way to use JUnit with
Ant back when I added JUnit tests to the Solr code base -- all of the
information i found online suggested that the correct way to do things was
to *not* include junit.jar in your project's lib, instead encourage
developers to put it in their ANT_HOME/lib directory.

(if i recall correclty, putting it in the project's lib directory doesn't
allow <junit> tasks from working at all, because Ant's classloader doesn't
have it when it tries to run the <junit> task)

This worked fine at first, but now that I'm trying to cleanup javadocs,
we've got the anoying error included below.

As far as i can tell, the problem is that unlike the <junit> task, that
<javadoc> task is acctually executing that javadoc command on the shell --
so it's not running in the same JVM as ant, and doesn't have access to the
junit.jar from ant's classloader.

I suspect the "right" way to fix this, is to figure out some way to pass a
refrence to the classes already loaded by ant's classloader to javadocs
classpath option.

Does anyone have any ideas on how to make that work, or better suggestions
for dealing with the problem?  (perhaps someone who has written a book on
using ant?  *cough* erik *cough*)




laptop:~/lucene/solr/trunk> ant javadoc
Buildfile: build.xml
        ...
  [javadoc]
/home/hossman/lucene/solr/trunk/src/java/org/apache/solr/util/AbstractSolrTestCase.java:8:
package junit.framework does not exist
  [javadoc] import junit.framework.TestCase;
  [javadoc]                        ^
  [javadoc]
/home/hossman/lucene/solr/trunk/src/java/org/apache/solr/util/AbstractSolrTestCase.java:27:
cannot find symbol
  [javadoc] symbol: class TestCase
  [javadoc] public abstract class AbstractSolrTestCase extends TestCase {
  [javadoc]                                                    ^




-Hoss

Reply via email to