From d4510f3fef0d4a714a90012efd815d4868688b82 Mon Sep 17 00:00:00 2001 From: Wouter Born Date: Sat, 6 Nov 2021 10:13:40 +0100 Subject: [PATCH] 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 --- itests/itest-common.bndrun | 4 +++ .../itest.bndrun | 2 -- itests/org.openhab.binding.feed.tests/pom.xml | 25 ------------------- .../itest.bndrun | 2 -- .../pom.xml | 23 ----------------- itests/pom.xml | 19 ++++++++++++++ 6 files changed, 23 insertions(+), 52 deletions(-) diff --git a/itests/itest-common.bndrun b/itests/itest-common.bndrun index 65c903d7514fe..6ff2541ba5d63 100644 --- a/itests/itest-common.bndrun +++ b/itests/itest-common.bndrun @@ -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: diff --git a/itests/org.openhab.binding.feed.tests/itest.bndrun b/itests/org.openhab.binding.feed.tests/itest.bndrun index 19572ada11ae7..9378160408139 100644 --- a/itests/org.openhab.binding.feed.tests/itest.bndrun +++ b/itests/org.openhab.binding.feed.tests/itest.bndrun @@ -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 # diff --git a/itests/org.openhab.binding.feed.tests/pom.xml b/itests/org.openhab.binding.feed.tests/pom.xml index c801dbfa88717..1fbe5d0ee410a 100644 --- a/itests/org.openhab.binding.feed.tests/pom.xml +++ b/itests/org.openhab.binding.feed.tests/pom.xml @@ -15,8 +15,6 @@ openHAB Add-ons :: Integration Tests :: Feed Binding Tests - 9090 - 1.15.0 @@ -44,27 +42,4 @@ - - - - org.codehaus.mojo - build-helper-maven-plugin - - - reserve-network-port - - reserve-network-port - - process-resources - - - org.osgi.service.http.port - - - - - - - - diff --git a/itests/org.openhab.binding.mielecloud.tests/itest.bndrun b/itests/org.openhab.binding.mielecloud.tests/itest.bndrun index 0fa85e225e0a5..47773da6de74d 100644 --- a/itests/org.openhab.binding.mielecloud.tests/itest.bndrun +++ b/itests/org.openhab.binding.mielecloud.tests/itest.bndrun @@ -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 # diff --git a/itests/org.openhab.binding.mielecloud.tests/pom.xml b/itests/org.openhab.binding.mielecloud.tests/pom.xml index bc399d0d5a9e5..a21efcf275a76 100644 --- a/itests/org.openhab.binding.mielecloud.tests/pom.xml +++ b/itests/org.openhab.binding.mielecloud.tests/pom.xml @@ -22,27 +22,4 @@ - - - - org.codehaus.mojo - build-helper-maven-plugin - - - reserve-network-port - - reserve-network-port - - process-resources - - - org.osgi.service.http.port - - - - - - - - diff --git a/itests/pom.xml b/itests/pom.xml index ad0e57ef8286b..e77f6eac4918c 100644 --- a/itests/pom.xml +++ b/itests/pom.xml @@ -38,6 +38,7 @@ target/dependency + 9090 @@ -179,6 +180,24 @@ + + org.codehaus.mojo + build-helper-maven-plugin + + + reserve-network-port + + reserve-network-port + + process-resources + + + org.osgi.service.http.port + + + + +