diff options
author | John Ahlroos <john@vaadin.com> | 2013-10-08 15:54:55 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-10-08 12:58:35 +0000 |
commit | 377d49ee174a6e2fb47152e5dbf0aac2db1276f5 (patch) | |
tree | 321f41b25d9603d172fc85014e2e1fea8b343c93 | |
parent | ebdc3652764e8ec2ce292879d459a8d0c6c2d2e3 (diff) | |
download | vaadin-framework-377d49ee174a6e2fb47152e5dbf0aac2db1276f5.tar.gz vaadin-framework-377d49ee174a6e2fb47152e5dbf0aac2db1276f5.zip |
Allow configuring deployment port for TB3 tests
Change-Id: Iee0827d1e65dcbc1fc6c71701b80f355285b6902
-rw-r--r-- | uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java | 9 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java | 12 |
2 files changed, 20 insertions, 1 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java index 38c5b29bf9..1967891a7a 100644 --- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java +++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java @@ -173,6 +173,13 @@ public abstract class AbstractTB3Test extends TestBenchTestCase { protected abstract String getDeploymentHostname(); /** + * Used to determine what port the test is running on + * + * @return The port teh test is running on, by default 8888 + */ + protected abstract String getDeploymentPort(); + + /** * Produces a collection of browsers to run the test on. This method is * executed by the test runner when determining how many test methods to * invoke and with what parameters. For each returned value a test method is @@ -562,7 +569,7 @@ public abstract class AbstractTB3Test extends TestBenchTestCase { * @return The base URL for the test. Does not include a trailing slash. */ protected String getBaseURL() { - return "http://" + getDeploymentHostname() + ":8888"; + return "http://" + getDeploymentHostname() + ":" + getDeploymentPort(); } /** diff --git a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java index 3d7dead928..09615f0b2e 100644 --- a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java +++ b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java @@ -34,6 +34,7 @@ import java.util.Properties; */ 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() { @@ -82,6 +83,17 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { return hostName; } + @Override + protected String getDeploymentPort() { + String port = getProperty(PORT_PROPERTY); + + if (port == null || "".equals(port)) { + port = "8888"; + } + + return port; + } + /** * Tries to automatically determine the IP address of the machine the test * is running on. |