From f3f89d66b1792ef862342aaee3366575713987ce Mon Sep 17 00:00:00 2001 From: Sauli Tähkäpää Date: Wed, 15 Oct 2014 13:24:37 +0300 Subject: Update atmosphere-runtime to 2.1.2.vaadin6. (#14674, #14861) Change-Id: Ie239bf110909f8acb47f2141431965061f9ac407 --- .../vaadin/tests/push/BasicPushWebsocketTest.java | 2 +- .../push/ExtremelyLongPushTimeWebsocketTest.java | 2 +- .../tests/push/IdlePushChannelWebsocketTest.java | 2 +- .../vaadin/tests/push/ReconnectWebsocketTest.java | 2 +- .../tests/push/RefreshCloseConnectionTest.java | 2 +- .../vaadin/tests/push/SendMultibyteCharacters.java | 23 ++++++++++++ .../SendMultibyteCharactersLongPollingTest.java | 9 +++++ .../push/SendMultibyteCharactersStreamingTest.java | 9 +++++ .../tests/push/SendMultibyteCharactersTest.java | 42 ++++++++++++++++++++++ .../push/SendMultibyteCharactersWebSocketTest.java | 19 ++++++++++ .../src/com/vaadin/tests/tb3/MultiBrowserTest.java | 10 ++++++ uitest/src/com/vaadin/tests/tb3/WebsocketTest.java | 24 ++----------- 12 files changed, 119 insertions(+), 27 deletions(-) create mode 100644 uitest/src/com/vaadin/tests/push/SendMultibyteCharacters.java create mode 100644 uitest/src/com/vaadin/tests/push/SendMultibyteCharactersLongPollingTest.java create mode 100644 uitest/src/com/vaadin/tests/push/SendMultibyteCharactersStreamingTest.java create mode 100644 uitest/src/com/vaadin/tests/push/SendMultibyteCharactersTest.java create mode 100644 uitest/src/com/vaadin/tests/push/SendMultibyteCharactersWebSocketTest.java (limited to 'uitest') diff --git a/uitest/src/com/vaadin/tests/push/BasicPushWebsocketTest.java b/uitest/src/com/vaadin/tests/push/BasicPushWebsocketTest.java index 093ee348b8..cd779a7318 100644 --- a/uitest/src/com/vaadin/tests/push/BasicPushWebsocketTest.java +++ b/uitest/src/com/vaadin/tests/push/BasicPushWebsocketTest.java @@ -24,6 +24,6 @@ import com.vaadin.tests.tb3.WebsocketTest; public class BasicPushWebsocketTest extends BasicPushTest { @Override public List getBrowsersToTest() { - return WebsocketTest.getWebsocketBrowsers(); + return getBrowsersSupportingWebSocket(); } } diff --git a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocketTest.java b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocketTest.java index c0b188bbab..54775d572d 100644 --- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocketTest.java +++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocketTest.java @@ -26,6 +26,6 @@ public class ExtremelyLongPushTimeWebsocketTest extends @Override public List getBrowsersToTest() { - return WebsocketTest.getWebsocketBrowsers(); + return getBrowsersSupportingWebSocket(); } } diff --git a/uitest/src/com/vaadin/tests/push/IdlePushChannelWebsocketTest.java b/uitest/src/com/vaadin/tests/push/IdlePushChannelWebsocketTest.java index 644dbd7580..7559d22264 100644 --- a/uitest/src/com/vaadin/tests/push/IdlePushChannelWebsocketTest.java +++ b/uitest/src/com/vaadin/tests/push/IdlePushChannelWebsocketTest.java @@ -30,6 +30,6 @@ public class IdlePushChannelWebsocketTest extends IdlePushChannelTest { @Override public List getBrowsersToTest() { - return WebsocketTest.getWebsocketBrowsers(); + return getBrowsersSupportingWebSocket(); } } diff --git a/uitest/src/com/vaadin/tests/push/ReconnectWebsocketTest.java b/uitest/src/com/vaadin/tests/push/ReconnectWebsocketTest.java index efaf5d493e..bad00eba47 100644 --- a/uitest/src/com/vaadin/tests/push/ReconnectWebsocketTest.java +++ b/uitest/src/com/vaadin/tests/push/ReconnectWebsocketTest.java @@ -25,7 +25,7 @@ public class ReconnectWebsocketTest extends ReconnectTest { @Override public List getBrowsersToTest() { - return WebsocketTest.getWebsocketBrowsers(); + return getBrowsersSupportingWebSocket(); } @Override diff --git a/uitest/src/com/vaadin/tests/push/RefreshCloseConnectionTest.java b/uitest/src/com/vaadin/tests/push/RefreshCloseConnectionTest.java index ef461ab0da..42babb00d0 100644 --- a/uitest/src/com/vaadin/tests/push/RefreshCloseConnectionTest.java +++ b/uitest/src/com/vaadin/tests/push/RefreshCloseConnectionTest.java @@ -42,6 +42,6 @@ public class RefreshCloseConnectionTest extends MultiBrowserTest { @Override public List getBrowsersToTest() { - return WebsocketTest.getWebsocketBrowsers(); + return getBrowsersSupportingWebSocket(); } } diff --git a/uitest/src/com/vaadin/tests/push/SendMultibyteCharacters.java b/uitest/src/com/vaadin/tests/push/SendMultibyteCharacters.java new file mode 100644 index 0000000000..e41f769724 --- /dev/null +++ b/uitest/src/com/vaadin/tests/push/SendMultibyteCharacters.java @@ -0,0 +1,23 @@ +package com.vaadin.tests.push; + +import com.vaadin.annotations.Push; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.TextArea; + +@Push +public class SendMultibyteCharacters extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + TextArea textArea = new TextArea(); + textArea.setImmediate(true); + + addComponent(textArea); + } + + @Override + protected Integer getTicketNumber() { + return 14674; + } +} diff --git a/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersLongPollingTest.java b/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersLongPollingTest.java new file mode 100644 index 0000000000..fd89982253 --- /dev/null +++ b/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersLongPollingTest.java @@ -0,0 +1,9 @@ +package com.vaadin.tests.push; + +public class SendMultibyteCharactersLongPollingTest extends SendMultibyteCharactersTest { + + @Override + protected String getTransport() { + return "long-polling"; + } +} diff --git a/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersStreamingTest.java b/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersStreamingTest.java new file mode 100644 index 0000000000..7b9ec38487 --- /dev/null +++ b/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersStreamingTest.java @@ -0,0 +1,9 @@ +package com.vaadin.tests.push; + +public class SendMultibyteCharactersStreamingTest extends SendMultibyteCharactersTest { + + @Override + protected String getTransport() { + return "streaming"; + } +} diff --git a/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersTest.java b/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersTest.java new file mode 100644 index 0000000000..1ced2fb506 --- /dev/null +++ b/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersTest.java @@ -0,0 +1,42 @@ +package com.vaadin.tests.push; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.elements.TextAreaElement; +import com.vaadin.tests.annotations.TestCategory; +import com.vaadin.tests.tb3.MultiBrowserTest; +import org.junit.Test; + +@TestCategory("push") +public abstract class SendMultibyteCharactersTest extends MultiBrowserTest { + + @Override + protected Class getUIClass() { + return SendMultibyteCharacters.class; + } + + protected abstract String getTransport(); + + @Test + public void transportSupportsMultibyteCharacters() { + setDebug(true); + openTestURL("transport=" + getTransport()); + openDebugLogTab(); + + TextAreaElement textArea = $(TextAreaElement.class).first(); + + StringBuilder text = new StringBuilder(); + for(int i=0;i < 20;i++) { + text.append("之は日本語です、テストです。"); + } + + textArea.sendKeys(text.toString()); + + clearDebugMessages(); + + findElement(By.tagName("body")).click(); + + waitForDebugMessage("Variable burst to be sent to server:", 5); + waitForDebugMessage("Handling message from server", 10); + } + +} \ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersWebSocketTest.java b/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersWebSocketTest.java new file mode 100644 index 0000000000..f37fb2efcb --- /dev/null +++ b/uitest/src/com/vaadin/tests/push/SendMultibyteCharactersWebSocketTest.java @@ -0,0 +1,19 @@ +package com.vaadin.tests.push; + + +import org.openqa.selenium.remote.DesiredCapabilities; + +import java.util.List; + +public class SendMultibyteCharactersWebSocketTest extends SendMultibyteCharactersTest { + + @Override + public List getBrowsersToTest() { + return getBrowsersSupportingWebSocket(); + } + + @Override + protected String getTransport() { + return "websocket"; + } +} diff --git a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java index d6eed3e5c8..ebcb02002e 100644 --- a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java +++ b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java @@ -40,6 +40,16 @@ import org.openqa.selenium.remote.DesiredCapabilities; */ public abstract class MultiBrowserTest extends PrivateTB3Configuration { + protected List getBrowsersSupportingWebSocket() { + List browsers = new ArrayList(getAllBrowsers()); + + browsers.remove(Browser.IE8.getDesiredCapabilities()); + browsers.remove(Browser.IE9.getDesiredCapabilities()); + browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities()); + + return browsers; + } + protected List getBrowsersExcludingPhantomJS() { List browsers = new ArrayList(getAllBrowsers()); diff --git a/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java b/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java index 778c8b9113..ddcc6d5d76 100644 --- a/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java +++ b/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java @@ -35,30 +35,10 @@ import com.vaadin.tests.tb3.MultiBrowserTest.Browser; * @author Vaadin Ltd */ @TestCategory("push") -public abstract class WebsocketTest extends PrivateTB3Configuration { - private static List websocketBrowsers = new ArrayList(); - static { - websocketBrowsers.addAll(MultiBrowserTest.getAllBrowsers()); - websocketBrowsers.remove(Browser.IE8.getDesiredCapabilities()); - websocketBrowsers.remove(Browser.IE9.getDesiredCapabilities()); - websocketBrowsers.remove(Browser.PHANTOMJS.getDesiredCapabilities()); - } - - /** - * @return All supported browsers which are actively tested and support - * websockets - */ - public static List getWebsocketBrowsers() { - return Collections.unmodifiableList(websocketBrowsers); - } +public abstract class WebsocketTest extends MultiBrowserTest { - /* - * (non-Javadoc) - * - * @see com.vaadin.tests.tb3.AbstractTB3Test#getBrowserToRunOn() - */ @Override public List getBrowsersToTest() { - return new ArrayList(getWebsocketBrowsers()); + return new ArrayList(getBrowsersSupportingWebSocket()); } } -- cgit v1.2.3