diff options
author | Jonatan Kronqvist <jonatan@vaadin.com> | 2014-05-05 11:41:09 +0300 |
---|---|---|
committer | Jonatan Kronqvist <jonatan@vaadin.com> | 2014-05-05 11:43:28 +0300 |
commit | 0745a29a958950b47dbc178d2c3f8c1f38c2af55 (patch) | |
tree | 8ee16701bec4b37e7a0601ec6bae97f34052bea1 /uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java | |
parent | 2efe580cb8dbd185fc154a7c7d6acb7efc4f16d5 (diff) | |
parent | 2c8c29e68b002ac6c498c3046a41822111c6d4ab (diff) | |
download | vaadin-framework-0745a29a958950b47dbc178d2c3f8c1f38c2af55.tar.gz vaadin-framework-0745a29a958950b47dbc178d2c3f8c1f38c2af55.zip |
Merge changes from origin/7.2 into master
Conflicts:
build.properties
client/src/com/vaadin/client/ApplicationConnection.java
client/src/com/vaadin/client/extensions/ResponsiveConnector.java
server/src/com/vaadin/server/Responsive.java
Change-Id: I49f90521611d1b86704a60c3d003cdeea9c3b864
Diffstat (limited to 'uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java')
-rw-r--r-- | uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java index a00ff7ab4d..97150f96ab 100644 --- a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java +++ b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java @@ -25,6 +25,7 @@ import java.net.SocketException; import java.util.Enumeration; import java.util.Properties; +import org.apache.commons.io.IOUtils; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxBinary; @@ -44,9 +45,8 @@ import com.vaadin.testbench.TestBench; public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { private static final String HOSTNAME_PROPERTY = "com.vaadin.testbench.deployment.hostname"; private static final String PORT_PROPERTY = "com.vaadin.testbench.deployment.port"; - private final Properties properties = new Properties(); - - public PrivateTB3Configuration() { + private static final Properties properties = new Properties(); + static { File file = new File("work", "eclipse-run-selected-test.properties"); if (file.exists()) { try { @@ -57,7 +57,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { } } - private String getProperty(String name) { + private static String getProperty(String name) { String property = properties.getProperty(name); if (property == null) { property = System.getProperty(name); @@ -86,6 +86,15 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { if (getClass().getAnnotation(RunLocally.class) != null) { return "localhost"; } + return getConfiguredDeploymentHostname(); + } + + /** + * Gets the hostname that tests are configured to use. + * + * @return the host name configuration value + */ + public static String getConfiguredDeploymentHostname() { String hostName = getProperty(HOSTNAME_PROPERTY); if (hostName == null || "".equals(hostName)) { @@ -97,6 +106,15 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { @Override protected int getDeploymentPort() { + return getConfiguredDeploymentPort(); + } + + /** + * Gets the port that tests are configured to use. + * + * @return the port configuration value + */ + public static int getConfiguredDeploymentPort() { String portString = getProperty(PORT_PROPERTY); int port = 8888; @@ -115,7 +133,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { * @throws RuntimeException * if there was an error or no IP was found */ - private String findAutoHostname() { + private static String findAutoHostname() { try { Enumeration<NetworkInterface> interfaces = NetworkInterface .getNetworkInterfaces(); |