Skip to content

Commit ef99f0a

Browse files
committed
Added Tomcat ci-managed profile
1 parent 83c711d commit ef99f0a

4 files changed

Lines changed: 153 additions & 4 deletions

File tree

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ There are 11 available container profiles, for 6 different servers:
1717
* ``wildfly-managed-arquillian``
1818

1919
This profile will install a Wildfly server and start up the server per sample.
20-
Useful for CI servers.
20+
Useful for CI servers. The WildFly version that's used can be set via the ``wildfly.version`` property.
2121

2222
* ``wildfly-embedded-arquillian``
2323

2424
This profile is almost identical to wildfly-managed-arquillian. It will install the same Wildfly server and start up
2525
that server per sample again, but instead uses the Arquillian embedded connector to run it in the same JVM.
26-
Useful for CI servers.
26+
Useful for CI servers. The WildFly version that's used can be set via the ``wildfly.version`` property.
2727

2828
* ``wildfly-remote-arquillian``
2929

@@ -98,13 +98,15 @@ There are 11 available container profiles, for 6 different servers:
9898
</featureManager>
9999
```
100100

101-
For the JASPIC tests to even be attempted to be executed a cheat is needed that creates a group in Liberty's internal user registry:
101+
For older versions of Liberty (pre 16.0.0.0) for the JASPIC tests to even be attempted to be executed a cheat is needed that creates a group in Liberty's internal user registry:
102102

103103
```xml
104104
<basicRegistry id="basic">
105105
<group name="architect"/>
106106
</basicRegistry>
107107
```
108+
109+
This cheat is not needed for the latest versions of Liberty (16.0.0.0/2016.7 and later)
108110

109111
* ``liberty-embedded-arquillian``
110112

@@ -144,8 +146,16 @@ There are 11 available container profiles, for 6 different servers:
144146
JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=localhost "
145147
```
146148

149+
This profile also requires you to set a username (``tomcat``) and password (``manager``) for the management application in
150+
``tomcat-users.xml``. See the file ``test-utils/src/main/resources/tomcat-users.xml`` in this repository for a full example.
151+
147152
Be aware that this should *only* be done for a Tomcat instance that's used exclusively for testing, as the above will make
148153
the Tomcat installation **totally insecure!**
154+
155+
* ``tomcat-ci-managed``
156+
157+
This profile will install a Tomcat server and start up the server per sample.
158+
Useful for CI servers. The Tomcat version that's used can be set via the ``tomcat.version`` property.
149159

150160

151161

pom.xml

Lines changed: 115 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<liberty.version>16.0.0.3</liberty.version>
3131
<wildfly.version>10.1.0.Final</wildfly.version>
3232
<tomee.version>7.0.1</tomee.version>
33+
<tomcat.version>8.5.6</tomcat.version>
3334
</properties>
3435

3536
<prerequisites>
@@ -874,7 +875,7 @@
874875
<!-- ### LIBERTY ### -->
875876

876877
<profile>
877-
<id>liberty-managed-arquillian</id>
878+
<id>liberty-managed-arquillian</id> <!-- Can also be used as remote -->
878879

879880
<dependencies>
880881
<dependency>
@@ -1060,6 +1061,9 @@
10601061
</profile>
10611062

10621063

1064+
1065+
<!-- ### TOMCAT ### -->
1066+
10631067
<profile>
10641068
<id>tomcat-remote</id>
10651069

@@ -1091,10 +1095,120 @@
10911095
</plugin>
10921096
</plugins>
10931097
</build>
1098+
</profile>
1099+
1100+
1101+
<profile>
1102+
<id>tomcat-ci-managed</id>
1103+
1104+
<properties>
1105+
<skipEJB>true</skipEJB>
1106+
<skipCDI>true</skipCDI>
1107+
<skipJSF>true</skipJSF>
1108+
<skipJACC>true</skipJACC>
1109+
</properties>
10941110

1111+
<repositories>
1112+
<!-- Released versions of Tomcat -->
1113+
<repository>
1114+
<id>apache.public</id>
1115+
<url>https://repository.apache.org/content/repositories/public/</url>
1116+
<releases>
1117+
<enabled>true</enabled>
1118+
</releases>
1119+
<snapshots>
1120+
<enabled>false</enabled>
1121+
</snapshots>
1122+
</repository>
1123+
1124+
<!-- About to be released version of Tomcat -->
1125+
<repository>
1126+
<id>apache.staging</id>
1127+
<url>https://repository.apache.org/content/repositories/staging/</url>
1128+
<releases>
1129+
<enabled>true</enabled>
1130+
</releases>
1131+
<snapshots>
1132+
<enabled>false</enabled>
1133+
</snapshots>
1134+
</repository>
1135+
</repositories>
1136+
1137+
<dependencies>
1138+
<dependency>
1139+
<groupId>org.jboss.arquillian.container</groupId>
1140+
<artifactId>arquillian-tomcat-managed-7</artifactId>
1141+
<version>1.0.0.CR7</version>
1142+
<scope>test</scope>
1143+
</dependency>
1144+
</dependencies>
1145+
1146+
<build>
1147+
<plugins>
1148+
<plugin>
1149+
<groupId>org.apache.maven.plugins</groupId>
1150+
<artifactId>maven-dependency-plugin</artifactId>
1151+
<executions>
1152+
<execution>
1153+
<id>unpack</id>
1154+
<phase>process-test-classes</phase>
1155+
<goals>
1156+
<goal>unpack</goal>
1157+
</goals>
1158+
<configuration>
1159+
<artifactItems>
1160+
<artifactItem>
1161+
<groupId>org.apache.tomcat</groupId>
1162+
<artifactId>tomcat</artifactId>
1163+
<version>${tomcat.version}</version>
1164+
<type>zip</type>
1165+
<overWrite>false</overWrite>
1166+
<outputDirectory>${project.build.directory}</outputDirectory>
1167+
</artifactItem>
1168+
</artifactItems>
1169+
</configuration>
1170+
</execution>
1171+
</executions>
1172+
</plugin>
1173+
<plugin>
1174+
<groupId>org.apache.maven.plugins</groupId>
1175+
<artifactId>maven-antrun-plugin</artifactId>
1176+
<version>1.1</version>
1177+
<executions>
1178+
<execution>
1179+
<phase>process-test-classes</phase>
1180+
<goals>
1181+
<goal>run</goal>
1182+
</goals>
1183+
<configuration>
1184+
<tasks>
1185+
<echo>Copying server.xml</echo>
1186+
<copy
1187+
failonerror="false"
1188+
file="../../test-utils/src/main/resources/tomcat-users.xml"
1189+
tofile="${project.build.directory}/apache-tomcat-${tomcat.version}/conf/tomcat-users.xml"
1190+
/>
1191+
</tasks>
1192+
</configuration>
1193+
</execution>
1194+
</executions>
1195+
</plugin>
1196+
<plugin>
1197+
<groupId>org.apache.maven.plugins</groupId>
1198+
<artifactId>maven-surefire-plugin</artifactId>
1199+
<configuration>
1200+
<systemPropertyVariables>
1201+
<arquillian.launch>tomcat-ci-managed</arquillian.launch>
1202+
<arquillian.tomcat.catalinaHome>${project.build.directory}/apache-tomcat-${tomcat.version}</arquillian.tomcat.catalinaHome>
1203+
</systemPropertyVariables>
1204+
</configuration>
1205+
</plugin>
1206+
</plugins>
1207+
</build>
10951208
</profile>
10961209

10971210

1211+
10981212
<!-- Browser profiles. Used for UI testing -->
10991213

11001214
<profile>

test-utils/src/main/resources/arquillian.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,15 @@
6161
</configuration>
6262
</container>
6363

64+
<container qualifier="tomcat-ci-managed">
65+
<configuration>
66+
<property name="catalinaHome">${arquillian.tomcat.catalinaHome}</property>
67+
<property name="catalinaBase">${arquillian.tomcat.catalinaHome}</property>
68+
<property name="user">tomcat</property>
69+
<property name="pass">manager</property>
70+
</configuration>
71+
</container>
72+
73+
74+
6475
</arquillian>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<tomcat-users xmlns="http://tomcat.apache.org/xml"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
4+
version="1.0">
5+
6+
<role rolename="manager-gui" />
7+
<role rolename="manager-jmx" />
8+
<role rolename="manager-script" />
9+
10+
<user username="tomcat" password="manager"
11+
roles="manager-gui,manager-jmx,manager-script"
12+
/>
13+
14+
</tomcat-users>

0 commit comments

Comments
 (0)