forked from cfwheels/cfwheels
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpom.xml
610 lines (608 loc) · 20.3 KB
/
pom.xml
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
<!--
installing Maven:
- on linux: sudo apt-get install maven
- other OS: the same as installing CFEclipse plugin on Eclipse IDE
usage:
- "mvn verify" runs all CFWheels tests on embedded railo and H2 database (use port 8080 for embedded web server)
(on Eclipse, Run->Run As->9 Maven install)
- Execute "mvn jetty:run" to start the embedded web server to run individual tests
(In Eclipse, Run->Run As->6 Maven build...)
- Individual tests URL: http://localhost:8080/index.cfm?controller=wheels&action=wheels&view=tests&type=core
- "mvn verify -P jetty,railo,subfolder" install CFWheels also on subfolder and run all tests
- "mvn verify -P jetty,railo,oracle-emu" runs all CFWheels tests on Oracle emulation via embedded H2 database
- "mvn verify -P jetty,railo,mysql" runs all CFWheels tests on Travis-CI MySQL database
- "mvn verify -P jetty,railo,postgresal" runs all CFWheels tests on Travis-CI postgreSQL database
- "mvn verify -P jetty,railo,plugins" download plugins and run all tests with it
- "mvn clean verify -P mssql" upload and runs all CFWheels tests on ACF11 and Microsoft SQLServer on VivioTech test server
- "mvn clean verify -P mssql,acf9oracle" upload and deploy CFWheels on test server and run all tests also on ACF9 Oracle database
- "mvn clean verify -P oracle" copy and runs all CFWheels tests on local ColdFusion8 and Oracle (or whatever database configured locally)
- "mvn clean verify -P jetty,openbd" download OpenBD and run all tests on it (preliminary support)
- "mvn clean verify -P jetty,lucee" download Lucee and run all tests on it (preliminary support)
- "mvn verify -DtestParallelStart=true" start with parallel request and then run all tests
- "mvn verify -DtestSharedAppName=true" start with shared application name test and then run all tests
Benefits of embedded-container-test versus full-integration-test
#1 clean test data (data is not shared with nor contaminated by other processes)
#2 ready for continuous integration (no database or web server required on the CI server)
#3 secure (no password necessary to connect to external database server)
#4 fast and predictable (all tests run without external network connection)
#5 instant result (changes on source code is visible immediately without the need to upload to remote server)
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.cfwheels</groupId>
<artifactId>cfwheels</artifactId>
<version>1.4.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- embedded CFML and web server version for easy upgrade -->
<luceeVersion>4.5.0.042</luceeVersion>
<openbdVersion>3.1</openbdVersion>
<railoVersion>4.2.1.000</railoVersion>
<jettyVersion>8.1.15.v20140411</jettyVersion>
<railoConfig>railo-server.xml</railoConfig>
<testServer>http://localhost:8080</testServer>
<testSecondPort></testSecondPort>
<deployUrl></deployUrl>
<testSharedAppName>false</testSharedAppName>
<testSubfolder>false</testSubfolder>
<testParallelStart>false</testParallelStart>
<!-- settings for Oracle emulation -->
<testOracleEmulation>false</testOracleEmulation>
<webXml>src/test/xml/web.xml</webXml>
<!-- plugins IDs -->
<scaffold>9</scaffold>
<pluginManager>8</pluginManager>
<dBMigrate>28</dBMigrate>
<localizator>89</localizator>
<multimodule>93</multimodule>
</properties>
<dependencies>
<dependency>
<!-- test runtime -->
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- embedded web client required for testing -->
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.25.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<extensions>
<!-- required to upload package into remote server -->
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>2.6</version>
</extension>
</extensions>
<plugins>
<plugin>
<!-- set jdk version -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<systemPropertyVariables>
<!-- pass all configuration into the integration test -->
<testServer>${testServer}</testServer>
<testSecondPort>${testSecondPort}</testSecondPort>
<deployUrl>${deployUrl}</deployUrl>
<testOracleEmulation>${testOracleEmulation}</testOracleEmulation>
<testSharedAppName>${testSharedAppName}</testSharedAppName>
<testSubfolder>${testSubfolder}</testSubfolder>
<testParallelStart>${testParallelStart}</testParallelStart>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<!-- run the integration test -->
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<!-- verify the result of integration test -->
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<!-- web.xml is not necessary for final package, only during testing -->
<webXml>src/test/xml/web.dummy.xml</webXml>
<webResources>
<resource>
<!-- the sources are in the root, not under src/main/webapp -->
<directory>.</directory>
<excludes>
<exclude>.settings/**</exclude>
<exclude>src/**</exclude>
<exclude>target/**</exclude>
<exclude>target/**</exclude>
<exclude>WEB-INF/**</exclude>
<exclude>.*</exclude>
<exclude>pom.xml</exclude>
</excludes>
</resource>
</webResources>
<!-- exclude unnecessary binaries from final package -->
<packagingExcludes>WEB-INF/**</packagingExcludes>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- embedded web server is activated by default -->
<id>jetty</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<!-- embedded web server for testing -->
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jettyVersion}</version>
<configuration>
<!-- skip starting web server during package preparation phase on Travis-CI -->
<skip>${skipTests}</skip>
<!-- use root source folder. So, file changes can be seen instantly -->
<webAppSourceDirectory>.</webAppSourceDirectory>
<!-- web.xml required for railo -->
<webXml>${webXml}</webXml>
<webApp>
<!-- the URL context path -->
<contextPath>/</contextPath>
</webApp>
<!-- required to allow stopping the server -->
<stopPort>9966</stopPort>
<stopKey>STOP</stopKey>
</configuration>
<executions>
<execution>
<!-- start embedded web server before integration test -->
<!-- for manual testing, execute "mvn jetty:run" -->
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<!-- stop embedded web server after integration test -->
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- embedded CFML server is activated by default -->
<id>railo</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<!-- embedded test database runtime, required by railo -->
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.178</version>
</dependency>
<dependency>
<!-- embedded test CFML server runtime -->
<groupId>org.getrailo</groupId>
<artifactId>railo</artifactId>
<version>${railoVersion}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<!-- copy data source and other configuration during test file into local repo -->
<id>copy railo config</id>
<phase>test</phase>
<configuration>
<target>
<copy file="src/test/xml/${railoConfig}" tofile="${settings.localRepository}/org/getrailo/railo/${railoVersion}/railo-server/context/railo-server.xml"
overwrite="true" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<!-- force clean WEB-INF because it is outside the automatically clean up target folder-->
<id>clean railo runtime</id>
<phase>clean</phase>
<configuration>
<target>
<delete dir="bluedragon"/>
<delete dir="manual"/>
<delete dir="subfolder"/>
<delete dir="temp"/>
<delete dir="WEB-INF"/>
<delete dir="wheels/tests/_assets/plugins/removing/TestGlobalMixins"/>
<delete dir="wheels/tests/_assets/plugins/unpacking/TestDefaultAssignMixins"/>
<delete dir="wheels/tests/_assets/plugins/unpacking/TestGlobalMixins"/>
<delete>
<fileset dir="plugins" includes="**/*.zip"/>
</delete>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- to activate, execute "mvn verify -Prailo,mysql" on Travis-CI -->
<id>mysql</id>
<dependencies>
<dependency>
<!-- jdbc database driver, required for railo datasource -->
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.30</version>
</dependency>
</dependencies>
<properties>
<railoConfig>railo-server-mysql.xml</railoConfig>
</properties>
</profile>
<profile>
<!-- to activate, execute "mvn verify -Pmssql,acf9oracle" on Travis-CI -->
<id>acf9oracle</id>
<properties>
<testSecondPort>8509</testSecondPort>
</properties>
</profile>
<profile>
<!-- to activate, execute "mvn verify -Prailo,postgresql" on Travis-CI -->
<id>postgresql</id>
<dependencies>
<dependency>
<!-- jdbc database driver, required for railo datasource -->
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>8.3-606.jdbc4</version>
</dependency>
</dependencies>
<properties>
<railoConfig>railo-server-postgresql.xml</railoConfig>
</properties>
</profile>
<profile>
<!-- to activate, execute "mvn verify -Prailo,oracle-emu" on Travis-CI or locally -->
<id>oracle-emu</id>
<properties>
<railoConfig>railo-server-oracle-emu.xml</railoConfig>
<testOracleEmulation>true</testOracleEmulation>
</properties>
</profile>
<profile>
<!-- to activate, execute "mvn clean verify -mssql" on Travis-CI or locally
require FTPSERVER credentials in environment variable (repo-specific encryption on Travis-CI)
-->
<id>mssql</id>
<properties>
<testServer>http://zebrinny.viviotech.net</testServer>
<deployUrl>${testServer}/_deploy.cfm?build=${project.build.finalName}&clean=true</deployUrl>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>1.0-beta-5</version>
<executions>
<execution>
<!-- upload the zipped package into remote server -->
<id>upload-code</id>
<phase>pre-integration-test</phase>
<goals>
<goal>upload</goal>
</goals>
<configuration>
<fromDir>${project.build.directory}</fromDir>
<includes>${project.build.finalName}.war</includes>
<url>${env.FTPSERVER}</url>
</configuration>
</execution>
<execution>
<!-- upload the unzip deployment page into remote server -->
<id>upload-deploy</id>
<phase>pre-integration-test</phase>
<goals>
<goal>upload-single</goal>
</goals>
<configuration>
<fromFile>src/test/coldfusion/_deploy.cfm</fromFile>
<url>${env.FTPSERVER}</url>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- to activate, execute "mvn clean verify -Poracle" on locally
requires Oracle Express (any datasource) and ColdFusion installed on specific folder
-->
<id>oracle</id>
<properties>
<testServer>http://localhost:8500</testServer>
<deployUrl>${testServer}/_deploy.cfm?build=${project.build.finalName}&clean=true</deployUrl>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<!-- copy the zipped package and the unzip deployment page into local ColdFusion server -->
<phase>pre-integration-test</phase>
<configuration>
<target>
<copy file="${project.build.directory}/${project.build.finalName}.war" tofile="C:/ColdFusion8/wwwroot/${project.build.finalName}.war" overwrite="true" />
<copy file="src/test/coldfusion/_deploy.cfm" tofile="C:/ColdFusion8/wwwroot/_deploy.cfm" overwrite="true" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- to activate, execute "mvn verify -Prailo,subfolder" -->
<id>subfolder</id>
<properties>
<testSubfolder>true</testSubfolder>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<!-- copy wheels also into sub folder -->
<phase>pre-integration-test</phase>
<configuration>
<target>
<copy todir="subfolder">
<fileset dir=".">
<exclude name="**/*.java"/>
<exclude name=".settings/**"/>
<exclude name="src/**"/>
<exclude name="target/**"/>
<exclude name="WEB-INF/**"/>
<exclude name=".*"/>
<exclude name="pom.xml"/>
</fileset>
</copy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- to activate, execute "mvn clean verify -P jetty,openbd" -->
<id>openbd</id>
<properties>
<webXml>WEB-INF/web.xml</webXml>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<!-- download openbd -->
<id>download openbd</id>
<phase>test</phase>
<configuration>
<target>
<get src="http://openbd.org/download/${openbdVersion}/openbd.war" dest="target/openbd.war" skipexisting="true"/>
<unzip src="target/openbd.war" dest="."
overwrite="false">
<patternset>
<include name="WEB-INF/**"/>
</patternset>
</unzip>
<mkdir dir="plugins"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- to activate, execute "mvn clean verify -P jetty,lucee" -->
<id>lucee</id>
<properties>
<webXml>WEB-INF/web.xml</webXml>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<!-- download lucee -->
<id>download lucee</id>
<phase>test</phase>
<configuration>
<target>
<get src="https://bitbucket.org/lucee/lucee/downloads/lucee-${luceeVersion}.war" dest="target/lucee.war" skipexisting="true"/>
<unzip src="target/lucee.war" dest="."
overwrite="false">
<patternset>
<include name="WEB-INF/**"/>
</patternset>
</unzip>
<mkdir dir="plugins"/>
<copy file="src/test/xml/lucee-web.xml.cfm" tofile="WEB-INF/lucee/lucee-web.xml.cfm"
overwrite="true" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- to activate, execute mvn verify -Pjetty,railo,plugins -->
<id>plugins</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>1.0-beta-5</version>
<executions>
<execution>
<id>download-pluginmanager</id>
<phase>test</phase>
<goals>
<goal>download-single</goal>
</goals>
<configuration>
<fromFile>${pluginManager}</fromFile>
<url>http://cfwheels.org/plugins/download</url>
<toFile>plugins/PluginManager-${pluginManager}.zip</toFile>
</configuration>
</execution>
<execution>
<id>download-scaffold</id>
<phase>test</phase>
<goals>
<goal>download-single</goal>
</goals>
<configuration>
<fromFile>${scaffold}</fromFile>
<url>http://cfwheels.org/plugins/download</url>
<toFile>plugins/Scaffold-${scaffold}.zip</toFile>
</configuration>
</execution>
<execution>
<id>download-dbmigrate</id>
<phase>test</phase>
<goals>
<goal>download-single</goal>
</goals>
<configuration>
<fromFile>${dBMigrate}</fromFile>
<url>http://cfwheels.org/plugins/download</url>
<toFile>plugins/DBMigrate-${dBMigrate}.zip</toFile>
</configuration>
</execution>
<execution>
<id>download-localizator</id>
<phase>test</phase>
<goals>
<goal>download-single</goal>
</goals>
<configuration>
<fromFile>${localizator}</fromFile>
<url>http://cfwheels.org/plugins/download</url>
<toFile>plugins/Localizator-${localizator}.zip</toFile>
</configuration>
</execution>
<execution>
<id>download-multimodule</id>
<phase>test</phase>
<goals>
<goal>download-single</goal>
</goals>
<configuration>
<fromFile>${multimodule}</fromFile>
<url>http://cfwheels.org/plugins/download</url>
<toFile>plugins/MultiModule-${multimodule}.zip</toFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<repositories>
<repository>
<!-- the embedded CFML server only available here to download -->
<id>cfmlprojects.org</id>
<url>http://cfmlprojects.org/artifacts</url>
</repository>
</repositories>
</project>