ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Olan" <ol...@computer.org>
Subject junit can't find test classes
Date Thu, 22 May 2003 23:49:59 GMT
This has been driving me nuts all day!

I've got some junit test classes that I know work, but I can't get a build
script to find them, although it seems like it does. Here's the target:

<target name="test" depends="compile" description="Execute unit tests">
  <junit printsummary="yes" >
    <formatter type="plain" />
    <batchtest>
      <fileset dir = "${build.dir}">
         <include name="**/*Test.class"/>
      </fileset>
   </batchtest>
  </junit>
 </target>

Here's what it says when it runs:

test:
    [junit] Running classes.AccountTest
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
    [junit] TEST classes.AccountTest FAILED
    [junit] Running classes.AcctInTest
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
    [junit] TEST classes.AcctInTest FAILED
    [junit] Running classes.AcctOutTest
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
    [junit] TEST classes.AcctOutTest FAILED

So this seems to indicate that it did in fact find the test classes, but
here's what the reports say about each test class:

Testsuite: classes.AccountTest
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec

	Caused an ERROR
classes.AccountTest
java.lang.ClassNotFoundException: classes.AccountTest
	at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:140)

It must be something dumb I'm doing, but I sure can't see it.



Mime
View raw message