]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix test url parameter concatenation.
authorSauli Tähkäpää <sauli@vaadin.com>
Tue, 24 Feb 2015 08:11:39 +0000 (10:11 +0200)
committerVaadin Code Review <review@vaadin.com>
Tue, 24 Feb 2015 13:36:22 +0000 (13:36 +0000)
Change-Id: I7063aedc870330c1159e44b05ac3e729ad837ba1

uitest/src/com/vaadin/tests/push/PushConfigurationTest.java
uitest/src/com/vaadin/tests/push/PushPathTest.java
uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java

index d42352161e04dffee545faf2ecc29b9a9ec86b0b..14ef9e11447b695fe96802c8982fdf04d3076b1c 100644 (file)
@@ -28,20 +28,20 @@ import com.vaadin.tests.tb3.MultiBrowserTest;
 @TestCategory("push")
 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");
 
index 6357c281f6a98c83ac9718e9afd92b7a2890900c..0af9c8d3a75c8642b6344f290a96d29a33b24f2d 100644 (file)
@@ -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();
     }
-
 }
index 99ae88805a48a1788bf31c281765426a7c58193b..ef32d9a0675cf48914492bf6e3c5a9e01f95c3c4 100644 (file)
@@ -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 "