Author: olamy
Date: Mon Oct 10 07:47:01 2011
New Revision: 1180807
URL: http://svn.apache.org/viewvc?rev=1180807&view=rev
Log:
add a pom property to override http port used for integration tests: default is
1973.
Modified:
tomcat/maven-plugin/trunk/BUILD.TXT
tomcat/maven-plugin/trunk/pom.xml
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractDeployWarProjectIT.java
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractSimpleWarProjectIT.java
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractTomcatRunMultiConfigIT.java
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractUsageContextpathIT.java
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractWarProjectIT.java
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/pom.xml
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/java/org/codehaus/mojo/tomcat/it/Tomcat6RunMultiConfigIT.java
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/deploy-war-project/pom.xml
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/simple-war-project/pom.xml
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/tomcat-run-multi-config/pom.xml
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/usage-contextpath/pom.xml
tomcat/maven-plugin/trunk/tomcat7-maven-plugin/pom.xml
tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/test/resources/simple-war-project/pom.xml
Modified: tomcat/maven-plugin/trunk/BUILD.TXT
URL:
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/BUILD.TXT?rev=1180807&r1=1180806&r2=1180807&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/BUILD.TXT (original)
+++ tomcat/maven-plugin/trunk/BUILD.TXT Mon Oct 10 07:47:01 2011
@@ -1,6 +1,6 @@
to build this project you must Apache Maven at least 2.2.1 .
-mvn clean install will install the mojos without running integration tests (as
there are some hardcoded integration tests with port 8080, you could have some
port allocation issues).
-mvn clean install -Prun-its will run integration tests too.
+mvn clean install will install the mojos without running integration tests (as
there are some hardcoded integration tests with port 1973, you could have some
port allocation issues).
+mvn clean install -Prun-its will run integration tests too: to override the
default used htpp port you can use -Dits.http.port=
To deploy a snaphot version to
http://people.apache.org/repo/m2-snapshot-repository/ (which is proxying by
https://repository.apache.org/content/groups/snapshots-group/) you must run :
mvn clean deploy .
Note you need some configuration in ~/.m2/settings.xml:
<server>
Modified: tomcat/maven-plugin/trunk/pom.xml
URL:
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/pom.xml?rev=1180807&r1=1180806&r2=1180807&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/pom.xml (original)
+++ tomcat/maven-plugin/trunk/pom.xml Mon Oct 10 07:47:01 2011
@@ -55,6 +55,8 @@
<distributionSnapshotsUrl>scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</distributionSnapshotsUrl>
<distributionSiteUrl>scp://people.apache.org/www/tomcat.apache.org/maven-plugin-${project.version}</distributionSiteUrl>
<distributionIdSnapshots>apache.snapshots</distributionIdSnapshots>
+ <!-- http port used to run it test -->
+ <its.http.port>1973</its.http.port>
</properties>
<prerequisites>
@@ -372,8 +374,38 @@
<artifactId>plexus-component-metadata</artifactId>
<version>1.5.5</version>
</plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <version>0.7</version>
+ <configuration>
+ <excludes>
+ <exclude>.gitignore</exclude>
+ <exclude>DEPENDENCIES</exclude>
+ <exclude>README.txt</exclude>
+ <exclude>*.sh</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
</plugins>
</pluginManagement>
+ <plugins>
+ <!--
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>rat-verify</id>
+ <phase>test</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ -->
+ </plugins>
</build>
<distributionManagement>
Modified:
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractDeployWarProjectIT.java
URL:
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractDeployWarProjectIT.java?rev=1180807&r1=1180806&r2=1180807&view=diff
==============================================================================
---
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractDeployWarProjectIT.java
(original)
+++
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractDeployWarProjectIT.java
Mon Oct 10 07:47:01 2011
@@ -42,7 +42,7 @@ public abstract class AbstractDeployWarP
@Override
protected String getWebappUrl()
{
- return "http://localhost:8080/";
+ return "http://localhost:" + getHttpItPort() + "/";
}
@Override
Modified:
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractSimpleWarProjectIT.java
URL:
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractSimpleWarProjectIT.java?rev=1180807&r1=1180806&r2=1180807&view=diff
==============================================================================
---
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractSimpleWarProjectIT.java
(original)
+++
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractSimpleWarProjectIT.java
Mon Oct 10 07:47:01 2011
@@ -42,7 +42,7 @@ public abstract class AbstractSimpleWarP
@Override
protected String getWebappUrl()
{
- return "http://localhost:8080/";
+ return "http://localhost:" + getHttpItPort() + "/";
}
@Override
Modified:
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractTomcatRunMultiConfigIT.java
URL:
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractTomcatRunMultiConfigIT.java?rev=1180807&r1=1180806&r2=1180807&view=diff
==============================================================================
---
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractTomcatRunMultiConfigIT.java
(original)
+++
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractTomcatRunMultiConfigIT.java
Mon Oct 10 07:47:01 2011
@@ -20,6 +20,7 @@ package org.codehaus.mojo.tomcat.it;
*/
+import org.apache.maven.it.VerificationException;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -37,10 +38,10 @@ import static org.junit.Assert.assertTru
*
* @author Mark Michaelis
*/
-public class AbstractTomcatRunMultiConfigIT
+public abstract class AbstractTomcatRunMultiConfigIT
extends AbstractWarProjectIT
{
- private static final Logger LOG = LoggerFactory.getLogger(
AbstractTomcatRunMultiConfigIT.class );
+ private static final Logger LOG =
LoggerFactory.getLogger(AbstractTomcatRunMultiConfigIT.class);
private static final String URL_QUERY = "\u3053\u3093\u306b\u3061\u306f";
@@ -54,12 +55,12 @@ public class AbstractTomcatRunMultiConfi
{
try
{
- return new URI(
"http://localhost:8001/multi-config/index.jsp?string=" + URL_QUERY
).toASCIIString();
+ return new URI("http://localhost:" + getHttpItPort() +
"/multi-config/index.jsp?string=" + URL_QUERY).toASCIIString();
}
catch ( URISyntaxException e )
{
- LOG.error( "An exception occurred.", e );
- return "http://localhost:8001/multi-config";
+ LOG.error("An exception occurred.", e);
+ return "http://localhost:" + getHttpItPort() + "/multi-config";
}
}
@@ -74,21 +75,29 @@ public class AbstractTomcatRunMultiConfi
throws Exception
{
final String responseBody = executeVerifyWithGet();
- assertNotNull( "Received message body from " + getWebappUrl() + " must
not be null.", responseBody );
- assertContains( "Response from " + getWebappUrl() + " must match
expected content.", URL_QUERY, responseBody );
+ assertNotNull("Received message body from " + getWebappUrl() + " must
not be null.", responseBody);
+ assertContains("Response from " + getWebappUrl() + " must match
expected content.", URL_QUERY, responseBody);
- final File tomcatFolder = new File( webappHome, "target/tc" );
- final File emptyLocation = new File( tomcatFolder, "conf/empty.txt" );
+ final File tomcatFolder = new File(webappHome, "target/tc");
+ final File emptyLocation = new File(tomcatFolder, "conf/empty.txt");
assertTrue(
"Tomcat folder \"" + tomcatFolder.getAbsolutePath() + "\" should
exist in target folder of project at "
- + webappHome, tomcatFolder.exists() );
+ + webappHome, tomcatFolder.exists());
assertTrue(
"File \"" + emptyLocation.getAbsolutePath() + "\" should have been
copied from tcconf to tomcat/conf",
- emptyLocation.exists() );
+ emptyLocation.exists());
- LOG.info( "Error Free Log check" );
+ LOG.info("Error Free Log check");
verifier.verifyErrorFreeLog();
+ verifyConnectorsStarted();
+
}
+ /**
+ * impls check the logs if http/https/apr has been started
+ */
+ protected abstract void verifyConnectorsStarted()
+ throws VerificationException;
+
}
Modified:
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractUsageContextpathIT.java
URL:
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractUsageContextpathIT.java?rev=1180807&r1=1180806&r2=1180807&view=diff
==============================================================================
---
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractUsageContextpathIT.java
(original)
+++
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractUsageContextpathIT.java
Mon Oct 10 07:47:01 2011
@@ -37,7 +37,7 @@ public class AbstractUsageContextpathIT
{
private static final Logger LOG = LoggerFactory.getLogger(
AbstractUsageContextpathIT.class );
- private static final String WEBAPP_URL =
"http://localhost:8080/lorem/index.html";
+ private static final String WEBAPP_URL = "http://localhost:" +
getHttpItPort() + "/lorem/index.html";
/**
* ArtifactId of the sample WAR project.
Modified:
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractWarProjectIT.java
URL:
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractWarProjectIT.java?rev=1180807&r1=1180806&r2=1180807&view=diff
==============================================================================
---
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractWarProjectIT.java
(original)
+++
tomcat/maven-plugin/trunk/tomcat-maven-plugin-it/src/main/java/org/codehaus/mojo/tomcat/it/AbstractWarProjectIT.java
Mon Oct 10 07:47:01 2011
@@ -207,5 +207,10 @@ public abstract class AbstractWarProject
{
return 15000;
}
+
+ protected static String getHttpItPort()
+ {
+ return System.getProperty( "its.http.port" );
+ }
}
Modified: tomcat/maven-plugin/trunk/tomcat6-maven-plugin/pom.xml
URL:
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/pom.xml?rev=1180807&r1=1180806&r2=1180807&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat6-maven-plugin/pom.xml (original)
+++ tomcat/maven-plugin/trunk/tomcat6-maven-plugin/pom.xml Mon Oct 10 07:47:01
2011
@@ -220,6 +220,7 @@
<mojoVersion>${project.version}</mojoVersion>
<verifier.maven.debug>${verifier.maven.debug}</verifier.maven.debug>
<verifier.debugJvm>${verifier.debugJvm}</verifier.debugJvm>
+ <its.http.port>${its.http.port}</its.http.port>
</systemPropertyVariables>
</configuration>
</execution>
Modified:
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/java/org/codehaus/mojo/tomcat/it/Tomcat6RunMultiConfigIT.java
URL:
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/java/org/codehaus/mojo/tomcat/it/Tomcat6RunMultiConfigIT.java?rev=1180807&r1=1180806&r2=1180807&view=diff
==============================================================================
---
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/java/org/codehaus/mojo/tomcat/it/Tomcat6RunMultiConfigIT.java
(original)
+++
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/java/org/codehaus/mojo/tomcat/it/Tomcat6RunMultiConfigIT.java
Mon Oct 10 07:47:01 2011
@@ -18,11 +18,18 @@ package org.codehaus.mojo.tomcat.it;
* under the License.
*/
+import org.apache.maven.it.VerificationException;
+
/**
* @author Olivier Lamy
*/
public class Tomcat6RunMultiConfigIT
extends AbstractTomcatRunMultiConfigIT
{
- // no op
+ @Override
+ protected void verifyConnectorsStarted()
+ throws VerificationException
+ {
+ verifier.verifyTextInLog("INFO: Starting Coyote HTTP/1.1 on http-" +
getHttpItPort());
+ }
}
Modified:
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/deploy-war-project/pom.xml
URL:
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/deploy-war-project/pom.xml?rev=1180807&r1=1180806&r2=1180807&view=diff
==============================================================================
---
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/deploy-war-project/pom.xml
(original)
+++
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/deploy-war-project/pom.xml
Mon Oct 10 07:47:01 2011
@@ -65,6 +65,7 @@
</goals>
<phase>test</phase>
<configuration>
+ <port>${its.http.port}</port>
<fork>true</fork>
<path>/</path>
<tomcatUsers>src/main/tomcatconf/tomcat-users.xml</tomcatUsers>
@@ -77,6 +78,7 @@
<goal>deploy-only</goal>
</goals>
<configuration>
+ <port>${its.http.port}</port>
<warFile>./simple-war-project-1.0-SNAPSHOT.war</warFile>
<username>tomcat</username>
<password>tomcat</password>
Modified:
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/simple-war-project/pom.xml
URL:
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/simple-war-project/pom.xml?rev=1180807&r1=1180806&r2=1180807&view=diff
==============================================================================
---
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/simple-war-project/pom.xml
(original)
+++
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/simple-war-project/pom.xml
Mon Oct 10 07:47:01 2011
@@ -65,6 +65,7 @@
</goals>
<phase>pre-integration-test</phase>
<configuration>
+ <port>${its.http.port}</port>
<fork>true</fork>
<path>/</path>
<systemProperties>
Modified:
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/tomcat-run-multi-config/pom.xml
URL:
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/tomcat-run-multi-config/pom.xml?rev=1180807&r1=1180806&r2=1180807&view=diff
==============================================================================
---
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/tomcat-run-multi-config/pom.xml
(original)
+++
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/tomcat-run-multi-config/pom.xml
Mon Oct 10 07:47:01 2011
@@ -67,7 +67,12 @@
<additionalConfigFilesDir>\${basedir}/src/main/tcconf</additionalConfigFilesDir>
<configurationDir>\${project.build.directory}/tc</configurationDir>
<path>/multi-config</path>
- <port>8001</port>
+ <port>${its.http.port}</port>
+ <!--
+ <httpsPort>8002</httpsPort>
+ <keystoreFile>\${basedir}/src/keystore</keystoreFile>
+ <ajpPort>8003</ajpPort>
+ -->
<uriEncoding>UTF-8</uriEncoding>
<systemProperties>
<com.sun.management.jmxremote.ssl>false</com.sun.management.jmxremote.ssl>
Modified:
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/usage-contextpath/pom.xml
URL:
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/usage-contextpath/pom.xml?rev=1180807&r1=1180806&r2=1180807&view=diff
==============================================================================
---
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/usage-contextpath/pom.xml
(original)
+++
tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/test/resources/usage-contextpath/pom.xml
Mon Oct 10 07:47:01 2011
@@ -55,6 +55,7 @@
</goals>
<phase>pre-integration-test</phase>
<configuration>
+ <port>${its.http.port}</port>
<fork>true</fork>
<path>/lorem</path>
</configuration>
Modified: tomcat/maven-plugin/trunk/tomcat7-maven-plugin/pom.xml
URL:
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-maven-plugin/pom.xml?rev=1180807&r1=1180806&r2=1180807&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat7-maven-plugin/pom.xml (original)
+++ tomcat/maven-plugin/trunk/tomcat7-maven-plugin/pom.xml Mon Oct 10 07:47:01
2011
@@ -230,6 +230,7 @@
<mojoVersion>${project.version}</mojoVersion>
<verifier.maven.debug>${verifier.maven.debug}</verifier.maven.debug>
<verifier.debugJvm>${verifier.debugJvm}</verifier.debugJvm>
+ <its.http.port>${its.http.port}</its.http.port>
</systemPropertyVariables>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
<useFile>false</useFile>
Modified:
tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/test/resources/simple-war-project/pom.xml
URL:
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/test/resources/simple-war-project/pom.xml?rev=1180807&r1=1180806&r2=1180807&view=diff
==============================================================================
---
tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/test/resources/simple-war-project/pom.xml
(original)
+++
tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/test/resources/simple-war-project/pom.xml
Mon Oct 10 07:47:01 2011
@@ -66,6 +66,7 @@
<phase>pre-integration-test</phase>
<configuration>
<fork>true</fork>
+ <port>${its.http.port}</port>
<path>/</path>
<systemProperties>
<com.sun.management.jmxremote.ssl>false</com.sun.management.jmxremote.ssl>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]