ant: runing single test-class from jar

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ant: runing single test-class from jar

Arno Jost
This post has NOT been accepted by the mailing list yet.
Hi there

I just can't believe nobody else has the problem or nobody knows the solution to my older post:
http://testng.1065351.n5.nabble.com/Running-a-class-with-classfileset-which-is-contained-in-a-jar-tt8304.html

So let me describe it again in a hopefully clearlier manner...

All my compiled code (classes under test and test-classes) is contained in a bundle of jar-files which i DON'T want to unpack.

I can run any single test-class out of it:
 - from the shell by using the main of "org.testng.TestNG" with the option "-testclass"
 - within the eclipse plugin by having the desired test-class in the "class" field and all my jars in the classpath

I can also run a suite (testng.xml) contained in the jars from the shell, the eclipse-plugin AND from ant using the construct:

<testng ...>
        <classpath refid="project.classpath" />
        <xmlfileset dir="${suite.dir}" includes="testng.xml"/>
</testng>

BUT: i just can't run a single class from ant with somthing like
<testng ...>
        <classpath refid="project.classpath" />
        <classfileset dir="${class.dir}" includes="${class.files}" erroronmissingdir="true"/>
</testng>

I tried all possible imaginable combinations for my variables ${class.dir} and ${class.files} without sucess.
I allway get the message:

[testng] You need to specify at least one testng.xml, one class or one method
[testng] Usage: <main class> [options] The XML suite files to run

The test runs fine whitout chaning anything if i "just" unpack all my jars to the specified directory ${class.dir}, but that's definitely not a permanent solution!

Before i dig deeper, i'd really like to know if the combination "ant + only jar + running sinlge test-class" is meant to work?

Thx in advance!
Arno