-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathintroduction.html
95 lines (95 loc) · 3.64 KB
/
introduction.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 2.0.18">
<title>Introduction</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
<link rel="stylesheet" href="./asciidoctor.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.css">
</head>
<body class="article toc2 toc-left">
<div id="header">
<div id="toc" class="toc2">
<div id="toctitle">Table of Contents</div>
<ul class="sectlevel2">
<li><a href="#_introduction">Introduction</a></li>
</ul>
</div>
</div>
<div id="content">
<div class="sect2">
<h3 id="_introduction">Introduction</h3>
<div class="paragraph">
<p>TestNG is a testing framework designed to simplify a broad range of testing needs, from unit testing (testing a class in isolation of the others) to integration testing (testing entire systems made of several classes, several packages and even several external frameworks, such as application servers).</p>
</div>
<div class="paragraph">
<p>Writing a test is typically a three-step process:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Write the business logic of your test and insert <a href="annotations.html">TestNG annotations</a> in your code.</p>
</li>
<li>
<p>Add the information about your test (e.g. the class name, the groups you wish to run, etc…​) in a testng.xml file or in <code>build.xml</code>.</p>
</li>
<li>
<p><a href="../ant.html">Run TestNG</a>.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>You can find a quick example on the <a href="../welcome.html">Welcome page</a>.</p>
</div>
<div class="paragraph">
<p>The concepts used in this documentation are as follows:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>A suite is represented by one XML file. It can contain one or more tests and is defined by the <code><suite></code> tag.</p>
</li>
<li>
<p>A test is represented by <test> and can contain one or more TestNG classes.</p>
</li>
<li>
<p>A TestNG class is a Java class that contains at least one TestNG annotation. It is represented by the <class> tag and can contain one or more test methods.</p>
</li>
<li>
<p>A test method is a Java method annotated by <code>@Test</code> in your source.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>A TestNG test can be configured by <code>@BeforeXXX</code> and <code>@AfterXXX</code> annotations which allows to perform some Java logic before and after a certain point, these points being either of the items listed above.</p>
</div>
<div class="paragraph">
<p>The rest of this manual will explain the following:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>A list of all the annotations with a brief explanation. This will give you an idea of the various functionalities offered by TestNG but you will probably want to consult the section dedicated to each of these annotations to learn the details.</p>
</li>
<li>
<p>A description of the testng.xml file, its syntax and what you can specify in it.</p>
</li>
<li>
<p>A detailed list of the various features and how to use them with a combination of annotations and testng.xml.</p>
</li>
</ul>
</div>
</div>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2025-02-27 18:51:48 UTC
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/run_prettify.min.js"></script>
</body>
</html>