ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Coup, Douglas (MED US)" <>
Subject RE: Invoking JUnit tests from Ant
Date Thu, 02 Mar 2006 20:24:35 GMT

Let me also ask a different question related to the same problem.

In addition to specifying org.eclipse.test.coretestapplication, I've
also tried specifying org.eclipse.pde.junit.runtime.coretestapplication
as the application class.  This approach doesn't give me the class not
found error, but it does give me a parameter error because I'm not
specifying a -port qualifier.

I can run the Junit test successfully within the Eclipse IDE as a Junit
plug-in test.  When I do this, I can look at the generated command line
that Eclipse produces, and it includes a -port qualifier.  But the value
specified for the -port qualifier differs every time I run the test.

I realize this is pretty Eclipse-specific, but I thought I would see if
anyone in the Ant community knows what the value for this -port
qualifier is and either what it should be set to for the tests to run or
if there is a way to avoid having to specify it.

Douglas Coup
Software Engineer, Senior Staff
Soarian Target Architecture
Siemens Medical Solutions Health Services
51 Valley Stream Parkway, W12
Malvern, PA  19355  USA
Phone:  (+01) 610-219-1894
Fax:    (+01) 610-219-9222

-----Original Message-----
From: Steve Loughran []
Sent: Thursday, March 02, 2006 11:04 AM
To: Ant Users List
Subject: Re: Invoking JUnit tests from Ant

Coup, Douglas (MED US) wrote:
> I'm working with an Ant script that builds a collection of Java
> and then tries to run some Junit tests against them.
> The running of the Junit tests is attempted using the <java> task
> classname="org.eclipse.core.launcher.Main"....>).  The -application
> parameter is set to "org.eclipse.test.coretestapplication".
> When the script gets to this task, I get a
> java.lang.NoClassDefFoundError: junit/framework/TestListener error.
> plugins folder in the target area that the script is using has the
> org.junit_3.8.1 plug-in there.  The ANT_HOME environment variable
> to a folder that contains a lib folder with junit-3.8.1.jar in it.
> also tried numerous things to get the plug-in's junit.jar into a
> location where I thought it would be seen, but with no success.
> Does anyone know how to accomplish what I'm trying to do?  I'm fairly
> new to Ant, so don't hesitate to include some detail in your response.
> :)

I'd use the <junit> task; I dont know what the eclipse testrunner does,
but it is not ant-aware.

we have just been tweaking it to improve library set up for <junit>, but

for ant 1.6

-you need junit.jar and ant-junit.jar in ANT_HOME/lib

-If you still get classpath problems, force ant's classpath down into
the task with something like

         <pathelement path="${java.class.path}" />
         <pathelement location="${target.jar}" />

To unsubscribe, e-mail:
For additional commands, e-mail:

This message and any included attachments are from Siemens Medical Solutions
USA, Inc. and are intended only for the addressee(s). 
The information contained herein may include trade secrets or privileged or
otherwise confidential information.  Unauthorized review, forwarding, printing,
copying, distributing, or using such information is strictly prohibited and may
be unlawful.  If you received this message in error, or have reason to believe
you are not authorized to receive it, please promptly delete this message and
notify the sender by e-mail with a copy to

Thank you

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message