summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSauli Tähkäpää <sauli@vaadin.com>2015-02-24 10:11:39 +0200
committerVaadin Code Review <review@vaadin.com>2015-02-24 13:36:22 +0000
commit7887363965d8a95d2caa80af1ba73e668565b538 (patch)
treed0babc4987fe61d3633bd69af5c593559526174d
parent4ee04a8348bc5645ed9b1d00807c64bb36ecb3ba (diff)
downloadvaadin-framework-7887363965d8a95d2caa80af1ba73e668565b538.tar.gz
vaadin-framework-7887363965d8a95d2caa80af1ba73e668565b538.zip
Fix test url parameter concatenation.
Change-Id: I7063aedc870330c1159e44b05ac3e729ad837ba1
-rw-r--r--uitest/src/com/vaadin/tests/push/PushConfigurationTest.java14
-rw-r--r--uitest/src/com/vaadin/tests/push/PushPathTest.java4
-rw-r--r--uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java26
3 files changed, 27 insertions, 17 deletions
diff --git a/uitest/src/com/vaadin/tests/push/PushConfigurationTest.java b/uitest/src/com/vaadin/tests/push/PushConfigurationTest.java
index d42352161e..14ef9e1144 100644
--- a/uitest/src/com/vaadin/tests/push/PushConfigurationTest.java
+++ b/uitest/src/com/vaadin/tests/push/PushConfigurationTest.java
@@ -29,19 +29,19 @@ import com.vaadin.tests.tb3.MultiBrowserTest;
abstract class PushConfigurationTest extends MultiBrowserTest {
@Override
+ protected Class<?> getUIClass() {
+ return PushConfiguration.class;
+ }
+
+ @Override
public void setup() throws Exception {
super.setup();
+ setDebug(true);
- openTestURL();
+ openTestURL("restartApplication");
disablePush();
}
- @Override
- protected String getDeploymentPath() {
- return "/run/" + PushConfiguration.class.getCanonicalName()
- + "?restartApplication&debug";
- }
-
protected String getStatusText() {
WebElement statusLabel = vaadinElementById("status");
diff --git a/uitest/src/com/vaadin/tests/push/PushPathTest.java b/uitest/src/com/vaadin/tests/push/PushPathTest.java
index 6357c281f6..0af9c8d3a7 100644
--- a/uitest/src/com/vaadin/tests/push/PushPathTest.java
+++ b/uitest/src/com/vaadin/tests/push/PushPathTest.java
@@ -33,9 +33,7 @@ public class PushPathTest extends WebsocketTest {
}
@Override
- public String getDeploymentPath() {
- Class<?> uiClass = getUIClass();
+ protected String getDeploymentPath(Class<?> uiClass) {
return "/run-pushpath/" + uiClass.getCanonicalName();
}
-
}
diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
index 99ae88805a..ef32d9a067 100644
--- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
+++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
@@ -22,9 +22,12 @@ import java.io.StringWriter;
import java.lang.reflect.Field;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
+import java.util.HashSet;
import java.util.List;
import java.util.NoSuchElementException;
+import java.util.Set;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
@@ -229,9 +232,21 @@ public abstract class AbstractTB3Test extends ParallelTest {
* {@link #isPush()}.
*/
protected void openTestURL(Class<?> uiClass, String... parameters) {
+ openTestURL(uiClass, new HashSet<String>(Arrays.asList(parameters)));
+ }
+
+ private void openTestURL(Class<?> uiClass, Set<String> parameters) {
String url = getTestURL(uiClass);
- if (parameters.length > 0) {
+ if(isDebug()) {
+ parameters.add("debug");
+ }
+
+ if (LegacyApplication.class.isAssignableFrom(uiClass)) {
+ parameters.add("restartApplication");
+ }
+
+ if (parameters.size() > 0) {
url += "?" + Joiner.on("&").join(parameters);
}
@@ -687,12 +702,9 @@ public abstract class AbstractTB3Test extends ParallelTest {
}
if (UI.class.isAssignableFrom(uiClass)
- || UIProvider.class.isAssignableFrom(uiClass)) {
- return runPath + "/" + uiClass.getCanonicalName()
- + (isDebug() ? "?debug" : "");
- } else if (LegacyApplication.class.isAssignableFrom(uiClass)) {
- return runPath + "/" + uiClass.getCanonicalName()
- + "?restartApplication" + (isDebug() ? "&debug" : "");
+ || UIProvider.class.isAssignableFrom(uiClass)
+ || LegacyApplication.class.isAssignableFrom(uiClass)) {
+ return runPath + "/" + uiClass.getCanonicalName();
} else {
throw new IllegalArgumentException(
"Unable to determine path for enclosing class "