ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmose <cjm...@gmail.com>
Subject classsnotfound exception with junit ant task
Date Wed, 16 Aug 2006 18:39:21 GMT

Wasn't able to find anything on searching the forum regarding this issue. I
turned up a number of items via google but none of them seemed to resolve
the problem I've got. I'm using ant 1.6.5 through eclipse 3.1. 
Specifically I'm using a junit task defined thusly:

<target name="test" depends="compile" unles="do.nojunit">
  <junit printsummary="yes" haltonfailure="yes" showoutput="yes fork="no">
     <classpath refid="classpath.project" />
     <formatter type="xml" />
     <test todir="${testresults.dir}" name="test.AllTests"
outfile="Test-AllTests" />
  </junit>
  ...
</target>

classpath.project is defined thusly:
<path id="classpath.project">
   <pathelement path="${target.dir}" /> --->this is the bin directory for
class files
   <pathelement path="D:\Lirbaries\*.jar" /> ---> a temporary location for
jar libraries
</path>

Now the obnoxious thing is this, Ant runs the junit tests and manages to get
through 65 out of the 72 testcases before throwing the classnotfound
exception. Furthermore,
The class it's saying it can't find, it found in a testcase it ran previous
to the failed testcase (e.g., ClassNotFoundException: MyClass, MyClass was
already exercised in a previous testcase that the ant junit task ran without
hiccup). 

Now I should note that this failure is a junit "failure" resulting from an
explicit call to fail() within the testcase (in the event that an unexpected
exception is caught).  The testcase in question calls a utility class that
needs to cast an object to this not found class and that is where the error
is occuring.

All the tests pass just fine when run straight through eclipse.

At this point I'm not really certain what the solution is. Quite possibly
I'm overlooking something simple or obvious - any insight is greatly
appreciated!
-- 
View this message in context: http://www.nabble.com/classsnotfound-exception-with-junit-ant-task-tf2117062.html#a5838070
Sent from the Ant - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message