Skip to content

Commit

Permalink
Uses build-helper-maven-plugin:reserve-network-ports to set test.port…
Browse files Browse the repository at this point in the history
… property

for all integration tests. The property ${test.port} is made available to the tests
via maven-failsafe-plugin.
  • Loading branch information
Edwin Shin committed Apr 12, 2013
1 parent dff8f8b commit 0d9961d
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 62 deletions.
4 changes: 4 additions & 0 deletions fcrepo-generator-dc/pom.xml
Expand Up @@ -79,6 +79,10 @@
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>maven-enunciate-cxf-plugin</artifactId>
Expand Down
5 changes: 4 additions & 1 deletion fcrepo-generator-rdf/pom.xml
Expand Up @@ -88,8 +88,11 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
7 changes: 5 additions & 2 deletions fcrepo-http-api/pom.xml
Expand Up @@ -144,13 +144,16 @@
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>maven-enunciate-cxf-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
7 changes: 5 additions & 2 deletions fcrepo-legacy-api/pom.xml
Expand Up @@ -111,13 +111,16 @@
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>maven-enunciate-cxf-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
17 changes: 10 additions & 7 deletions fcrepo-rss/pom.xml
Expand Up @@ -55,8 +55,8 @@
<artifactId>httpclient</artifactId>
</dependency>

<!-- This dependency is for compile-time: it keeps this module independent
of any given choice of JAX-RS implementation. It must be _after_ the test
<!-- This dependency is for compile-time: it keeps this module independent of
any given choice of JAX-RS implementation. It must be _after_ the test
gear. Otherwise it will get loaded during test phase, but because this is
just an API, the tests will not be able to execute. -->
<dependency>
Expand All @@ -69,14 +69,17 @@
<version>1.0.0</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>
</plugins>
</plugins>
</build>

</project>
22 changes: 4 additions & 18 deletions fcrepo-webapp/pom.xml
Expand Up @@ -70,11 +70,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
Expand All @@ -88,7 +83,6 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

Expand All @@ -101,7 +95,7 @@
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<test.port>${jetty.port}</test.port>
<test.port>${test.port}</test.port>
<test.context.path>${test.context.path}</test.context.path>
</systemPropertyVariables>
</configuration>
Expand All @@ -111,19 +105,11 @@
<artifactId>build-helper-maven-plugin</artifactId>
<configuration>
<portNames>
<portName>jetty.port</portName>
<portName>test.port</portName>
<!-- reserves the stop port for jetty-maven-plugin -->
<portName>jetty.port.stop</portName>
</portNames>
</configuration>
<executions>
<execution>
<id>reserve-port</id>
<phase>pre-integration-test</phase>
<goals>
<goal>reserve-network-port</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
Expand Down Expand Up @@ -152,7 +138,7 @@
<configuration>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>${jetty.port}</port>
<port>${test.port}</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
Expand Down
24 changes: 13 additions & 11 deletions fcrepo-webhooks/pom.xml
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<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">
<parent>
<artifactId>fcrepo</artifactId>
<groupId>org.fcrepo</groupId>
Expand Down Expand Up @@ -71,12 +70,15 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
</plugins>
</build>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
63 changes: 42 additions & 21 deletions pom.xml
Expand Up @@ -16,7 +16,7 @@
<description>Parent project for fcrepo</description>

<properties>
<!-- Use ${project_name} instead of ${project.artifactId} to avoid incorrect
<!-- Use ${project_name} instead of ${project.artifactId} to avoid incorrect
replacements of "fcrepo4" in child modules (for scm, site-distribution, etc -->
<project_name>fcrepo4</project_name>

Expand Down Expand Up @@ -55,9 +55,9 @@

<dependencyManagement>
<dependencies>
<!-- Import the ModeShape BOM for embedded usage. This adds to the "dependenciesManagement"
section defaults for all of the modules we might need, but we still have to include
in the "dependencies" section the modules we DO need. The benefit is that we don't
<!-- Import the ModeShape BOM for embedded usage. This adds to the "dependenciesManagement"
section defaults for all of the modules we might need, but we still have to include
in the "dependencies" section the modules we DO need. The benefit is that we don't
have to specify the versions of any of those modules. -->
<dependency>
<groupId>org.modeshape.bom</groupId>
Expand Down Expand Up @@ -209,14 +209,14 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>${powermock.version}</version>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>${powermock.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -302,6 +302,12 @@
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.14</version>
<configuration>
<systemPropertyVariables>
<test.port>${test.port}</test.port>
<test.context.path>${test.context.path}</test.context.path>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<id>integration-test</id>
Expand Down Expand Up @@ -352,7 +358,7 @@
</configuration>
<dependencies>
<dependency>
<!-- allows markdown syntax for site generation. To use it place files
<!-- allows markdown syntax for site generation. To use it place files
below src/site/markdown/[filename].md -->
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-markdown</artifactId>
Expand Down Expand Up @@ -380,6 +386,21 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<!-- reserve a port under the property ${test.port} for integration tests -->
<configuration>
<portNames>
<portName>test.port</portName>
</portNames>
</configuration>
<executions>
<execution>
<id>reserve-port</id>
<phase>pre-integration-test</phase>
<goals>
<goal>reserve-network-port</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down Expand Up @@ -738,15 +759,15 @@
</developers>

<dependencies>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

0 comments on commit 0d9961d

Please sign in to comment.