You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Antoine Levy-Lambert <an...@gmx.de> on 2010/02/01 00:26:10 UTC

Re: junit deletes class files and fails

Hello Christofer,

your build file looks good.

Is the last test class which is getting executed always the same class ?

If yes, could it be that this class contains code which deletes the test
classes ?

Regards,

Antoine


Christofer Jennings wrote:
> I must be missing something. The attached build.xml has a target
> "junit" that causes the classes and test classes to be compiled to
> "build/..." and then runs the tests. All the compiles work. The test
> get run. There are a fair number of tests but after a few successes
> all the rest fail. All the failure reports are due to ClassNotFound
> errors. When I then look in the build folder all the compiled classes
> are gone. ... But there's no "delete" command. It's driving me nuts.
> ... And the "compile" targets all work as expected.
>
> All the tests pass when run in IntelliJ IDEA, not via ANT. 
>
> I'm using ANT 1.7.
> junit.jar (version 4.4) is in my lib folder -- so is on the classpath
> during the build
>
> Example test report:
>
>     Testsuite: my.stuff.SampleTest
>     Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
>
>     Caused an ERROR
>     my.stuff.SampleTest
>     java.lang.ClassNotFoundException: my.stuff.SampleTest
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
>     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)
>     at java.lang.Class.forName0(Native Method)
>     at java.lang.Class.forName(Class.java:247)
>
>
> Any ideas?
>
> TIA,
> ,chris
> ------------------------------------------------------------------------
>


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


Re: junit deletes class files and fails

Posted by Christofer Jennings <bo...@gmail.com>.
Yeah. My goof. There's a test that runs ant targets that clean and build the
project. It needs to when run by itself but when run in the batch of tests
it breaks everything, obviously. I made it depend on a system property so
the clean could be disabled.

Thanks for your reply Antoine!
,chris