Once the test class is defined, it is necessary to write the XML configuration file for TestNG. The following example indicates that the tests inside the package org.objectweb.easybeans.tests.examples must be run:
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd"> <suite name="Test Suite Example" verbose="1"> <test name="Test Example"> <packages> <package name="org.objectweb.easybeans.tests.examples"/> </packages> </test> </suite>
The TestNG XML configuration file also supports the
classes/class
tags that define which classes must be run.
This following example indicates that only the tests in the TestExample
class must be run:
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd"> <suite name="Test Suite Example" verbose="1"> <test name="Test Example"> <classes> <class name="org.objectweb.easybeans.tests.examples.TestExample"/> </classes> </test> </suite>