aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/push
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2014-08-07 16:32:23 +0300
committerJohn Ahlroos <john@vaadin.com>2014-08-07 16:35:06 +0300
commitecff9648d1cb3d5cc4bd54d2b1e1c6357429792f (patch)
treeb21f4b599183c157900b0f24d41c94e6af3b08a7 /uitest/src/com/vaadin/tests/push
parente5230e6a2433f5c8a74c66b73e96d0454866d316 (diff)
parentff47bdd97b03a42dfc812b4dc9ad71fa45ce3827 (diff)
downloadvaadin-framework-ecff9648d1cb3d5cc4bd54d2b1e1c6357429792f.tar.gz
vaadin-framework-ecff9648d1cb3d5cc4bd54d2b1e1c6357429792f.zip
Merge remote-tracking branch 'origin/master' into grid
Conflicts: WebContent/release-notes.html Change-Id: Ie05bea7142134a7a9d655fcdf6ca232fd13c742b
Diffstat (limited to 'uitest/src/com/vaadin/tests/push')
-rw-r--r--uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeTest.java2
-rw-r--r--uitest/src/com/vaadin/tests/push/PushConfigurationLongPollingTest.java3
-rw-r--r--uitest/src/com/vaadin/tests/push/PushLargeDataLongPollingTest.java2
-rw-r--r--uitest/src/com/vaadin/tests/push/PushLargeDataStreamingTest.java2
-rw-r--r--uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java2
-rw-r--r--uitest/src/com/vaadin/tests/push/ReconnectLongPollingTest.java1
-rwxr-xr-xuitest/src/com/vaadin/tests/push/ReconnectStreamingTest.java1
-rw-r--r--uitest/src/com/vaadin/tests/push/RefreshCloseConnection.java61
-rw-r--r--uitest/src/com/vaadin/tests/push/RefreshCloseConnectionTest.java44
9 files changed, 111 insertions, 7 deletions
diff --git a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeTest.java b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeTest.java
index 06ddc07abb..5dc15f8fc6 100644
--- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeTest.java
+++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeTest.java
@@ -36,7 +36,7 @@ public abstract class ExtremelyLongPushTimeTest extends MultiBrowserTest {
testBench(driver).disableWaitForVaadin();
// Wait for startButton to be present
- waitForElementToBePresent(vaadinLocatorById("startButton"));
+ waitForElementVisible(vaadinLocatorById("startButton"));
String logRow0Id = "Log_row_0";
By logRow0 = vaadinLocatorById(logRow0Id);
diff --git a/uitest/src/com/vaadin/tests/push/PushConfigurationLongPollingTest.java b/uitest/src/com/vaadin/tests/push/PushConfigurationLongPollingTest.java
index f2207ccba7..a04d569e05 100644
--- a/uitest/src/com/vaadin/tests/push/PushConfigurationLongPollingTest.java
+++ b/uitest/src/com/vaadin/tests/push/PushConfigurationLongPollingTest.java
@@ -37,7 +37,8 @@ public class PushConfigurationLongPollingTest extends PushConfigurationTest {
clearDebugMessages();
new Select(getPushModeSelect()).selectByVisibleText("AUTOMATIC");
- waitForDebugMessage("Push connection established using long-polling", 10);
+ waitForDebugMessage("Push connection established using long-polling",
+ 10);
waitForServerCounterToUpdate();
}
diff --git a/uitest/src/com/vaadin/tests/push/PushLargeDataLongPollingTest.java b/uitest/src/com/vaadin/tests/push/PushLargeDataLongPollingTest.java
index 00ee6bae25..e37bd32832 100644
--- a/uitest/src/com/vaadin/tests/push/PushLargeDataLongPollingTest.java
+++ b/uitest/src/com/vaadin/tests/push/PushLargeDataLongPollingTest.java
@@ -42,7 +42,7 @@ public class PushLargeDataLongPollingTest extends MultiBrowserTest {
private void push() throws InterruptedException {
// Wait for startButton to be present
- waitForElementToBePresent(vaadinLocatorById("startButton"));
+ waitForElementVisible(vaadinLocatorById("startButton"));
String logRow0Id = "Log_row_0";
By logRow0 = vaadinLocatorById(logRow0Id);
diff --git a/uitest/src/com/vaadin/tests/push/PushLargeDataStreamingTest.java b/uitest/src/com/vaadin/tests/push/PushLargeDataStreamingTest.java
index 26fa512ab2..058ac6cc92 100644
--- a/uitest/src/com/vaadin/tests/push/PushLargeDataStreamingTest.java
+++ b/uitest/src/com/vaadin/tests/push/PushLargeDataStreamingTest.java
@@ -42,7 +42,7 @@ public class PushLargeDataStreamingTest extends MultiBrowserTest {
private void push() throws InterruptedException {
// Wait for startButton to be present
- waitForElementToBePresent(vaadinLocatorById("startButton"));
+ waitForElementVisible(vaadinLocatorById("startButton"));
String logRow0Id = "Log_row_0";
By logRow0 = vaadinLocatorById(logRow0Id);
diff --git a/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java b/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java
index 57fb8c33b0..da4999799d 100644
--- a/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java
+++ b/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java
@@ -40,7 +40,7 @@ public class PushLargeDataWebsocketTest extends WebsocketTest {
private void push() throws Exception {
// Wait for startButton to be present
- waitForElementToBePresent(vaadinLocatorById("startButton"));
+ waitForElementVisible(vaadinLocatorById("startButton"));
String logRow0Id = "Log_row_0";
By logRow0 = vaadinLocatorById(logRow0Id);
diff --git a/uitest/src/com/vaadin/tests/push/ReconnectLongPollingTest.java b/uitest/src/com/vaadin/tests/push/ReconnectLongPollingTest.java
index 8a4593d70d..28ef30a04a 100644
--- a/uitest/src/com/vaadin/tests/push/ReconnectLongPollingTest.java
+++ b/uitest/src/com/vaadin/tests/push/ReconnectLongPollingTest.java
@@ -15,7 +15,6 @@
*/
package com.vaadin.tests.push;
-
public class ReconnectLongPollingTest extends ReconnectTest {
@Override
diff --git a/uitest/src/com/vaadin/tests/push/ReconnectStreamingTest.java b/uitest/src/com/vaadin/tests/push/ReconnectStreamingTest.java
index fe63764e78..0a0275c4d0 100755
--- a/uitest/src/com/vaadin/tests/push/ReconnectStreamingTest.java
+++ b/uitest/src/com/vaadin/tests/push/ReconnectStreamingTest.java
@@ -15,7 +15,6 @@
*/
package com.vaadin.tests.push;
-
public class ReconnectStreamingTest extends ReconnectTest {
@Override
diff --git a/uitest/src/com/vaadin/tests/push/RefreshCloseConnection.java b/uitest/src/com/vaadin/tests/push/RefreshCloseConnection.java
new file mode 100644
index 0000000000..4d02c4e62e
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/push/RefreshCloseConnection.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.push;
+
+import com.vaadin.annotations.PreserveOnRefresh;
+import com.vaadin.annotations.Push;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUIWithLog;
+
+@Push
+@PreserveOnRefresh
+public class RefreshCloseConnection extends AbstractTestUIWithLog {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ log("Init");
+ }
+
+ @Override
+ protected void refresh(VaadinRequest request) {
+ if (getPushConnection().isConnected()) {
+ log("Still connected");
+ }
+ log("Refresh");
+ new Thread() {
+ @Override
+ public void run() {
+ accessSynchronously(new Runnable() {
+ @Override
+ public void run() {
+ log("Push");
+ }
+ });
+ }
+ }.start();
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "A log row should get pushed after reloading the page";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(14251);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/push/RefreshCloseConnectionTest.java b/uitest/src/com/vaadin/tests/push/RefreshCloseConnectionTest.java
new file mode 100644
index 0000000000..c5c6064555
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/push/RefreshCloseConnectionTest.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.push;
+
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.remote.DesiredCapabilities;
+
+import com.vaadin.tests.tb3.MultiBrowserTest;
+import com.vaadin.tests.tb3.WebsocketTest;
+
+public class RefreshCloseConnectionTest extends MultiBrowserTest {
+ @Test
+ public void testSessionRefresh() {
+ openTestURL();
+
+ Assert.assertEquals("1. Init", getLogRow(0));
+
+ openTestURL();
+
+ Assert.assertEquals("2. Refresh", getLogRow(1));
+ Assert.assertEquals("3. Push", getLogRow(0));
+ }
+
+ @Override
+ public List<DesiredCapabilities> getBrowsersToTest() {
+ return WebsocketTest.getWebsocketBrowsers();
+ }
+}