Ok, so I'm finally looking into this. XMLSuite doesn't have a
setTests method, but has a getTests method. Is the idea for me to
subclass it to return whatever XMLTest objects are relevant for what
I'm doing? Further, it's not clear from the XMLTest class (or from
the DTD) how to set the group of a test.
Basically I have one test class that takes a file as a parameter. So,
say I decide I want the file name to determine the group, so if I have
foo_test1.xml
foo_test2.xml
bar_test3.xml
bar_test4.xml
baz_test5.xml
I want to have 5 total tests, with three groups: "foo", "bar", and
"baz".
To execute those tests, without groups, I would generate something
like:
<suite>
<test name="foo_test1">
<parameter name="file" value="foo_test1.xml" />
<classes><class name="package.for.my.TestClass" /></classes>
</test>
<!-- repeat for each of the other four files -->
</suite>
So, what woudl the testng.xml look like with the groups, and the, how
do I use the XmlTest to accomplish that?
Dave
On May 21, 10:55 am, Cédric Beust ♔ <
cbe...@google.com> wrote:
> The SuiteRunner class is not part of the public API, so I wouldn't recommend
> relying on it (as opposed to the TestNG class).
>
> Based on your scenario, it looks like generating an XML file would be the
> best way to solve your problem since it will leave a trace on your hard
> drive if you ever need to investigate a test failure and that you will be
> able to use the regular TestNG ant task to run it.
>
> The best way to generate this file is probably to create an XmlSuite object
> (and its children) and then call toXml() on it.
>
> Hope this helps.
>
> --
> Cédric
>
> On Wed, May 21, 2008 at 7:36 AM, davetron5000 <
davetron5...@gmail.com>