Took a second to actually look at the test part of the build script. Why is the following in there:
<property name="junit.home" value="/usr/local/junit3.7"/> with a comment to change it to your local position? This seems a bit of a pain to maintain. Everytime I grab an apache build.xml I have to go change that to my value? There must be a nicer solution, though I admit I could just symlink junit3.7 to javalib. I guess it's important that a test-run doesn't have lots of other jars messing it up, but it also seems messy to either have a localised version of junit.jar (and thus many copies), or to hard code in (or mandate) an external directory structure. I assume I'm missing something :) btw, $ANT_HOME/lib and adding it to my ant's localclasspath didn't help. Bay On Wed, 27 Feb 2002, Henri Yandell wrote: > Commited. > > I'm with you on the JUnit error Christopher. I've had it working on > another machine, but can't seem to get the current one beyond the > TextRunner error atm. [I did have an old junit in there for a while, but > that's now fixed]. > > On Mon, 25 Feb 2002, Christopher Elkins wrote: > > > On Mon, Feb 25, 2002 at 08:59:40AM -0800, Daniel Rall wrote: > > > Christopher Elkins <[EMAIL PROTECTED]> writes: > > > (P.S. Why are > > seemingly all of the commons modules allergic to using Ant's > > > > <junit> task? I couldn't get the current test target to work at all, > > so I > > was forced to hack in a temporary target in order to execute > > my NumberRangeTest > > class succesfully.) > > Hey Chris. Did you try > > putting junit.jar in your $ANT_HOME/lib/ > directory? I've had > > similar problems in the past, and Jason van Zyl > pointed me to this > > as a solution (he also mentioned that it's > documented by the <junit> > > task). > > > > I think I tried that in the past, and it didn't work. At any rate, I tried it > > again, and it still doesn't work. :-( > > > > > > For the curious reading along, executing 'ant test' results in: > > > > test.strings: > > [echo] Running Strings tests ... > > [java] Exception in thread "main" java.lang.NoClassDefFoundError: >junit/textui/TestRunner > > > > BUILD FAILED > > > > (Relevant Ant debug output attached below.) > > > > > > Maybe it's just me, but the only reliable solution I've ever found is adding > > junit.jar to my CLASSPATH and using the <junit> task. (I do realize this > > fails miserably unless you have optional.jar in $ANT_HOME/lib.) > > > > -- > > Christopher Elkins > > > > > > > > 'ant -debug test' output: > > ... > > > > test.strings: > > [echo] Running Strings tests ... > > [java] Forking /usr/j2se/jre/../bin/java -classpath >/home/chrise/src/jakarta/jakarta-commons-sandbox/lang/target/classes:/home/chrise/src/jakarta/jakarta-commons-sandbox/lang/target/tests > junit.textui.TestRunner org.apache.commons.lang.StringsTest > > Execute:Java13CommandLauncher: /usr/j2se/jre/../bin/java -classpath >/home/chrise/src/jakarta/jakarta-commons-sandbox/lang/target/classes:/home/chrise/src/jakarta/jakarta-commons-sandbox/lang/target/tests > junit.textui.TestRunner org.apache.commons.lang.StringsTest > > [java] Exception in thread "main" java.lang.NoClassDefFoundError: >junit/textui/TestRunner > > > > BUILD FAILED > > > > /home/chrise/src/jakarta/jakarta-commons-sandbox/lang/build.xml:235: Java >returned: 1 > > at org.apache.tools.ant.taskdefs.Java.execute(Java.java:90) > > at org.apache.tools.ant.Task.perform(Task.java:217) > > at org.apache.tools.ant.Target.execute(Target.java:184) > > at org.apache.tools.ant.Target.performTasks(Target.java:202) > > at org.apache.tools.ant.Project.executeTarget(Project.java:601) > > at org.apache.tools.ant.Project.executeTargets(Project.java:560) > > at org.apache.tools.ant.Main.runBuild(Main.java:454) > > at org.apache.tools.ant.Main.start(Main.java:153) > > at org.apache.tools.ant.Main.main(Main.java:176) > > > > Total time: 3 seconds > > > > -- > > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
