Always run OSGi HTTP service on random port in itests (#11523)

It is probably always a good idea to run the OSGi HTTP service on a random available port in itests.
So when this is always done it prevents future issues and removes a bit of duplication.

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born 2021-11-06 10:13:40 +01:00 committed by GitHub
parent 207da1cffc
commit d4510f3fef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 52 deletions

View File

@ -24,6 +24,10 @@ Import-Package: org.osgi.framework.*;version="[1.8,2)",*
-runfw: org.eclipse.osgi
-runee: JavaSE-11
# An unused random HTTP port is used during tests to prevent resource conflicts
# This property is set by the build-helper-maven-plugin in the itests pom.xml
-runvm: -Dorg.osgi.service.http.port=${org.osgi.service.http.port}
# The integration test itself does not export anything.
Export-Package:
-exportcontents:

View File

@ -14,8 +14,6 @@ Fragment-Host: org.openhab.binding.feed
-runblacklist: \
bnd.identity;id='org.openhab.core.storage.json'
-runvm: -Dorg.osgi.service.http.port=${org.osgi.service.http.port}
#
# done
#

View File

@ -15,8 +15,6 @@
<name>openHAB Add-ons :: Integration Tests :: Feed Binding Tests</name>
<properties>
<org.osgi.service.http.port>9090</org.osgi.service.http.port>
<rome.version>1.15.0</rome.version>
</properties>
@ -44,27 +42,4 @@
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>reserve-network-port</id>
<goals>
<goal>reserve-network-port</goal>
</goals>
<phase>process-resources</phase>
<configuration>
<portNames>
<portName>org.osgi.service.http.port</portName>
</portNames>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -12,8 +12,6 @@ Fragment-Host: org.openhab.binding.mielecloud
bnd.identity;id='org.openhab.core.storage.json',\
bnd.identity;id='org.openhab.core.storage.mapdb'
-runvm: -Dorg.osgi.service.http.port=${org.osgi.service.http.port}
#
# done
#

View File

@ -22,27 +22,4 @@
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>reserve-network-port</id>
<goals>
<goal>reserve-network-port</goal>
</goals>
<phase>process-resources</phase>
<configuration>
<portNames>
<portName>org.osgi.service.http.port</portName>
</portNames>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -38,6 +38,7 @@
<properties>
<m2e.jdt.annotationpath>target/dependency</m2e.jdt.annotationpath>
<org.osgi.service.http.port>9090</org.osgi.service.http.port>
</properties>
<dependencies>
@ -179,6 +180,24 @@
</bndruns>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>reserve-network-port</id>
<goals>
<goal>reserve-network-port</goal>
</goals>
<phase>process-resources</phase>
<configuration>
<portNames>
<portName>org.osgi.service.http.port</portName>
</portNames>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>