This repository has been archived by the owner on Apr 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhow-to-run-integration-test.html
188 lines (160 loc) · 8.75 KB
/
how-to-run-integration-test.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
| Generated by Apache Maven Doxia at Oct 24, 2012
| Rendered using Apache Maven Fluido Skin 1.2.2
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>t7mp - A Tomcat 7 Maven Plugin - </title>
<link rel="stylesheet" href="./css/apache-maven-fluido.min.css" />
<link rel="stylesheet" href="./css/site.css" />
<link rel="stylesheet" href="./css/print.css" media="print" />
<script type="text/javascript" src="./js/apache-maven-fluido.min.js"></script>
<meta name="Date-Revision-yyyymmdd" content="20121024" />
<meta http-equiv="Content-Language" content="en" />
</head>
<body class="topBarEnabled">
<div id="topbar" class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<div class="nav-collapse">
<ul class="nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Overview <b class="caret"></b></a>
<ul class="dropdown-menu">
<li> <a href="index.html" title="Introduction">Introduction</a>
</li>
<li> <a href="plugin-info.html" title="Goals">Goals</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Examples <b class="caret"></b></a>
<ul class="dropdown-menu">
<li> <a href="simple-usage.html" title="Simple Usage">Simple Usage</a>
</li>
<li> <a href="how-to-run-integration-test.html" title="How to run Integration-Tests">How to run Integration-Tests</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Project Documentation <b class="caret"></b></a>
<ul class="dropdown-menu">
<li> <a href="project-info.html" title="Project Information">Project Information</a>
</li>
<li> <a href="project-reports.html" title="Project Reports">Project Reports</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Get Involved <b class="caret"></b></a>
<ul class="dropdown-menu">
<li> <a href="issue-tracking.html" title="Issues">Issues</a>
</li>
<li> <a href="team-list.html" title="Team">Team</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div id="banner">
<div class="pull-left">
<div id="bannerLeft">
<h2>maven-t7-plugin</h2>
</div>
</div>
<div class="pull-right"> </div>
<div class="clear"><hr/></div>
</div>
<div id="breadcrumbs">
<ul class="breadcrumb">
<li id="publishDate">Last Published: 2012-10-24</li>
<li class="divider">|</li> <li id="projectVersion">Version: 0.9.10-SNAPSHOT</li>
</ul>
</div>
<div id="bodyColumn" >
<div class="section"><h2>How to use the plugin for Integration-Tests<a name="How_to_use_the_plugin_for_Integration-Tests"></a></h2><p>To run the Tomcat-Instance during 'integration-test'-phase you have to configure the plugin like the following example.</p><div class="source"><pre class="prettyprint"><pom>
...
...
<build>
<finalName>external-libs</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
</plugin>
<!-- this executes the integration-test, junit-test that ends with 'IT' -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.12.4</version>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.googlecode.t7mp</groupId>
<artifactId>maven-t7-plugin</artifactId>
<version>0.9.10.M8</version>
<configuration>
<!-- setup the port to listen on -->
<tomcatHttpPort>9091</tomcatHttpPort>
<!-- this is very important for integration tests -->
<tomcatSetAwait>false</tomcatSetAwait>
</configuration>
<executions>
<execution>
<id>start-tomcat</id>
<goals>
<goal>run</goal>
</goals>
<phase>pre-integration-test</phase>
</execution>
<execution>
<id>stop-tomcat</id>
<goals>
<goal>stop</goal>
</goals>
<phase>post-integration-test</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
...
</pre></div><p>If you run your build, the Tomcat-Instance will be startet in the 'pre-integration-test'-phase and stopped in the 'post-integration-test'-phase. You don't have to invoke the plugin directly on commandline. All you need is the following.</p><div class="source"><pre class="prettyprint">mvn clean install</pre></div></div>
</div>
<hr/>
<footer>
<div class="container">
<div class="row span12">Copyright © 2012.
All Rights Reserved.
</div>
<p id="poweredBy" class="pull-right">
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img class="poweredBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
</a>
</p>
</div>
</footer>
</body>
</html>