]> git.basschouten.com Git - openhab-addons.git/commitdiff
Always run OSGi HTTP service on random port in itests (#11523)
authorWouter Born <github@maindrain.net>
Sat, 6 Nov 2021 09:13:40 +0000 (10:13 +0100)
committerGitHub <noreply@github.com>
Sat, 6 Nov 2021 09:13:40 +0000 (10:13 +0100)
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>
itests/itest-common.bndrun
itests/org.openhab.binding.feed.tests/itest.bndrun
itests/org.openhab.binding.feed.tests/pom.xml
itests/org.openhab.binding.mielecloud.tests/itest.bndrun
itests/org.openhab.binding.mielecloud.tests/pom.xml
itests/pom.xml

index 65c903d7514fee4bbfc5a3c6de78760d63e6131a..6ff2541ba5d638677666bb3bee1dda9185bf0f6e 100644 (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: 
index 19572ada11ae7e8f99ee7735da92d324801c7858..9378160408139bcec689d831fb963f1a52e0f1cf 100644 (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
 #
index c801dbfa887176c46dd7d0d55b5201d447e33c0f..1fbe5d0ee410a3284f5fd1452203c544ce014583 100644 (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>
 
     </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>
index 0fa85e225e0a59cb8eae09f536d09fa4bc2e5ae4..47773da6de74d5caa355784bb71603a16b7055cb 100644 (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
 #
index bc399d0d5a9e5c5897d4223592967043d295ea0c..a21efcf275a76053265b44a41687dddc2cbc2a1d 100644 (file)
     </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>
index ad0e57ef8286bac72ca9ac963e8c90d5dc94a48e..e77f6eac4918c4b314000777e5dd01e8833b3ded 100644 (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>
               </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>