28
28
29
29
Using TestNG
30
30
31
- * Unsupported TestNG versions
32
-
33
- - TestNG 5.14.3: Bad formatted pom.xml.
34
- - TestNG 5.14.4 and 5.14.5: TestNG is using a missing dependency (org.testng:guice:2.0). Excluding it, may break some features.
35
-
36
31
* Configuring TestNG
37
32
38
33
To get started with TestNG, include the following dependency in your project (replacing the version with the one you wish to use):
@@ -50,23 +45,6 @@ Using TestNG
50
45
</dependencies>
51
46
+---+
52
47
53
- If you are using an older version of TestNG (\<= 5.11), the dependency would instead look like this:
54
-
55
- +---+
56
- <dependencies>
57
- [...]
58
- <dependency>
59
- <groupId>org.testng</groupId>
60
- <artifactId>testng</artifactId>
61
- <version>5.11</version>
62
- <scope>test</scope>
63
- <classifier>jdk15</classifier>
64
- </dependency>
65
- [...]
66
- </dependencies>
67
- +---+
68
-
69
- <<Note:>> if you are using JDK 1.4 Javadoc annotations for your TestNG tests, replace the classifier <<<jdk15>>> with <<<jdk14>>> above.
70
48
71
49
#{if}(${project.artifactId}=="maven-surefire-plugin")
72
50
This is the only step that is required to get started - you can now create tests in your test source directory
@@ -175,9 +153,7 @@ Using TestNG
175
153
176
154
This is particularly useful for slow tests that can have high concurrency, or to quickly and roughly assess the independence
177
155
and thread safety of your tests and code.
178
-
179
- TestNG 5.10 and plugin version 2.19 or higher allows you to run methods in parallel test using data provider.
180
-
156
+
181
157
+---+
182
158
<plugins>
183
159
[...]
@@ -202,7 +178,7 @@ Using TestNG
202
178
</plugins>
203
179
+---+
204
180
205
- TestNG 6.9.8 (JRE 1.7) and plugin version 2.19 or higher allows you to run suites in parallel.
181
+ You can run suites in parallel.
206
182
207
183
+---+
208
184
<plugins>
@@ -234,12 +210,6 @@ Using TestNG
234
210
235
211
TestNG provides support for attaching custom listeners, reporters, annotation transformers and method interceptors to your tests.
236
212
By default, TestNG attaches a few basic listeners to generate HTML and XML reports.
237
-
238
- Unsupported versions:
239
- - TestNG 5.14.1 and 5.14.2: Due to an internal TestNG issue, listeners and reporters are not working with TestNG.
240
- Please upgrade TestNG to version 5.14.9 or higher.
241
- Note: It may be fixed in a future surefire version.
242
-
243
213
You can configure multiple custom listeners like this:
244
214
245
215
+---+
@@ -290,7 +260,7 @@ Using TestNG
290
260
291
261
* The level of verbosity
292
262
293
- Since the plugin version 2.19 or higher the verbosity level can be configured in provider property
263
+ The verbosity level can be configured in provider property
294
264
<<<surefire.testng.verbose>>>. The verbosity level is between 0 and 10 where 10 is the most detailed.
295
265
You can specify -1 and this will put TestNG in debug mode (no longer slicing off stack traces and all).
296
266
The default level is 0.
@@ -347,7 +317,7 @@ Using TestNG
347
317
348
318
* Customizing TestNG Test Runner Factory
349
319
350
- Since the plugin version 2.19 and TestNG 5.9 or higher you can customize
320
+ You can customize the
351
321
TestNG runner factory by implementing <<<org.testng.ITestRunnerFactory>>> and
352
322
binding the class name to the key <<<testrunfactory>>> in provider properties:
353
323
@@ -431,8 +401,8 @@ Using TestNG
431
401
432
402
* Running TestNG and JUnit Tests
433
403
434
- TestNG 6.5.1 and higher provides support to run TestNG and JUnit 4.x in current Maven project. All you need
435
- is to introduce TestNG and JUnit dependency in POM.
404
+ To run TestNG and JUnit 4.x in the current Maven project, you need
405
+ both TestNG and JUnit dependencies in the POM:
436
406
437
407
+---+
438
408
<dependencies>
0 commit comments