1<!--
2
3Here is a quick overview of the main parts of this DTD.  For more information,
4refer to the <a href="http://testng.org">main web site</a>.
5
6A <b>suite</b> is made of <b>tests</b> and <b>parameters</b>.
7
8A <b>test</b> is made of three parts:
9
10<ul>
11<li> <b>parameters</b>, which override the suite parameters
12<li> <b>groups</b>, made of two parts
13<li> <b>classes</b>, defining which classes are going to be part
14  of this test run
15</ul>
16
17In turn, <b>groups</b> are made of two parts:
18<ul>
19<li> Definitions, which allow you to group groups into
20  bigger groups
21<li> Runs, which defines the groups that the methods
22  must belong to in order to be run during this test
23</ul>
24
25Cedric Beust & Alexandru Popescu
26@title DTD for TestNG
27@root suite
28
29-->
30
31
32<!-- A suite is the top-level element of a testng.xml file                  -->
33<!ELEMENT suite (groups?,(listeners|packages|test|parameter|method-selectors|suite-files)*) >
34
35<!-- Attributes: -->
36<!--
37@attr  name        The name of this suite (as it will appear in the reports)
38@attr  junit       Whether to run in JUnit mode.
39@attr  verbose     How verbose the output on the console will be.
40                This setting has no impact on the HTML reports.
41@attr  parallel   Whether TestNG should use different threads
42                to run your tests (might speed up the process)
43@attr  parent-module A module used to create the parent injector of all guice injectors used
44       in tests of the suite
45@attr  guice-stage The stage with which the parent injector is created
46@attr  configfailurepolicy  Whether to continue attempting Before/After
47                Class/Methods after they've failed once or just skip remaining.
48@attr  thread-count An integer giving the size of the thread pool to use
49                if you set parallel.
50@attr  annotations  If "javadoc", TestNG will look for
51                JavaDoc annotations in your sources, otherwise it will
52                use JDK5 annotations.
53@attr  time-out     The time to wait in milliseconds before aborting the
54                method (if parallel="methods") or the test (parallel="tests")
55@attr  skipfailedinvocationcounts Whether to skip failed invocations.
56@attr  data-provider-thread-count An integer giving the size of the thread pool to use
57       for parallel data providers.
58@attr  object-factory A class that implements IObjectFactory that will be used to
59       instantiate the test objects.
60@attr allow-return-values If true, tests that return a value will be run as well
61-->
62<!ATTLIST suite
63    name CDATA #REQUIRED
64    junit (true | false) "false"
65    verbose CDATA #IMPLIED
66    parallel (false | methods | tests | classes | instances) "false"
67    parent-module CDATA #IMPLIED
68    guice-stage (DEVELOPMENT | PRODUCTION | TOOL) "DEVELOPMENT"
69    configfailurepolicy (skip | continue) "skip"
70    thread-count CDATA "5"
71    annotations CDATA #IMPLIED
72    time-out CDATA #IMPLIED
73    skipfailedinvocationcounts (true | false) "false"
74    data-provider-thread-count CDATA "10"
75    object-factory CDATA #IMPLIED
76    group-by-instances (true | false) "false"
77    preserve-order (true | false) "true"
78    allow-return-values (true | false) "false"
79>
80
81<!-- A list of XML files that contain more suite descriptions -->
82<!ELEMENT suite-files (suite-file)* >
83
84<!ELEMENT suite-file ANY >
85<!ATTLIST suite-file
86    path CDATA #REQUIRED
87>
88
89<!--
90Parameters can be defined at the <suite> or at the <test> level.
91Parameters defined at the <test> level override parameters of the same name in <suite>
92Parameters are used to link Java method parameters to their actual value, defined here.
93-->
94<!ELEMENT parameter ANY>
95<!ATTLIST parameter
96    name CDATA #REQUIRED
97    value CDATA #REQUIRED >
98
99<!--
100Method selectors define user classes used to select which methods to run.
101They need to implement <tt>org.testng.IMethodSelector</tt>
102-->
103<!ELEMENT method-selectors (method-selector*) >
104<!ELEMENT method-selector ((selector-class)*|script) >
105<!ELEMENT selector-class ANY>
106<!ATTLIST selector-class
107    name CDATA #REQUIRED
108  priority CDATA #IMPLIED
109>
110<!ELEMENT script ANY>
111<!ATTLIST script
112    language CDATA #REQUIRED
113>
114
115<!--
116A test contains parameters and classes.  Additionally, you can define additional groups ("groups of groups")
117-->
118
119<!ELEMENT test (method-selectors?,parameter*,groups?,packages?,classes?) >
120
121<!--
122@attr  name         The name of this test (as it will appear in the reports)
123@attr  junit        Whether to run in JUnit mode.
124@attr  verbose      How verbose the output on the console will be.
125                This setting has no impact on the HTML reports.
126                Default value: suite level verbose.
127@attr  parallel     Whether TestNG should use different threads
128                to run your tests (might speed up the process)
129@attr  thread-count An integer giving the size of the thread pool to be used if
130                parallel mode is used. Overrides the suite level value.
131@attr  annotations  If "javadoc", TestNG will look for
132                JavaDoc annotations in your sources, otherwise it will
133                use JDK5 annotations.
134@attr  time-out     the time to wait in milliseconds before aborting
135                the method (if parallel="methods") or the test (if parallel="tests")
136@attr  enabled      flag to enable/disable current test. Default value: true
137@attr  skipfailedinvocationcounts Whether to skip failed invocations.
138@attr preserve-order If true, the classes in this tag will be run in the same order as
139found in the XML file.
140@attr allow-return-values If true, tests that return a value will be run as well
141-->
142<!ATTLIST test
143    name CDATA #REQUIRED
144    junit (true | false) "false"
145    verbose  CDATA #IMPLIED
146    parallel  (false | methods | tests | classes | instances) #IMPLIED
147    thread-count CDATA #IMPLIED
148    annotations  CDATA #IMPLIED
149    time-out CDATA #IMPLIED
150    enabled (true | false) #IMPLIED
151    skipfailedinvocationcounts (true | false) "false"
152    preserve-order (true | false) "true"
153    group-by-instances (true | false) "false"
154    allow-return-values (true | false) "false"
155>
156
157<!--
158Defines additional groups ("groups of groups") and also which groups to include in this test run
159-->
160<!ELEMENT groups (define*,run?,dependencies?) >
161
162<!ELEMENT define (include*)>
163<!ATTLIST define
164    name CDATA #REQUIRED>
165
166<!-- Defines which groups to include in the current group of groups         -->
167<!ELEMENT include ANY>
168<!ATTLIST include
169    name CDATA #REQUIRED
170    description CDATA #IMPLIED
171    invocation-numbers CDATA #IMPLIED>
172
173<!-- Defines which groups to exclude from the current group of groups       -->
174<!ELEMENT exclude ANY>
175<!ATTLIST exclude
176    name CDATA #REQUIRED>
177
178<!-- The subtag of groups used to define which groups should be run         -->
179<!ELEMENT run (include?,exclude?)* >
180
181<!ELEMENT dependencies (group*)>
182
183<!ELEMENT group ANY>
184<!ATTLIST group
185    name CDATA #REQUIRED
186    depends-on CDATA #REQUIRED>
187
188<!-- The list of classes to include in this test                            -->
189<!ELEMENT classes (class*,parameter*) >
190<!ELEMENT class (methods|parameter)* >
191<!ATTLIST class
192    name CDATA #REQUIRED >
193
194<!-- The list of packages to include in this test                           -->
195<!ELEMENT packages (package*) >
196<!-- The package description.
197     If the package name ends with .* then subpackages are included too.
198-->
199<!ELEMENT package (include?,exclude?)*>
200<!ATTLIST package
201    name CDATA #REQUIRED >
202
203<!-- The list of methods to include/exclude from this test                 -->
204<!ELEMENT methods (include?,exclude?,parameter?)* >
205
206<!-- The list of listeners that will be passed to TestNG -->
207<!ELEMENT listeners (listener*) >
208
209<!ELEMENT listener ANY>
210<!ATTLIST listener
211    class-name CDATA #REQUIRED >
212