Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 76988 invoked by uid 500); 8 Jun 2001 13:51:33 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: ant-user@jakarta.apache.org Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 76965 invoked from network); 8 Jun 2001 13:51:29 -0000 Message-Id: <5.1.0.14.0.20010608143759.00a81680@192.168.0.254> X-Sender: louise.pryor@192.168.0.254 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Fri, 08 Jun 2001 14:56:39 +0100 To: ant-user@jakarta.apache.org From: Louise Pryor Subject: Re: More optional task problems In-Reply-To: References: <3B205ABD.2CD01985@healthlanguage.com> <5.1.0.14.0.20010608140151.00b06560@192.168.0.254> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N At 15:20 08/06/01 +0200, you wrote: >Louise Pryor wrote: > > > However, I still have to do a taskdef for the junit task, else it > > doesn't find the task; > > > > > > and then, when I run it, I get > > > > run.test: > > [junit] Running dev.uk.co.sfs.calcengine.RRResultsTest > > [junit] java.lang.NoClassDefFoundError: > > org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner > >Well, if this is the message, Ant obviously knows which class it is >supposed to load for the junit task. > >Are you specifying a classpath with your taskdef? I guess junit is not >in your system CLASSPATH so Ant cannot load the junit task because it >doesn't find JUnit itself. Yes, classpath specified and definitely includes junit. When I run it with verbose, junit prints out the classpath it is using: it definitely includes the junit jar, and definitely doesn't include any of the ant jars. It really looks as if it's the org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner class that isn't being found because it's not in the class path: which it isn't, as the ant jars aren't there. So should I be specifying the ant jars in my own class path? That really doesn't seem as if it should be right. Note that the problem above occurs when I specify fork="yes" When I do fork="no", I get java.lang.NoClassDefFoundError: junit/framework/TestListener at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JUnitTask.java, Compiled Code) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:283) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java, Compiled Code) [stuff omitted...] This time it looks like it *is* a junit class that it can't find, but again the verbose output says that the junit jar is in the classpath. I really don't understand what is going on here! (and why do I have to use taskdef to set up the junit task when it's meant to be a default one?) Louise --------------------------------------------------------------- Louise Pryor Securities Finance Systems Ltd louise.pryor@riskexplorer.com CBC House T: +44 131 272 2782 24 Canning Street F: +44 131 272 2800 Edinburgh EH3 8EG http://www.riskexplorer.com Scotland