| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| |
| <html> |
| <head> |
| <title>DTD for TestNG 1.0</title> |
| <link rel="stylesheet" href="http://beust.com/beust.css" type="text/css"/> |
| </head> |
| <body> |
| |
| <pre class="code"><span class="xml-comment"><!-- ====================================================== --></span> |
| <span class="xml-comment"><!-- DTD for TestNG 1.0 --></span> |
| <span class="xml-comment"><!-- --></span> |
| <span class="xml-comment"><!-- A suite is made of tests and parameters. --></span> |
| <span class="xml-comment"><!-- --></span> |
| <span class="xml-comment"><!-- A test is made of three parts: --></span> |
| <span class="xml-comment"><!-- * Parameters, which override the Suite parameters --></span> |
| <span class="xml-comment"><!-- * Groups, made of two parts --></span> |
| <span class="xml-comment"><!-- * Classes, defining which classes are going to be part --></span> |
| <span class="xml-comment"><!-- of this test run --></span> |
| <span class="xml-comment"><!-- --></span> |
| <span class="xml-comment"><!-- In turn, groups are made of two parts: --></span> |
| <span class="xml-comment"><!-- * Definitions, which allow you to group groups into --></span> |
| <span class="xml-comment"><!-- bigger groups --></span> |
| <span class="xml-comment"><!-- * Runs, which defines the groups that the methods --></span> |
| <span class="xml-comment"><!-- must belong to in order to be run during this test --></span> |
| <span class="xml-comment"><!-- --></span> |
| <span class="xml-comment"><!-- Full documentation: http://testng.org --></span> |
| <span class="xml-comment"><!-- --></span> |
| <span class="xml-comment"><!-- Cedric Beust & Alexandru Popescu --></span> |
| <span class="xml-comment"><!-- ====================================================== --></span> |
| |
| |
| <span class="xml-comment"><!-- A suite is the top-level element of a testng.xml file --></span> |
| <!ELEMENT suite (listeners|packages|test|parameter|method-selectors|suite-files)* > |
| |
| <span class="xml-comment"><!-- Attributes: --></span> |
| <span class="xml-comment"><!-- |
| name: The name of this suite (as it will appear in the reports) |
| verbose: (0-10) How verbose the output on the console will be. |
| This setting has no impact on the HTML reports. |
| Default value: 1 |
| parallel: (methods|tests) Whether TestNG should use different threads |
| to run your tests (might speed up the process) |
| Default value: none (no parallel mode) |
| thread-count: An integer giving the size of the thread pool to use |
| if you set parallel. Default value: 5 |
| annotations: (javadoc|JDK5) If "javadoc", TestNG will look for |
| JavaDoc annotations in your sources, otherwise it will |
| use JDK5 annotations. Default value: JDK5 |
| time-out: the time to wait in milliseconds before aborting the |
| method (if <span class="attribute">parallel="methods"</span> ) or the test (parallel="tests") |
| --></span> |
| <!ATTLIST suite |
| name CDATA #REQUIRED |
| verbose CDATA #IMPLIED |
| parallel CDATA #IMPLIED |
| thread-count CDATA #IMPLIED |
| annotations CDATA #IMPLIED |
| time-out CDATA #IMPLIED |
| > |
| |
| <span class="xml-comment"><!-- A list of XML files that contain more suite descriptions --></span> |
| <!ELEMENT suite-files (suite-file)* > |
| |
| <!ELEMENT suite-file ANY > |
| <!ATTLIST suite-file |
| path CDATA #REQUIRED |
| > |
| |
| <span class="xml-comment"><!-- Parameters can be defined at the <span class="tag"><suite></span> or at the <span class="tag"><test></span> level --></span> |
| <span class="xml-comment"><!-- Parameters defined at the <span class="tag"><test></span> level override parameters of the --></span> |
| <span class="xml-comment"><!-- same name in <span class="tag"><suite>.</span> --></span> |
| <span class="xml-comment"><!-- Parameters are used to link Java method parameters to their actual --></span> |
| <span class="xml-comment"><!-- value, defined here. --></span> |
| <!ELEMENT parameter ANY> |
| <!ATTLIST parameter |
| name CDATA #REQUIRED |
| value CDATA #REQUIRED > |
| |
| <span class="xml-comment"><!-- Method selectors define user classes used to select which methods to --></span> |
| <span class="xml-comment"><!-- run. They need to implement org.testng.IMethodSelector --></span> |
| <!ELEMENT method-selectors (method-selector*) > |
| <!ELEMENT method-selector ((selector-class)*|script) > |
| <!ELEMENT selector-class ANY> |
| <!ATTLIST selector-class |
| name CDATA #REQUIRED |
| priority CDATA #IMPLIED |
| > |
| <!ELEMENT script ANY> |
| <!ATTLIST script |
| language CDATA #REQUIRED |
| > |
| |
| <span class="xml-comment"><!-- A test contains parameters and classes. Additionally, you can define --></span> |
| <span class="xml-comment"><!-- additional groups ("groups of groups") --></span> |
| <!ELEMENT test (method-selectors?,parameter*,groups?,packages?,classes?) > |
| |
| <span class="xml-comment"><!-- Attributes: --></span> |
| <span class="xml-comment"><!-- |
| name: The name of this test (as it will appear in the reports) |
| junit: (true|false) Whether to run in JUnit mode. Default value: false. |
| verbose: (0-10) How verbose the output on the console will be. |
| This setting has no impact on the HTML reports. |
| Default value: suite level verbose. |
| parallel: (methods) Whether TestNG should use different threads |
| to run your tests (might speed up the process) |
| thread-count: An integer giving teh size of the thread pool to be used if |
| parallel mode is used. Overrides the suite level value. |
| annotations: (javadoc|JDK5) If "javadoc", TestNG will look for |
| JavaDoc annotations in your sources, otherwise it will |
| use JDK5 annotations. Default value: JDK5 |
| time-out: the time to wait in milliseconds before aborting |
| the method (if <span class="attribute">parallel="methods"</span> ) or the test (if <span class="attribute">parallel="tests"</span> ) |
| enabled: flag to enable/disable current test. Default value: true |
| --></span> |
| <!ATTLIST test |
| name CDATA #REQUIRED |
| junit CDATA #IMPLIED |
| verbose CDATA #IMPLIED |
| parallel CDATA #IMPLIED |
| thread-count CDATA #IMPLIED |
| annotations CDATA #IMPLIED |
| time-out CDATA #IMPLIED |
| enabled CDATA #IMPLIED |
| > |
| |
| <span class="xml-comment"><!-- Defines additional groups ("groups of groups") and also which groups --></span> |
| <span class="xml-comment"><!-- to include in this test run --></span> |
| <!ELEMENT groups (define*,run?) > |
| |
| <!ELEMENT define (include*)> |
| <!ATTLIST define |
| name CDATA #REQUIRED> |
| |
| <span class="xml-comment"><!-- Defines which groups to include in the current group of groups --></span> |
| <!ELEMENT include ANY> |
| <!ATTLIST include |
| name CDATA #REQUIRED> |
| |
| <span class="xml-comment"><!-- Defines which groups to exclude from the current group of groups --></span> |
| <!ELEMENT exclude ANY> |
| <!ATTLIST exclude |
| name CDATA #REQUIRED> |
| |
| <span class="xml-comment"><!-- The subtag of groups used to define which groups should be run --></span> |
| <!ELEMENT run (include?,exclude?)* > |
| |
| <span class="xml-comment"><!-- The list of classes to include in this test --></span> |
| <!ELEMENT classes (class*) > |
| <!ELEMENT class (methods*) > |
| <!ATTLIST class |
| name CDATA #REQUIRED > |
| |
| <span class="xml-comment"><!-- The list of packages to include in this test --></span> |
| <!ELEMENT packages (package*) > |
| <span class="xml-comment"><!-- The package description. |
| If the package name ends with .* then subpackages are included too. |
| --></span> |
| <!ELEMENT package (include?,exclude?)*> |
| <!ATTLIST package |
| name CDATA #REQUIRED > |
| |
| <span class="xml-comment"><!-- The list of methods to include/exclude from this test --></span> |
| <!ELEMENT methods (include?,exclude?)* > |
| |
| <span class="xml-comment"><!-- The list of listeners that will be passed to TestNG --></span> |
| <!ELEMENT listeners (listener*) > |
| |
| <!ELEMENT listener ANY> |
| <!ATTLIST listener |
| class-name CDATA #REQUIRED > |
| </pre> |