Skip to content

Commit c954f43

Browse files
committed
Automatically setup Tomcat for the integration test
1 parent f6d2469 commit c954f43

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

‎pom.xml‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<version.jetty>8.1.2.v20120308</version.jetty>
3636
<version.jbossas>7.1.1.Final</version.jbossas>
3737
<version.tomcat>7.0.19</version.tomcat>
38+
<container.download.dir>${java.io.tmpdir}/rewrite-arquillian-containers</container.download.dir>
3839
</properties>
3940

4041
<modules>
@@ -380,6 +381,37 @@
380381
<id>TOMCAT_MANAGED_7_WELD</id>
381382
<build>
382383
<plugins>
384+
<plugin>
385+
<artifactId>maven-antrun-plugin</artifactId>
386+
<version>1.7</version>
387+
<executions>
388+
<execution>
389+
<phase>generate-test-resources</phase>
390+
<goals>
391+
<goal>run</goal>
392+
</goals>
393+
<configuration>
394+
<target>
395+
<mkdir dir="${container.download.dir}" />
396+
<get dest="${container.download.dir}" verbose="true" skipexisting="true"
397+
src="http://archive.apache.org/dist/tomcat/tomcat-7/v${version.tomcat}/bin/apache-tomcat-${version.tomcat}.zip" />
398+
<unzip src="${container.download.dir}/apache-tomcat-${version.tomcat}.zip" dest="${project.build.directory}/container" />
399+
<move file="${project.build.directory}/container/apache-tomcat-${version.tomcat}"
400+
tofile="${project.build.directory}/container/apache-tomcat-7"/>
401+
<echo file="${project.build.directory}/container/apache-tomcat-7/conf/tomcat-users.xml">
402+
<![CDATA[
403+
<?xml version="1.0" encoding="UTF-8"?>
404+
<tomcat-users>
405+
<role rolename="manager-script"/>
406+
<user username="arquillian" password="arquillian" roles="manager-script"/>
407+
</tomcat-users>
408+
]]>
409+
</echo>
410+
</target>
411+
</configuration>
412+
</execution>
413+
</executions>
414+
</plugin>
383415
<plugin>
384416
<groupId>org.apache.maven.plugins</groupId>
385417
<artifactId>maven-surefire-plugin</artifactId>
@@ -400,6 +432,19 @@
400432
<scope>test</scope>
401433
</dependency>
402434
</dependencies>
435+
<repositories>
436+
<!-- We current need this because we have to use the SNAPSHOTS for the Tomcat container adapter -->
437+
<repository>
438+
<id>arquillian-snapshots</id>
439+
<url>https://repository-arquillian.forge.cloudbees.com/snapshot/</url>
440+
<releases>
441+
<enabled>false</enabled>
442+
</releases>
443+
<snapshots>
444+
<enabled>true</enabled>
445+
</snapshots>
446+
</repository>
447+
</repositories>
403448
</profile>
404449

405450
<profile>

‎test-harness/src/main/resources/arquillian.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
-->
1818
<container qualifier="tomcat-managed-7">
1919
<configuration>
20+
<property name="catalinaHome">target/container/apache-tomcat-7</property>
2021
<property name="user">arquillian</property>
2122
<property name="pass">arquillian</property>
2223
</configuration>

0 commit comments

Comments
 (0)