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
#
</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>
import org.openhab.binding.mielecloud.internal.util.MieleCloudBindingIntegrationTestConstants;
import org.openhab.binding.mielecloud.internal.util.ReflectionUtil;
import org.openhab.binding.mielecloud.internal.util.Website;
+import org.openhab.binding.mielecloud.internal.util.WebsiteCrawler;
import org.openhab.binding.mielecloud.internal.webservice.MieleWebservice;
import org.openhab.binding.mielecloud.internal.webservice.MieleWebserviceFactory;
import org.openhab.core.thing.Thing;
+ ForwardToLoginServlet.BRIDGE_ID_PARAMETER_NAME + "="
+ MieleCloudBindingIntegrationTestConstants.BRIDGE_ID + "&" + ForwardToLoginServlet.EMAIL_PARAMETER_NAME
+ "=" + MieleCloudBindingIntegrationTestConstants.EMAIL);
- String redirectionUrl = mieleLoginSite.getValueOfInput("redirect_uri").replace("http://127.0.0.1:8080", "");
+ String redirectionUrl = mieleLoginSite.getValueOfInput("redirect_uri")
+ .replace("http://127.0.0.1:" + WebsiteCrawler.getServerPort(), "");
String state = mieleLoginSite.getValueOfInput("state");
Website resultSite = getCrawler().doGetRelative(redirectionUrl + "?code="
* @throws Exception if anything goes wrong.
*/
public Website doGetRelative(String relativeUrl) throws Exception {
- ContentResponse response = httpClient.GET("http://127.0.0.1:8080" + relativeUrl);
+ ContentResponse response = httpClient.GET("http://127.0.0.1:" + getServerPort() + relativeUrl);
assertEquals(200, response.getStatus());
return new Website(response.getContentAsString());
}
+
+ /**
+ * Gets the port the webserver for this integration test instance is running on. The port is reserved in the pom.xml
+ * by the build-helper-maven-plugin.
+ */
+ public static int getServerPort() {
+ return Integer.getInteger("org.osgi.service.http.port", 8080);
+ }
}