Author: ivol37 at gmail.com
Date: Tue Nov 9 12:02:37 2010
New Revision: 267
Log:
[AMDATU-159] Integration test now picks up hostname and port number configured
in pom.xml or custom maven settings.xml
Modified:
trunk/integration-tests/pom.xml
trunk/integration-tests/src/test/java/org/amdatu/test/integration/base/IntegrationTestBase.java
Modified: trunk/integration-tests/pom.xml
==============================================================================
--- trunk/integration-tests/pom.xml (original)
+++ trunk/integration-tests/pom.xml Tue Nov 9 12:02:37 2010
@@ -150,8 +150,42 @@
</dependencies>
<build>
+ <!-- Set the default source directory to match our generated sources
directory -->
+ <testSourceDirectory>target/filtered-sources/java</testSourceDirectory>
+
<plugins>
<plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>process-filtered-java-source-files</id>
+ <phase>process-test-sources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>target/filtered-sources/java</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/test/java</directory>
+ <filtering>false</filtering>
+ <excludes>
+ <exclude>org/amdatu/test/integration/base/**</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>src/test/java</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>org/amdatu/test/integration/base/**</include>
+ </includes>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
Modified:
trunk/integration-tests/src/test/java/org/amdatu/test/integration/base/IntegrationTestBase.java
==============================================================================
---
trunk/integration-tests/src/test/java/org/amdatu/test/integration/base/IntegrationTestBase.java
(original)
+++
trunk/integration-tests/src/test/java/org/amdatu/test/integration/base/IntegrationTestBase.java
Tue Nov 9 12:02:37 2010
@@ -55,13 +55,16 @@
* <li>{@link #configure} gives a standard set of options to start an
integration test. This configuration uses all
* Amdatu bundles; your test likely doesn't need that.</li>
* </ul>
+ * NB: This class is filtered!
*/
public abstract class IntegrationTestBase {
public final static String TEST_PREFIX = "> TESTING: ";
public final static int SERVICE_TIMEOUT = 30;
- public final static String HOST_NAME = "localhost";
- public final static int PORT_NR = 3738;
+ // Hostname and portnumber to use during integration tests. These
variables are interpolated
+ // by the maven-resources-plugin during the process-test-sources lifecycle
phase (see pom.xml).
+ public final static String HOST_NAME = "${server.hostname}";
+ public final static int PORT_NR = Integer.parseInt("${server.port}");
@Inject
protected BundleContext m_bundleContext;