From 38aedc92222a0be75364439faec2f223c15808f2 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Fri, 24 Aug 2018 11:25:06 +0300 Subject: [PATCH] Introduce servlet container tests from Vaadin 8 (#11128) --- .gitignore | 2 +- .../addon-using-init-param-widget-set/pom.xml | 1 - test/pom.xml | 95 ++++- test/servlet-containers/generic-tests/pom.xml | 33 ++ .../integration/AbstractIntegrationTest.java | 146 ++++++++ .../AbstractServletIntegrationTest.java | 30 ++ .../ServletIntegrationDefaultPushIT.java | 26 ++ .../integration/ServletIntegrationIT.java | 25 ++ .../ServletIntegrationLongPollingIT.java | 26 ++ .../ServletIntegrationStreamingIT.java | 26 ++ .../integration/ServletIntegrationTests.java | 57 +++ .../push/LongPollingProxyServerIT.java | 125 +++++++ .../ServletIntegrationWebsocketIT.java | 79 ++++ .../ServletIntegrationJSR356WebsocketIT.java | 47 +++ test/servlet-containers/generic-ui/pom.xml | 27 ++ .../tests/IntegrationTestUIProvider.java | 58 +++ .../java/com/vaadin/tests/JSR356Servlet.java | 18 + .../tests/ServerIntegrationTestServlet.java | 14 + .../ServletIntegrationDefaultPushUI.java | 29 ++ .../ServletIntegrationLongPollingUI.java | 30 ++ .../ServletIntegrationStreamingUI.java | 30 ++ .../integration/ServletIntegrationUI.java | 83 +++++ .../ServletIntegrationWebsocketUI.java | 48 +++ .../integration/push/AbstractTestUI.java | 226 ++++++++++++ .../tests/integration/push/BasicPush.java | 146 ++++++++ .../push/BasicPushLongPolling.java | 34 ++ .../main/resources/VAADIN/themes/valo/fi.gif | Bin 0 -> 371 bytes .../main/resources/VAADIN/themes/valo/se.gif | Bin 0 -> 367 bytes .../tests/integration/LabelFromDesign.html | 1 + test/servlet-containers/generic/.gitignore | 1 + .../generic/build.properties | 8 + test/servlet-containers/generic/build.xml | 52 +++ test/servlet-containers/generic/common.xml | 18 + .../generic/integration_base_files/base.xml | 144 ++++++++ .../generic/integration_base_files/cleanup.sh | 26 ++ .../integration_base_files/lock_age.sh | 21 ++ .../generic/integration_tests.xml | 339 ++++++++++++++++++ .../generic/ivy-taskdefs.xml | 24 ++ test/servlet-containers/generic/ivy.xml | 130 +++++++ .../generic/ivysettings.xml | 75 ++++ test/servlet-containers/generic/pom.xml | 97 +++++ .../finland-phantomjs.png | Bin 0 -> 10897 bytes .../initial-phantomjs.png | Bin 0 -> 10130 bytes .../src/main/jboss-6/WEB-INF/jboss-web.xml | 7 + test/servlet-containers/glassfish/pom.xml | 64 ++++ test/servlet-containers/jetty8/pom.xml | 73 ++++ test/servlet-containers/jetty9/pom.xml | 43 +++ .../jsp-integration/pom.xml | 27 ++ .../tests/integration/AnotherTrivialUI.java | 28 ++ .../vaadin/tests/integration/TrivialUI.java | 28 ++ .../src/main/webapp/WEB-INF/web.xml | 57 +++ .../webapp/staticfiles/vaadinsessions.jsp | 54 +++ .../tests/integration/JSPIntegrationIT.java | 90 +++++ .../servlet-containers/liberty-javaee/pom.xml | 54 +++ .../liberty-webprofile/pom.xml | 54 +++ test/servlet-containers/pom.xml | 277 ++++++++++++++ .../screenshots/finland-phantomjs.png | Bin 0 -> 10907 bytes .../screenshots/initial-phantomjs.png | Bin 0 -> 10145 bytes test/servlet-containers/tomcat7/pom.xml | 53 +++ test/servlet-containers/tomcat80/pom.xml | 53 +++ test/servlet-containers/tomcat85/pom.xml | 53 +++ test/servlet-containers/tomcat9/pom.xml | 53 +++ test/servlet-containers/wildfly10/pom.xml | 43 +++ test/servlet-containers/wildfly11/pom.xml | 43 +++ test/servlet-containers/wildfly12/pom.xml | 43 +++ test/servlet-containers/wildfly13/pom.xml | 43 +++ test/servlet-containers/wildfly8/pom.xml | 43 +++ test/servlet-containers/wildfly9/pom.xml | 43 +++ .../defaultwidgetset/AbstractWidgetSetIT.java | 7 +- uitest/vaadin-server.xml | 34 -- 70 files changed, 3718 insertions(+), 46 deletions(-) create mode 100644 test/servlet-containers/generic-tests/pom.xml create mode 100644 test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/AbstractIntegrationTest.java create mode 100644 test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/AbstractServletIntegrationTest.java create mode 100644 test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationDefaultPushIT.java create mode 100644 test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationIT.java create mode 100644 test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationLongPollingIT.java create mode 100644 test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationStreamingIT.java create mode 100644 test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationTests.java create mode 100644 test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/push/LongPollingProxyServerIT.java create mode 100644 test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/ServletIntegrationWebsocketIT.java create mode 100644 test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/jsr356/ServletIntegrationJSR356WebsocketIT.java create mode 100644 test/servlet-containers/generic-ui/pom.xml create mode 100644 test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/IntegrationTestUIProvider.java create mode 100644 test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/JSR356Servlet.java create mode 100644 test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/ServerIntegrationTestServlet.java create mode 100644 test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java create mode 100644 test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java create mode 100644 test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java create mode 100644 test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationUI.java create mode 100644 test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java create mode 100644 test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/push/AbstractTestUI.java create mode 100644 test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/push/BasicPush.java create mode 100644 test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/push/BasicPushLongPolling.java create mode 100644 test/servlet-containers/generic-ui/src/main/resources/VAADIN/themes/valo/fi.gif create mode 100644 test/servlet-containers/generic-ui/src/main/resources/VAADIN/themes/valo/se.gif create mode 100644 test/servlet-containers/generic-ui/src/main/resources/com/vaadin/tests/integration/LabelFromDesign.html create mode 100644 test/servlet-containers/generic/.gitignore create mode 100644 test/servlet-containers/generic/build.properties create mode 100644 test/servlet-containers/generic/build.xml create mode 100644 test/servlet-containers/generic/common.xml create mode 100644 test/servlet-containers/generic/integration_base_files/base.xml create mode 100644 test/servlet-containers/generic/integration_base_files/cleanup.sh create mode 100644 test/servlet-containers/generic/integration_base_files/lock_age.sh create mode 100644 test/servlet-containers/generic/integration_tests.xml create mode 100644 test/servlet-containers/generic/ivy-taskdefs.xml create mode 100644 test/servlet-containers/generic/ivy.xml create mode 100644 test/servlet-containers/generic/ivysettings.xml create mode 100644 test/servlet-containers/generic/pom.xml create mode 100644 test/servlet-containers/generic/reference-screenshots/finland-phantomjs.png create mode 100644 test/servlet-containers/generic/reference-screenshots/initial-phantomjs.png create mode 100644 test/servlet-containers/generic/src/main/jboss-6/WEB-INF/jboss-web.xml create mode 100644 test/servlet-containers/glassfish/pom.xml create mode 100644 test/servlet-containers/jetty8/pom.xml create mode 100644 test/servlet-containers/jetty9/pom.xml create mode 100644 test/servlet-containers/jsp-integration/pom.xml create mode 100644 test/servlet-containers/jsp-integration/src/main/java/com/vaadin/tests/integration/AnotherTrivialUI.java create mode 100644 test/servlet-containers/jsp-integration/src/main/java/com/vaadin/tests/integration/TrivialUI.java create mode 100644 test/servlet-containers/jsp-integration/src/main/webapp/WEB-INF/web.xml create mode 100644 test/servlet-containers/jsp-integration/src/main/webapp/staticfiles/vaadinsessions.jsp create mode 100644 test/servlet-containers/jsp-integration/src/test/java/com/vaadin/tests/integration/JSPIntegrationIT.java create mode 100644 test/servlet-containers/liberty-javaee/pom.xml create mode 100644 test/servlet-containers/liberty-webprofile/pom.xml create mode 100644 test/servlet-containers/pom.xml create mode 100644 test/servlet-containers/screenshots/finland-phantomjs.png create mode 100644 test/servlet-containers/screenshots/initial-phantomjs.png create mode 100644 test/servlet-containers/tomcat7/pom.xml create mode 100644 test/servlet-containers/tomcat80/pom.xml create mode 100644 test/servlet-containers/tomcat85/pom.xml create mode 100644 test/servlet-containers/tomcat9/pom.xml create mode 100644 test/servlet-containers/wildfly10/pom.xml create mode 100644 test/servlet-containers/wildfly11/pom.xml create mode 100644 test/servlet-containers/wildfly12/pom.xml create mode 100644 test/servlet-containers/wildfly13/pom.xml create mode 100644 test/servlet-containers/wildfly8/pom.xml create mode 100644 test/servlet-containers/wildfly9/pom.xml delete mode 100644 uitest/vaadin-server.xml diff --git a/.gitignore b/.gitignore index d55a19aa04..fb667fdc3d 100644 --- a/.gitignore +++ b/.gitignore @@ -61,4 +61,4 @@ phantomjsdriver.log .idea */.checkstyle - +error-screenshots diff --git a/test/addon-using-init-param-widget-set/pom.xml b/test/addon-using-init-param-widget-set/pom.xml index cd1f3d1b17..bc9df56444 100644 --- a/test/addon-using-init-param-widget-set/pom.xml +++ b/test/addon-using-init-param-widget-set/pom.xml @@ -32,7 +32,6 @@ com.vaadin vaadin-client-compiled - ${project.version} diff --git a/test/pom.xml b/test/pom.xml index b9c3456b03..bf36456e2a 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -2,16 +2,21 @@ 4.0.0 - - com.vaadin - vaadin-root - 7.7-SNAPSHOT - + com.vaadin vaadin-test + 7.7-SNAPSHOT vaadin-test pom + 1.6 + 1.6 false + 9.3.7.v20160115 + 2.1.1 + 4.2.2 + 7.7.14 + ${project.version} + ${vaadin.version} @@ -19,8 +24,61 @@ vaadin-addons http://maven.vaadin.com/vaadin-addons + + vaadin-prereleases + http://maven.vaadin.com/vaadin-prereleases + + + vaadin-snapshots + http://oss.sonatype.org/content/repositories/vaadin-snapshots + + false + + + true + + + + + vaadin-prereleases + http://maven.vaadin.com/vaadin-prereleases + + + vaadin-snapshots + http://oss.sonatype.org/content/repositories/vaadin-snapshots + + false + + + true + + + + + + + + com.vaadin + vaadin-bom + ${vaadin.version} + pom + import + + + junit + junit + 4.11 + + + com.vaadin + vaadin-testbench-api + ${testbench.api.version} + + + + @@ -28,12 +86,10 @@ com.vaadin vaadin-server - ${project.version} com.vaadin vaadin-themes - ${project.version} @@ -49,7 +105,6 @@ junit junit - 4.11 test @@ -61,7 +116,7 @@ com.vaadin vaadin-testbench - 4.0.3 + ${testbench.version} test @@ -75,9 +130,24 @@ addon-using-init-param-widget-set space in directory vaadinservletconfiguration-widget-set + servlet-containers + + + + com.vaadin + vaadin-maven-plugin + ${vaadin.maven.version} + + + maven-jar-plugin + 3.1.0 + + + + org.eclipse.jetty @@ -111,6 +181,7 @@ com.github.klieber phantomjs-maven-plugin + 0.7 @@ -125,9 +196,11 @@ maven-surefire-plugin + 2.22.0 maven-failsafe-plugin + 2.22.0 @@ -139,7 +212,11 @@ ${phantomjs.binary} + ${server.name} + ${reference.directory} + target/error-screenshots + true diff --git a/test/servlet-containers/generic-tests/pom.xml b/test/servlet-containers/generic-tests/pom.xml new file mode 100644 index 0000000000..794849a6d7 --- /dev/null +++ b/test/servlet-containers/generic-tests/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-server-tests + vaadin-test-server-tests + jar + + true + + + + + com.vaadin + vaadin-test-server-ui + ${project.version} + provided + + + com.vaadin + vaadin-testbench-api + + + junit + junit + + + diff --git a/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/AbstractIntegrationTest.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/AbstractIntegrationTest.java new file mode 100644 index 0000000000..cac426258f --- /dev/null +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/AbstractIntegrationTest.java @@ -0,0 +1,146 @@ +package com.vaadin.tests.integration; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.util.Locale; +import java.util.logging.Logger; + +import javax.imageio.ImageIO; + +import com.google.common.base.Predicate; +import com.vaadin.testbench.By; +import org.junit.After; +import org.junit.rules.ExpectedException; +import org.junit.runner.RunWith; + +import com.vaadin.testbench.annotations.RunLocally; +import com.vaadin.testbench.elements.UIElement; +import com.vaadin.testbench.parallel.Browser; +import com.vaadin.testbench.parallel.ParallelRunner; +import com.vaadin.testbench.parallel.ParallelTest; +import com.vaadin.testbench.parallel.TestNameSuffix; +import com.vaadin.testbench.screenshot.ImageFileUtil; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.support.ui.ExpectedCondition; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; + +@RunLocally(Browser.PHANTOMJS) +@RunWith(ParallelRunner.class) +@TestNameSuffix(property = "server-name") +public abstract class AbstractIntegrationTest extends ParallelTest { + + /** + * Height of the screenshots we want to capture + */ + private static final int SCREENSHOT_HEIGHT = 850; + + /** + * Width of the screenshots we want to capture + */ + private static final int SCREENSHOT_WIDTH = 1500; + + private boolean screenshotErrors; + + @Override + public void setup() throws Exception { + super.setup(); + + testBench().resizeViewPortTo(SCREENSHOT_WIDTH, SCREENSHOT_HEIGHT); + + openTestURL(getParameters()); + } + + protected void openTestURL(String[] parameters) { + StringBuilder builder = new StringBuilder(); + builder.append(getDeploymentURL()).append(getContextPath()).append(getTestPath()); + builder.append("?"); + for (int i = 0; i < parameters.length; ++i) { + builder.append(parameters[i]); + if (i < parameters.length - 1) { + builder.append("&"); + } + } + + driver.get(builder.toString()); + + if (!isElementPresent(UIElement.class)) { + waitUntil(new ExpectedCondition() { + @Override + public Boolean apply(WebDriver webDriver) { + return isElementPresent(UIElement.class); + } + }); + } + } + + protected String[] getParameters() { + return new String[]{ "restartApplication" }; + } + + /** + * Returns a path where the test UI is found. + * + * @return path for test + */ + protected abstract String getTestPath(); + + private String getDeploymentURL() { + String deploymentUrl = System.getProperty("deployment.url"); + if (deploymentUrl == null || deploymentUrl.isEmpty()) { + // Default to http://localhost:8080 + return "http://localhost:8080"; + } + return deploymentUrl; + } + + protected void compareScreen(String identifier) throws IOException { + String refFileName = identifier + "-" + + getDesiredCapabilities().getBrowserName().toLowerCase(Locale.ROOT) + + ".png"; + String errorFileName = identifier + "-" + + getDesiredCapabilities().getBrowserName().toLowerCase(Locale.ROOT) + "-" + + System.getProperty("server-name") + "[" + + getClass().getSimpleName() + "].png"; + File referenceFile = ImageFileUtil + .getReferenceScreenshotFile(refFileName); + try { + BufferedImage reference = ImageIO.read(referenceFile); + if (testBench().compareScreen(reference, errorFileName)) { + return; + } + } catch (IOException e) { + Logger.getLogger(getClass().getName()).warning( + "Missing screenshot reference: " + referenceFile.getPath()); + } + screenshotErrors = true; + } + + @After + public void teardown() { + if (screenshotErrors) { + throw new RuntimeException("Screenshots failed."); + } + } + + /** + * Returns the deployment context path with a leading slash. If not provided + * through {@code deployment.context.path} system property, will default to + * {@code /demo}. + * + * @return deployment context path + */ + protected String getContextPath() { + String contextPath = System.getProperty("deployment.context.path"); + if (contextPath == null || contextPath.isEmpty()) { + // Default to /demo + return "/demo"; + } + return contextPath; + } + + protected void waitUntil(ExpectedCondition condition) { + new WebDriverWait(driver, 10).until(condition); + } +} diff --git a/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/AbstractServletIntegrationTest.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/AbstractServletIntegrationTest.java new file mode 100644 index 0000000000..03d4f1ce18 --- /dev/null +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/AbstractServletIntegrationTest.java @@ -0,0 +1,30 @@ +package com.vaadin.tests.integration; + +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.testbench.elements.GridElement; +import com.vaadin.testbench.elements.LabelElement; + +public abstract class AbstractServletIntegrationTest + extends AbstractIntegrationTest { + + @Test + public void runTest() throws Exception { + // Test initial state + GridElement grid = $(GridElement.class).first(); + Assert.assertFalse("Row should not be initially selected", + grid.getRow(0).isSelected()); + compareScreen("initial"); + + // Test selection and side effects + grid.getCell(0, 1).click(); + Assert.assertTrue("Row should be selected on click", + grid.getRow(0).isSelected()); + Assert.assertEquals("Text label should contain 'FI'", "FI", + $(LabelElement.class).first().getText()); + compareScreen("finland"); + + } + +} diff --git a/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationDefaultPushIT.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationDefaultPushIT.java new file mode 100644 index 0000000000..d5a41c30ba --- /dev/null +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationDefaultPushIT.java @@ -0,0 +1,26 @@ +/* + * Copyright 2000-2018 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.integration; + +public class ServletIntegrationDefaultPushIT + extends AbstractServletIntegrationTest { + // Uses the test method declared in the super class + + @Override + protected String getTestPath() { + return "/run/ServletIntegrationDefaultPushUI"; + } +} diff --git a/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationIT.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationIT.java new file mode 100644 index 0000000000..ec5c8f6af3 --- /dev/null +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationIT.java @@ -0,0 +1,25 @@ +/* + * Copyright 2000-2018 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.integration; + +public class ServletIntegrationIT extends AbstractServletIntegrationTest { + // Uses the test method declared in the super class + + @Override + protected String getTestPath() { + return "/run/ServletIntegrationUI"; + } +} diff --git a/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationLongPollingIT.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationLongPollingIT.java new file mode 100644 index 0000000000..888668a211 --- /dev/null +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationLongPollingIT.java @@ -0,0 +1,26 @@ +/* + * Copyright 2000-2018 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.integration; + +public class ServletIntegrationLongPollingIT + extends AbstractServletIntegrationTest { + // Uses the test method declared in the super class + + @Override + protected String getTestPath() { + return "/run/ServletIntegrationLongPollingUI"; + } +} diff --git a/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationStreamingIT.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationStreamingIT.java new file mode 100644 index 0000000000..e1050b326f --- /dev/null +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationStreamingIT.java @@ -0,0 +1,26 @@ +/* + * Copyright 2000-2018 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.integration; + +public class ServletIntegrationStreamingIT + extends AbstractServletIntegrationTest { + // Uses the test method declared in the super class + + @Override + protected String getTestPath() { + return "/run/ServletIntegrationStreamingUI"; + } +} diff --git a/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationTests.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationTests.java new file mode 100644 index 0000000000..db6d0da911 --- /dev/null +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationTests.java @@ -0,0 +1,57 @@ +package com.vaadin.tests.integration; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.junit.runner.RunWith; +import org.junit.runners.model.InitializationError; + +import com.vaadin.testbench.parallel.ParallelTestSuite; +import com.vaadin.tests.integration.ServletIntegrationTests.ServletIntegrationTestSuite; + +@RunWith(ServletIntegrationTestSuite.class) +public class ServletIntegrationTests { + + public static Set notJSR356Compatible = new HashSet(); + public static Set notWebsocketCompatible = new HashSet(); + + static { + notWebsocketCompatible.add("tomcat7apacheproxy"); + notWebsocketCompatible.add("weblogic10"); + notWebsocketCompatible.add("wildfly9-nginx"); + + notJSR356Compatible.add("jetty8"); + notJSR356Compatible.add("tomcat7"); + } + + public static class ServletIntegrationTestSuite extends ParallelTestSuite { + + public ServletIntegrationTestSuite(Class klass) + throws InitializationError, IOException { + super(klass, AbstractIntegrationTest.class, + "com.vaadin.tests.integration", getIgnoredPackages()); + } + + private static String[] getIgnoredPackages() { + List ignoredPackages = new ArrayList(); + String serverName = System.getProperty("server-name"); + if (serverName == null) { + serverName = ""; + } + if (!serverName.equals("widfly9-nginx")) { + ignoredPackages.add("com.vaadin.tests.integration.push"); + } + if (notWebsocketCompatible.contains(serverName)) { + ignoredPackages.add("com.vaadin.tests.integration.websocket"); + } else if (notJSR356Compatible.contains(serverName)) { + ignoredPackages + .add("com.vaadin.tests.integration.websocket.jsr356"); + } + + return ignoredPackages.toArray(new String[ignoredPackages.size()]); + } + } +} diff --git a/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/push/LongPollingProxyServerIT.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/push/LongPollingProxyServerIT.java new file mode 100644 index 0000000000..bf45076fbe --- /dev/null +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/push/LongPollingProxyServerIT.java @@ -0,0 +1,125 @@ +/* + * Copyright 2000-2018 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.integration.push; + +import static org.junit.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Assume; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameter; +import org.junit.runners.Parameterized.Parameters; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.integration.AbstractIntegrationTest; +import org.openqa.selenium.support.ui.ExpectedCondition; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; + +@RunWith(Parameterized.class) +public class LongPollingProxyServerIT extends AbstractIntegrationTest { + + @Parameters(name = "{0}") + public static List getTestParameters() { + List parameters = new ArrayList(); + addTestParams(parameters, "Buffering+Timeout", "buffering-timeout"); + addTestParams(parameters, "NonBuffering+Timeout", + "nonbuffering-timeout"); + addTestParams(parameters, "Buffering", "buffering"); + addTestParams(parameters, "NonBuffering", "nonbuffering"); + return parameters; + } + + private static void addTestParams(List parameters, + String... pair) { + parameters.add(pair); + } + + @Parameter(0) + public String name; + + @Parameter(1) + public String path; + + @Override + @Before + public void setup() throws Exception { + Assume.assumeTrue( + "wildfly9-nginx".equals(System.getProperty("server-name"))); + + super.setup(); + } + + @Test + public void actionAfterFirstTimeout() throws Exception { + // The wildfly9-nginx server has a configured timeout of 10s for + // *-timeout urls + Thread.sleep(15000); + assertEquals(0, getClientCounter()); + getIncrementButton().click(); + assertEquals(1, getClientCounter()); + } + + @Test + public void basicPush() { + assertEquals(0, getServerCounter()); + getServerCounterStartButton().click(); + waitUntil(new ExpectedCondition() { + @Override + public Boolean apply(WebDriver webDriver) { + return getServerCounter() > 1; + } + }); + } + + @Override + protected String getContextPath() { + // Prefix with the context path with the parameter + return "/" + path + super.getContextPath(); + } + + @Override + protected String getTestPath() { + return "/"; + } + + private int getClientCounter() { + WebElement clientCounterElem = findElement( + By.id(BasicPush.CLIENT_COUNTER_ID)); + return Integer.parseInt(clientCounterElem.getText()); + } + + private int getServerCounter() { + WebElement serverCounterElem = findElement( + By.id(BasicPush.SERVER_COUNTER_ID)); + return Integer.parseInt(serverCounterElem.getText()); + } + + private WebElement getServerCounterStartButton() { + return findElement(By.id(BasicPush.START_TIMER_ID)); + } + + private WebElement getIncrementButton() { + return findElement(By.id(BasicPush.INCREMENT_BUTTON_ID)); + } +} diff --git a/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/ServletIntegrationWebsocketIT.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/ServletIntegrationWebsocketIT.java new file mode 100644 index 0000000000..1c6891c0ee --- /dev/null +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/ServletIntegrationWebsocketIT.java @@ -0,0 +1,79 @@ +/* + * Copyright 2000-2018 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.integration.websocket; + +import static org.junit.Assert.assertEquals; + +import java.util.*; + +import org.junit.Assume; +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.tests.integration.AbstractServletIntegrationTest; + +public class ServletIntegrationWebsocketIT + extends AbstractServletIntegrationTest { + // Uses the test method declared in the super class + + private static final Set nonWebsocketServers = new HashSet(); + + static { + nonWebsocketServers.add("liberty-microprofile"); + } + + @Override + public void setup() throws Exception { + Assume.assumeFalse("This server does not support Websockets", + nonWebsocketServers + .contains(System.getProperty("server-name"))); + + super.setup(); + } + + @Override + protected String getTestPath() { + return "/run/ServletIntegrationWebsocketUI"; + } + + @Test + public void testWebsockedUsed() { + List params = new ArrayList(); + for (String param : getParameters()) { + params.add(param); + } + params.add("debug"); + + // Reopen the page with debug window + openTestURL(params.toArray(new String[params.size()])); + + // Make sure the correct debug window tab is open. + findElements(By.className("v-debugwindow-tab")).get(1).click(); + + try { + // Wait to make sure correct tab is shown. + Thread.sleep(1000); + } catch (InterruptedException e) { + } + + WebElement row = findElements(By.className("v-debugwindow-row")).get(7); + assertEquals("Communication method", + row.findElement(By.className("caption")).getAttribute("innerText")); + assertEquals("Client to server: websocket, server to client: websocket", + row.findElement(By.className("value")).getAttribute("innerText")); + } +} diff --git a/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/jsr356/ServletIntegrationJSR356WebsocketIT.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/jsr356/ServletIntegrationJSR356WebsocketIT.java new file mode 100644 index 0000000000..5c158efa2a --- /dev/null +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/jsr356/ServletIntegrationJSR356WebsocketIT.java @@ -0,0 +1,47 @@ +/* + * Copyright 2000-2018 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.integration.websocket.jsr356; + +import java.util.HashSet; +import java.util.Set; + +import org.junit.Assume; + +import com.vaadin.tests.integration.websocket.ServletIntegrationWebsocketIT; + +public class ServletIntegrationJSR356WebsocketIT + extends ServletIntegrationWebsocketIT { + // Uses the test method declared in the super class + + private static final Set nonJSR356Servers = new HashSet(); + + static { + nonJSR356Servers.add("jetty8"); + } + + @Override + public void setup() throws Exception { + Assume.assumeFalse("This server does not support JSR356", + nonJSR356Servers.contains(System.getProperty("server-name"))); + + super.setup(); + } + + @Override + protected String getTestPath() { + return super.getTestPath().replace("/run/", "/run-jsr356/"); + } +} diff --git a/test/servlet-containers/generic-ui/pom.xml b/test/servlet-containers/generic-ui/pom.xml new file mode 100644 index 0000000000..c655431a50 --- /dev/null +++ b/test/servlet-containers/generic-ui/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-server-ui + vaadin-test-server-ui + jar + + true + + + + + com.vaadin + vaadin-client-compiled + + + com.vaadin + vaadin-push + + + diff --git a/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/IntegrationTestUIProvider.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/IntegrationTestUIProvider.java new file mode 100644 index 0000000000..6f265b10f7 --- /dev/null +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/IntegrationTestUIProvider.java @@ -0,0 +1,58 @@ +package com.vaadin.tests; + +import com.vaadin.server.UIClassSelectionEvent; +import com.vaadin.server.UIProvider; +import com.vaadin.tests.integration.push.BasicPush; +import com.vaadin.ui.UI; + +public class IntegrationTestUIProvider extends UIProvider { + + public static final String[] defaultPackages = { + "com.vaadin.tests.integration", + "com.vaadin.tests.integration.push" }; + + @Override + public Class getUIClass(UIClassSelectionEvent event) { + Class uiClass = findUIClassFromPath(event); + return uiClass != null ? uiClass : BasicPush.class; + } + + private Class findUIClassFromPath( + UIClassSelectionEvent event) { + String pathInfo = event.getRequest().getPathInfo(); + if (pathInfo != null) { + String className = pathInfo.substring(1); + if (className.startsWith("run/")) { + className = className.substring(4); + } + + if (className.contains(".")) { + return getUIClass(className); + } else { + return getUIClassFromDefaultPackage(className); + } + } + return null; + } + + private Class getUIClassFromDefaultPackage(String className) { + for (String pkgName : defaultPackages) { + Class uiClass = getUIClass(pkgName + "." + className); + if (uiClass != null) { + return uiClass; + } + } + return null; + } + + private Class getUIClass(String className) { + try { + Class loadClass = getClass().getClassLoader() + .loadClass(className.replace("/", ".")); + return (Class) loadClass; + } catch (ClassNotFoundException e) { + return null; + } + } + +} diff --git a/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/JSR356Servlet.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/JSR356Servlet.java new file mode 100644 index 0000000000..1a6c138f36 --- /dev/null +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/JSR356Servlet.java @@ -0,0 +1,18 @@ +package com.vaadin.tests; + +import com.vaadin.annotations.VaadinServletConfiguration; +import com.vaadin.server.VaadinServlet; +import com.vaadin.tests.integration.ServletIntegrationWebsocketUI; + +import javax.servlet.annotation.WebInitParam; +import javax.servlet.annotation.WebServlet; + +/** + * Created by elmot on 06-02-2017. + */ +@WebServlet(urlPatterns = "/run-jsr356/*", name = "IntegrationUIProvider-Jsr356", asyncSupported = false, initParams = { + @WebInitParam(name = "org.atmosphere.cpr.asyncSupport", value = "org.atmosphere.container.JSR356AsyncSupport")}) +@VaadinServletConfiguration(ui = ServletIntegrationWebsocketUI.class, productionMode = false) +public class JSR356Servlet extends VaadinServlet { + +} diff --git a/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/ServerIntegrationTestServlet.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/ServerIntegrationTestServlet.java new file mode 100644 index 0000000000..9ca79b31a8 --- /dev/null +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/ServerIntegrationTestServlet.java @@ -0,0 +1,14 @@ +package com.vaadin.tests; + +import com.vaadin.annotations.VaadinServletConfiguration; +import com.vaadin.server.VaadinServlet; +import com.vaadin.tests.integration.ServletIntegrationUI; + +import javax.servlet.annotation.WebInitParam; +import javax.servlet.annotation.WebServlet; + +@WebServlet(urlPatterns = "/*" ,name = "IntegrationTestUIProvider", asyncSupported = true, initParams = { + @WebInitParam(name = "UIProvider", value = "com.vaadin.tests.IntegrationTestUIProvider")}) +@VaadinServletConfiguration(ui = ServletIntegrationUI.class, productionMode = false) +public class ServerIntegrationTestServlet extends VaadinServlet { +} diff --git a/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java new file mode 100644 index 0000000000..26038c88b9 --- /dev/null +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2018 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.integration; + +import com.vaadin.annotations.Push; + +/** + * Server test which uses the default push mechanisms + * + * @since 7.1.12 + * @author Vaadin Ltd + */ +@Push +public class ServletIntegrationDefaultPushUI extends ServletIntegrationUI { + +} diff --git a/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java new file mode 100644 index 0000000000..ca97e15d24 --- /dev/null +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java @@ -0,0 +1,30 @@ +/* + * Copyright 2000-2018 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.integration; + +import com.vaadin.annotations.Push; +import com.vaadin.shared.ui.ui.Transport; + +/** + * Server test which uses long polling + * + * @since 7.1 + * @author Vaadin Ltd + */ +@Push(transport = Transport.LONG_POLLING) +public class ServletIntegrationLongPollingUI extends ServletIntegrationUI { + +} diff --git a/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java new file mode 100644 index 0000000000..95f5ea238e --- /dev/null +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java @@ -0,0 +1,30 @@ +/* + * Copyright 2000-2018 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.integration; + +import com.vaadin.annotations.Push; +import com.vaadin.shared.ui.ui.Transport; + +/** + * Server test which uses streaming + * + * @since 7.1 + * @author Vaadin Ltd + */ +@Push(transport = Transport.STREAMING) +public class ServletIntegrationStreamingUI extends ServletIntegrationUI { + +} diff --git a/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationUI.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationUI.java new file mode 100644 index 0000000000..de2b34bbe1 --- /dev/null +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationUI.java @@ -0,0 +1,83 @@ +package com.vaadin.tests.integration; + +import com.vaadin.annotations.DesignRoot; +import com.vaadin.annotations.Theme; +import com.vaadin.annotations.Widgetset; +import com.vaadin.data.util.BeanItemContainer; +import com.vaadin.event.SelectionEvent; +import com.vaadin.server.Resource; +import com.vaadin.server.ThemeResource; +import com.vaadin.server.VaadinRequest; +import com.vaadin.ui.*; +import com.vaadin.ui.declarative.Design; +import com.vaadin.ui.renderers.ImageRenderer; + +import java.util.Iterator; + +@Widgetset("com.vaadin.DefaultWidgetSet") +@Theme("valo") +public class ServletIntegrationUI extends UI { + + public static class Country { + private final String name; + private final String id; + private final Resource icon; + + public Country(String name, String id, Resource icon) { + this.name = name; + this.id = id; + this.icon = icon; + } + + public String getName() { + return name; + } + + public String getId() { + return id; + } + + public Resource getIcon() { + return icon; + } + } + + @Override + protected void init(VaadinRequest request) { + VerticalLayout layout = new VerticalLayout(); + layout.setMargin(true); + setContent(layout); + + final BeanItemContainer container = new BeanItemContainer(Country.class); + final Grid grid = new Grid(container); + // TODO ImageRenderer does not support ClassResource + grid.getColumn("icon").setWidth(50).setHeaderCaption("").setRenderer(new ImageRenderer()); + grid.getColumn("name").setWidth(100).setHeaderCaption("Country"); + grid.setColumns("icon", "name"); + container.addBean(new Country("Finland", "FI", new ThemeResource("fi.gif"))); + container.addBean(new Country("Sweden", "SE", new ThemeResource("se.gif"))); + grid.setHeight("200px"); + grid.setWidth("200px"); + layout.addComponent(grid); + + final Label selectedLabel = new LabelFromDesign(); + grid.addSelectionListener(new SelectionEvent.SelectionListener() { + public void select(SelectionEvent selectionEvent) { + Iterator iterator = selectionEvent.getSelected().iterator(); + if (iterator.hasNext()) { + selectedLabel.setValue(container.getItem(iterator.next()).getBean().getId()); + } else { + selectedLabel.setValue(""); + } + } + }); + layout.addComponent(selectedLabel); + } + + @DesignRoot + public static class LabelFromDesign extends Label { + public LabelFromDesign() { + Design.read(this); + } + } +} diff --git a/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java new file mode 100644 index 0000000000..88b5da7800 --- /dev/null +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java @@ -0,0 +1,48 @@ +/* + * Copyright 2000-2018 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.integration; + +import com.vaadin.annotations.Push; +import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.ui.ui.Transport; +import com.vaadin.shared.ui.ui.UIState.PushConfigurationState; + +/** + * Server test which uses websockets + * + * @since 7.1 + * @author Vaadin Ltd + */ +@Push(transport = Transport.WEBSOCKET) +public class ServletIntegrationWebsocketUI extends ServletIntegrationUI { + + /* + * (non-Javadoc) + * + * @see + * com.vaadin.tests.integration.IntegrationTestUI#init(com.vaadin.server + * .VaadinRequest) + */ + @Override + protected void init(VaadinRequest request) { + super.init(request); + // Ensure no fallback is used + getPushConfiguration().setParameter( + PushConfigurationState.FALLBACK_TRANSPORT_PARAM, "none"); + + } + +} diff --git a/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/push/AbstractTestUI.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/push/AbstractTestUI.java new file mode 100644 index 0000000000..c2359af5ce --- /dev/null +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/push/AbstractTestUI.java @@ -0,0 +1,226 @@ +package com.vaadin.tests.integration.push; + +import com.vaadin.annotations.Widgetset; +import com.vaadin.server.VaadinRequest; +import com.vaadin.server.VaadinServlet; +import com.vaadin.server.WebBrowser; +import com.vaadin.shared.communication.PushMode; +import com.vaadin.shared.ui.label.ContentMode; +import com.vaadin.shared.ui.ui.Transport; +import com.vaadin.shared.ui.ui.UIState.PushConfigurationState; +import com.vaadin.ui.Button; +import com.vaadin.ui.Component; +import com.vaadin.ui.Label; +import com.vaadin.ui.Notification; +import com.vaadin.ui.Notification.Type; +import com.vaadin.ui.PushConfiguration; +import com.vaadin.ui.UI; +import com.vaadin.ui.VerticalLayout; + +import java.io.File; + +public abstract class AbstractTestUI extends UI { + + @Override + public void init(VaadinRequest request) { + getPage().setTitle(getClass().getName()); + + Label label = new Label(getTestDescription(), ContentMode.HTML); + label.setWidth("100%"); + + VerticalLayout rootLayout = new VerticalLayout(); + rootLayout.setSpacing(false); + setContent(rootLayout); + + layout = new VerticalLayout(); + layout.setSpacing(false); + layout.setMargin(false); + + rootLayout.addComponent(label); + rootLayout.addComponent(layout); + ((VerticalLayout) getContent()).setExpandRatio(layout, 1); + + warnIfWidgetsetMaybeNotCompiled(); + + setTransport(request); + + setup(request); + } + + protected void warnIfWidgetsetMaybeNotCompiled() { + // Can't check location if sendUrlAsParameters is disabled + if (!getSession().getConfiguration().isSendUrlsAsParameters()) { + return; + } + + // Ignore if using debug mode + String query = getPage().getLocation().getQuery(); + if (query != null && query.matches(".*[&?]gwt\\.codesvr.*")) { + return; + } + + // Find out the widgetset of this UI based on @Widgetset annotation + Class currentType = getClass(); + String usedWidgetset = VaadinServlet.DEFAULT_WIDGETSET; + while (currentType != Object.class) { + Widgetset annotation = currentType.getAnnotation(Widgetset.class); + if (annotation != null) { + usedWidgetset = annotation.value(); + break; + } else { + currentType = currentType.getSuperclass(); + } + } + + // Assuming the same folder structure as in git repo + // Assuming project root is the working dir of this process + File widgetsetsFolder = new File("WebContent/VAADIN/widgetsets"); + if (!widgetsetsFolder.isDirectory()) { + return; + } + + // Find the most newly compiled widgetset + long newestWidgetsetTimestamp = -1; + String newestWidgetsetName = null; + File[] children = widgetsetsFolder.listFiles(); + for (File child : children) { + if (!child.isDirectory() || child.getName().equals("WEB-INF")) { + continue; + } + long lastModified = child.lastModified(); + if (lastModified > newestWidgetsetTimestamp) { + newestWidgetsetTimestamp = lastModified; + newestWidgetsetName = child.getName(); + } + } + + // Compare to currently used widgetset, with a 30 minute grace period + File currentWidgetsetFolder = new File(widgetsetsFolder, usedWidgetset); + long currentWidgetsetTimestamp = currentWidgetsetFolder.lastModified(); + int halfHour = 30 * 60 * 1000; + if (currentWidgetsetTimestamp + halfHour < newestWidgetsetTimestamp) { + Notification.show( + "The currently used widgetset (" + usedWidgetset + + ") was compiled long before the most recently compiled one (" + + newestWidgetsetName + + "). Are you sure you have compiled the right widgetset?", + Type.WARNING_MESSAGE); + } + } + + /** + * Sets the push transport according to the transport= URL parameter if such + * is given. Supports transport=xhr (disables push), transport=websocket + * (forces websocket into use), transport=streaming (forces streaming into + * use). Using ?transport=xyz disables the fallback transport. + * + * @param request + * The UI init request + */ + protected void setTransport(VaadinRequest request) { + String transport = request.getParameter("transport"); + PushConfiguration config = getPushConfiguration(); + + if ("xhr".equals(transport)) { + config.setPushMode(PushMode.DISABLED); + } else if ("websocket".equals(transport)) { + enablePush(Transport.WEBSOCKET); + } else if ("websocket-xhr".equals(transport)) { + enablePush(Transport.WEBSOCKET_XHR); + } else if ("streaming".equals(transport)) { + enablePush(Transport.STREAMING); + } else if ("long-polling".equals(transport)) { + enablePush(Transport.LONG_POLLING); + } else if (transport != null) { + throw new IllegalArgumentException("Unknown transport value '" + + transport + + "'. Supported are xhr,websocket,streaming,long-polling"); + } + } + + protected void enablePush(Transport transport) { + PushConfiguration config = getPushConfiguration(); + if (!config.getPushMode().isEnabled()) { + config.setPushMode(PushMode.AUTOMATIC); + } + config.setTransport(transport); + // Ensure no fallback is used + getPushConfiguration().setParameter( + PushConfigurationState.FALLBACK_TRANSPORT_PARAM, "none"); + } + + /** + * This method is inherited from the super class, but it should generally + * not be used. If you want to just add components to your test, use e.g. + * {@link #addComponent(Component)} instead to add the component to the + * layout used by this UI. If you don't want to use the top-level layout + * used by this class, you instead inherit directly from UI. + * + * @deprecated Use {@link #addComponent(Component)} or inherit from UI + * instead. + */ + @Override + @Deprecated + public void setContent(Component content) { + // Overridden just to deprecate + super.setContent(content); + } + + private VerticalLayout layout; + + protected VerticalLayout getLayout() { + return layout; + } + + protected abstract void setup(VaadinRequest request); + + public void addComponent(Component c) { + getLayout().addComponent(c); + } + + public void addComponents(Component... c) { + getLayout().addComponents(c); + } + + public void removeComponent(Component c) { + getLayout().removeComponent(c); + } + + public void replaceComponent(Component oldComponent, + Component newComponent) { + getLayout().replaceComponent(oldComponent, newComponent); + } + + protected void addButton(String caption, Button.ClickListener listener) { + Button button = new Button(caption); + button.addClickListener(listener); + addComponent(button); + } + + protected String getTestDescription() { + return null; + }; + + protected Integer getTicketNumber() { + return null; + }; + + protected WebBrowser getBrowser() { + return getSession().getBrowser(); + } + + /** + * Execute the provided runnable on the UI thread as soon as the current + * request has been sent. + */ + protected void runAfterResponse(final Runnable runnable) { + // Immediately start a thread that will start waiting for the session to + // get unlocked. + new Thread() { + @Override + public void run() { + accessSynchronously(runnable); + } + }.start(); + } +} diff --git a/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/push/BasicPush.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/push/BasicPush.java new file mode 100644 index 0000000000..e5dfdfc4ae --- /dev/null +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/push/BasicPush.java @@ -0,0 +1,146 @@ +/* + * Copyright 2000-2018 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.integration.push; + +import java.util.Timer; +import java.util.TimerTask; + +import com.vaadin.annotations.Push; +import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.ui.label.ContentMode; +import com.vaadin.ui.Button; +import com.vaadin.ui.Label; + +@Push +public class BasicPush extends AbstractTestUI { + + public static final String CLIENT_COUNTER_ID = "clientCounter"; + + public static final String STOP_TIMER_ID = "stopTimer"; + + public static final String START_TIMER_ID = "startTimer"; + + public static final String SERVER_COUNTER_ID = "serverCounter"; + + public static final String INCREMENT_BUTTON_ID = "incrementCounter"; + + private int clientCounter = 0; + private int serverCounter = 0; + private final Timer timer = new Timer(true); + + private TimerTask task; + + @Override + protected void setup(VaadinRequest request) { + getReconnectDialogConfiguration().setDialogModal(false); + spacer(); + + /* + * Client initiated push. + */ + final Label lbl = new Label("0"); + lbl.setCaption("Client counter (click 'increment' to update):"); + lbl.setId(CLIENT_COUNTER_ID); + addComponent(lbl); + + Button incrementButton = new Button("Increment", + new Button.ClickListener() { + public void buttonClick(Button.ClickEvent clickEvent) { + clientCounter++; + lbl.setValue(String.valueOf(clientCounter)); + } + }); + incrementButton.setId(INCREMENT_BUTTON_ID); + addComponent(incrementButton); + + spacer(); + + /* + * Server initiated push. + */ + final Label serverCounterLabel = new Label("0"); + serverCounterLabel.setCaption( + "Server counter (updates each 3s by server thread) :"); + serverCounterLabel.setId(SERVER_COUNTER_ID); + addComponent(serverCounterLabel); + + Button startTimer = new Button("Start timer", new Button.ClickListener() { + + public void buttonClick(Button.ClickEvent clickEvent) { + serverCounter = 0; + serverCounterLabel.setValue(String.valueOf(serverCounter)); + if (task != null) { + task.cancel(); + } + task = new TimerTask() { + + @Override + public void run() { + access(new Runnable() { + public void run() { + serverCounter++; + serverCounterLabel + .setValue(String.valueOf(serverCounter)); + } + }); + } + }; + timer.scheduleAtFixedRate(task, 3000, 3000); + } + }); + startTimer.setId(START_TIMER_ID); + addComponent(startTimer); + + Button stopTimer = new Button("Stop timer", new Button.ClickListener() { + public void buttonClick(Button.ClickEvent clickEvent) { + if (task != null) { + task.cancel(); + task = null; + } + } + }); + stopTimer.setId(STOP_TIMER_ID); + addComponent(stopTimer); + } + + @Override + protected String getTestDescription() { + return "This test tests the very basic operations of push. " + + "It tests that client initiated changes are " + + "recieved back to the client as well as server " + + "initiated changes are correctly updated to the client."; + } + + @Override + protected Integer getTicketNumber() { + return 11494; + } + + private void spacer() { + addComponent(new Label("
", ContentMode.HTML)); + } + + @Override + public void attach() { + super.attach(); + } + + @Override + public void detach() { + super.detach(); + timer.cancel(); + } +} diff --git a/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/push/BasicPushLongPolling.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/push/BasicPushLongPolling.java new file mode 100644 index 0000000000..c59ddf852d --- /dev/null +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/push/BasicPushLongPolling.java @@ -0,0 +1,34 @@ +/* + * Copyright 2000-2018 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.integration.push; + +import com.vaadin.annotations.Push; +import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.ui.ui.Transport; +import com.vaadin.shared.ui.ui.UIState.PushConfigurationState; + +@Push(transport = Transport.LONG_POLLING) +public class BasicPushLongPolling extends BasicPush { + + @Override + public void init(VaadinRequest request) { + super.init(request); + // Don't use fallback so we can easier detect if long polling fails + getPushConfiguration().setParameter( + PushConfigurationState.FALLBACK_TRANSPORT_PARAM, "none"); + } + +} diff --git a/test/servlet-containers/generic-ui/src/main/resources/VAADIN/themes/valo/fi.gif b/test/servlet-containers/generic-ui/src/main/resources/VAADIN/themes/valo/fi.gif new file mode 100644 index 0000000000000000000000000000000000000000..8d3a1918280816780d79856b678e2ebb5bb76d66 GIT binary patch literal 371 zcmV-(0gV1fNk%w1VGsZd0M!5h{r>*P&)WbiyhL-+$q-dTj%J8aF`-s|}I z_)&e-x4+G6k=`<8%JTB_Re;vK!qWHn`hcS2hNk7+;_YFI*-d)X!O7PE0Etd|&|iq! z005lz_4Q+m-1heNN_f-z`}Xr?J8L`~36s^SQy#NO#iq_xR=O^YZfY{QUg-`ug|x z_y7O@A^8LV00000EC2ui01yBR000J%K%G!05U@^_N+NMGkubX74?uZM06bo(7gP9F zQ2?M}m}$A*k1s$F%gUQnOp^O_3LOlK(r9=#2Q3gHAOk1}5E%j!27d<-3l}&82rdo_ ziW4({gOY{_4h|X_2{m(rAU=0C4+zy#V#mJ^0c!5^0?raiBAOsQ@Hw?3(~Ng{wV@t_^9H00~z5)<8pxux6sb zC3&I%07L!TQTx|M_RcGNu*&}3S@+N{SedzCpS}Pvbp6~^001HU*-HQ!WBl4rd9KO! z&oceN000wR_ts18p#W2swf zr~pHOA^8LV00000EC2ui01yBR000Jzz@PBvYBWry$wc+SU^>50h!qI%7K=?uN0Kq1 zp^`#$@-P4zOT}jZbaE^OuAH)^*9MNJ;|h>HDIXaF4RtgN26(1d0tj zD?NgQhLi+5EeR$IXOV0i5eE diff --git a/test/servlet-containers/generic/.gitignore b/test/servlet-containers/generic/.gitignore new file mode 100644 index 0000000000..e2f5dd2eb2 --- /dev/null +++ b/test/servlet-containers/generic/.gitignore @@ -0,0 +1 @@ +result \ No newline at end of file diff --git a/test/servlet-containers/generic/build.properties b/test/servlet-containers/generic/build.properties new file mode 100644 index 0000000000..fab96cb262 --- /dev/null +++ b/test/servlet-containers/generic/build.properties @@ -0,0 +1,8 @@ +ivy.organisation=com.vaadin +vaadin.vendor=Vaadin Ltd +vaadin.url=http://vaadin.com +vaadin.java.version=1.6 +vaadin.version=8.2-SNAPSHOT +vaadin.sass.version=0.9.13 +gwt.version=2.7.0.vaadin3 +commons-io.version=2.4 diff --git a/test/servlet-containers/generic/build.xml b/test/servlet-containers/generic/build.xml new file mode 100644 index 0000000000..9cc90af0d6 --- /dev/null +++ b/test/servlet-containers/generic/build.xml @@ -0,0 +1,52 @@ + + + + + Provides a uitest WAR containing Vaadin UI tests + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/servlet-containers/generic/common.xml b/test/servlet-containers/generic/common.xml new file mode 100644 index 0000000000..7a105ca8bc --- /dev/null +++ b/test/servlet-containers/generic/common.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/test/servlet-containers/generic/integration_base_files/base.xml b/test/servlet-containers/generic/integration_base_files/base.xml new file mode 100644 index 0000000000..74ea41ac06 --- /dev/null +++ b/test/servlet-containers/generic/integration_base_files/base.xml @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${server}: Getting the lock + + + + + + + + ${server}: Got the lock + + + + + + + + + + + + ${server}: Released the lock + + + + + + + diff --git a/test/servlet-containers/generic/integration_base_files/cleanup.sh b/test/servlet-containers/generic/integration_base_files/cleanup.sh new file mode 100644 index 0000000000..42fb5a434d --- /dev/null +++ b/test/servlet-containers/generic/integration_base_files/cleanup.sh @@ -0,0 +1,26 @@ +#! /bin/bash +echo checking and killing open servers + +# Find all java processes, except +# * grep, as we're running it +# * get-lock, as that one is just waiting for this cleanup to happen +# * shutdown-and-cleanup, as that could be the one we're running from +ps x | grep -E bin/java | grep -v grep | grep -v get-lock | grep -v shutdown-and-cleanup | awk '{print $1}' > temp + +#Read and kill processes marked to temp +while read line +do + kill -9 $line +done < temp + +#Remove temp +rm temp + +if [ -a /home/integration/demo.war ] + then + echo removing old demo.war + rm /home/integration/demo.war +fi + +echo Cleaning deploy dir +rm -rf /home/integration/deploy/* diff --git a/test/servlet-containers/generic/integration_base_files/lock_age.sh b/test/servlet-containers/generic/integration_base_files/lock_age.sh new file mode 100644 index 0000000000..115a8fef79 --- /dev/null +++ b/test/servlet-containers/generic/integration_base_files/lock_age.sh @@ -0,0 +1,21 @@ +#! /bin/bash +if lockfile -r0 -! /home/integration/deploy/lock.file &> /dev/null + then + # If we could not get the lock, check how old the lock file is + DATE=$(date +%s) + # What if the file is not there any more? + LOCK_AGE=$(stat -c %Z /home/integration/deploy/lock.file) + + AGE=$[($DATE - $LOCK_AGE)/60] + + if [ "$AGE" -gt "20" ] + then + echo lock.file is $AGE min old. + ./cleanup.sh +# else +# echo lock.file is $AGE min old. + fi + else + # If we got the lock, do a cleanup (releasing the lock) just in case something has still been left running + ./cleanup.sh &> /dev/null +fi diff --git a/test/servlet-containers/generic/integration_tests.xml b/test/servlet-containers/generic/integration_tests.xml new file mode 100644 index 0000000000..3562740009 --- /dev/null +++ b/test/servlet-containers/generic/integration_tests.xml @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Delaying startup of ${target-server} with ${startDelay} seconds + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Starting TB3 test for ${target-server} + + + + + + + + + + + + + + + + + + + + + + + + + ##teamcity[testStarted name='${target-server}' flowId='${target-server}'] + + + + + + + + + + ##teamcity[testFailed name='${target-server}' flowId='${target-server}' message='Integration test for ${target-server} failed.' details='${tried-escaped}'] + + + ##teamcity[testFinished name='${target-server}' flowId='${target-server}']" + + + + + + + + + + + + + + + + ##teamcity[testStarted name='${target-server}' flowId='${target-server}'] + + + + + + + + + + ##teamcity[testFailed name='${target-server}' flowId='${target-server}' message='Integration test for ${target-server} failed.' details='${tried-escaped}']" + + + ##teamcity[testFinished name='${target-server}' flowId='${target-server}']" + + + + + + + + + + + + + + + diff --git a/test/servlet-containers/generic/ivy-taskdefs.xml b/test/servlet-containers/generic/ivy-taskdefs.xml new file mode 100644 index 0000000000..95dca014dc --- /dev/null +++ b/test/servlet-containers/generic/ivy-taskdefs.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + diff --git a/test/servlet-containers/generic/ivy.xml b/test/servlet-containers/generic/ivy.xml new file mode 100644 index 0000000000..414f26d71b --- /dev/null +++ b/test/servlet-containers/generic/ivy.xml @@ -0,0 +1,130 @@ + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/servlet-containers/generic/ivysettings.xml b/test/servlet-containers/generic/ivysettings.xml new file mode 100644 index 0000000000..e807d3d36e --- /dev/null +++ b/test/servlet-containers/generic/ivysettings.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/servlet-containers/generic/pom.xml b/test/servlet-containers/generic/pom.xml new file mode 100644 index 0000000000..72741d1695 --- /dev/null +++ b/test/servlet-containers/generic/pom.xml @@ -0,0 +1,97 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-generic-integration + vaadin-test-generic-integration + war + + true + + + + + + + com.vaadin + vaadin-test-server-ui + ${project.version} + + + + + + + + maven-dependency-plugin + + + unpack-tests + package + + + + com.vaadin + vaadin-test-server-tests + ${project.version} + **/*.class + + + ${project.build.directory}/test-classes + + + unpack + + + + + + maven-deploy-plugin + + true + + + + maven-surefire-plugin + + true + + + + maven-failsafe-plugin + + + true + + + + maven-war-plugin + + + + jboss6-war + package + + war + + + jboss6 + + + src/main/jboss-6 + + + + + + + + + diff --git a/test/servlet-containers/generic/reference-screenshots/finland-phantomjs.png b/test/servlet-containers/generic/reference-screenshots/finland-phantomjs.png new file mode 100644 index 0000000000000000000000000000000000000000..78533075842e67f28c5ca4123be65a431270f212 GIT binary patch literal 10897 zcmeG?c|6p4|9($|kd74*x+LV@s9eRCmEtK^$x&HN?r{!{VUuIEAu4y~k+L0*QW(b3 zI2WOE3}%cOauqYiH8N&A-#HyWzukU4zvs2Pzt`iR@7MeL{k-q{JJEkPGZxt(xq*j= zN5tg&@6Ph@@L_p))}0kt4?sd4g=cwq6wjG_cg!-dXROx)Y&CfOH92@ZidN9uZRi2% zaVgfhb-$>shj=I#LqxQ7clPGqx2-SUXw`0&x_js3mcNCgUr#!07K=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|tVJ_FYktjC)+uDxDjPMn;XnX$xL+Cg!kI?EVkEV(#2 zbj4BNrBDPbt1sVgeL*>)Ih{B@XUbZX{a7YMtk|KZ%|;}K0(PpvAIjd6msM{zVUKYt z(wWU~L>Lb@VUHhQI>CL+-Mm@y`Z8tWg>X&)%d;=Q2CN%dW7@LUms4W%#tY$4l3wCs z8Q(18%lLl1B-3v&wg#m?UJJd$421(5%Etmj%-u4uFWsFi#en^Y-^lTcb*rE4MErd7 zq9@}mo-iHGK5HZE+|n~(*{K*-!dyBF5V_9!-zhOpa2|89agVO#jZ2Kf8;6lKiTxI~ zoroK(ev!c&bq7NhV7a>7LBG<_u){3XEaQkF1BYQQRgR)pDU8L`Lsi5&=_yfh23std zf!#LK>j8~3fUBT@wSEK2KElSpd3PnEwV{A&SYH};)}m;lp>swfm|`yp-9WGuu%Kxr zhR$|_V9{*KvSQd)v3Ay;nuoK7X7rrQu4`%8&k9u@6s_zA6xgd)<54#-fkP=E_QIbR z0%1wY*iSQ2bNOZ`GwuVnX8tGE|2_KRa>LU2mud0e!^-c-&o&+B+YVdrY&EY9Wv9L+ zV=)cDhH{RuF|2~J(XS2tdZK?KR{jO~|F5<3FR=1Erhu{IofU(tLhC=i{~zC9DgpU(0@TKzrzd50l&r;_N-u7TkUH@|82Z{wKH-QyQTvEGPd}N zX!(Oov6<=mYioUNDBF|%M7H=7vBFW=S2)05B|_D($NxX1OSXk1c>8Vg`1YIdC^CdH NId1k{p5eu?e**Dk3WWdw literal 0 HcmV?d00001 diff --git a/test/servlet-containers/generic/reference-screenshots/initial-phantomjs.png b/test/servlet-containers/generic/reference-screenshots/initial-phantomjs.png new file mode 100644 index 0000000000000000000000000000000000000000..8764e467f2957062c0747e9ea135f7f028aea66d GIT binary patch literal 10130 zcmeHLdstHG*0*mo?^$EzEv3dX%hJrsjKn6JV@{>h#jF&}EUmPpvBE^5vCPR*raEbO zJ!Yxpy~e}~5Sdz;QmNqu5HcfEK+{A4_1l|^w~whgp3`&Yd!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2&j(2@T^pC?426#=68FHq-JNxFKiTe0yX5XN3F?K zC&ebmygatiKomOrj5VcjsQjEcBfL}~S@J}HPI03dR;r2s@n@hn28gp_P2PqUafJ$) zJ!x)$Nfi78Y>{NPnk1FwL$Oq@BC{a-RxXv9S1eWIF(p@zK*>r{G=)3Pzrr2wq_Cx> zD_@i10OcwZzm-d+6d|`TNh(uOER`j4Do+1Gp?qQefs)Q4hwLP1O$mno0qjo-`#)QT zQ(ga8V1%iLA}5?b*#A;n3BxEUM!90?7houf^xs~FpLMF3C%+aWd^VJ+JDmzSeWg(3 zyY~nC&oGjLW@2&5D)+zGmuFA5ITMrkZ{OwrVqejWH1#r+@7~01lS?U#1PQ+>M!90? z7bsYALIh@d$#G5o?ZnbjEd3V>Zelm+#&R1MfM>+B`NKIK6ibAX`UPoJ`m*ttEggR+ zO7}}cR#GTED^rnKkbNtc%2X6fr|$GG6pDPMf3W^iH3^IqCqS`u>S_5xEYhu>f>XI& zg#h?}vloA`LsQO*ERkPf{Tn5iQJi(f(ytfGXF~acQ%mVFMRD2{OTQ9b$a6LYr&Fkw zFQi4vuu}*{rXpX=KT(Wd0isif#b?*Am@ajvJ-$KBv>dn`3c7Xv!DUnK#{J>{3w6SS AoB#j- literal 0 HcmV?d00001 diff --git a/test/servlet-containers/generic/src/main/jboss-6/WEB-INF/jboss-web.xml b/test/servlet-containers/generic/src/main/jboss-6/WEB-INF/jboss-web.xml new file mode 100644 index 0000000000..bfa4bac003 --- /dev/null +++ b/test/servlet-containers/generic/src/main/jboss-6/WEB-INF/jboss-web.xml @@ -0,0 +1,7 @@ + + + true + diff --git a/test/servlet-containers/glassfish/pom.xml b/test/servlet-containers/glassfish/pom.xml new file mode 100644 index 0000000000..491b2eb111 --- /dev/null +++ b/test/servlet-containers/glassfish/pom.xml @@ -0,0 +1,64 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-glassfish-server + Vaadin Glassfish Test + war + + true + 4.1.2.173 + glassfish + + + + + + com.vaadin + vaadin-test-server-ui + ${project.version} + + + com.vaadin + vaadin-test-server-tests + ${project.version} + test + + + + + + + + org.glassfish.embedded + maven-embedded-glassfish-plugin + 4.1.1 + + + start-glassfish + pre-integration-test + + start + deploy + + + + stop-glassfish + post-integration-test + + stop + + + + + 8080 + + + + + diff --git a/test/servlet-containers/jetty8/pom.xml b/test/servlet-containers/jetty8/pom.xml new file mode 100644 index 0000000000..dda3e6df28 --- /dev/null +++ b/test/servlet-containers/jetty8/pom.xml @@ -0,0 +1,73 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-jetty8-server + Vaadin Jetty 8 Test + war + + true + 8.1.16.v20140903 + jetty8 + + + + + + com.vaadin + vaadin-test-server-ui + ${project.version} + + + com.vaadin + vaadin-test-server-tests + ${project.version} + test + + + + + + + + org.mortbay.jetty + jetty-maven-plugin + ${mortbay.jetty.version} + + + start-jetty + pre-integration-test + + start + + + + stop-jetty + post-integration-test + + stop + + + + + + ${context.path} + + q + 8082 + true + false + + + + + diff --git a/test/servlet-containers/jetty9/pom.xml b/test/servlet-containers/jetty9/pom.xml new file mode 100644 index 0000000000..d46b826786 --- /dev/null +++ b/test/servlet-containers/jetty9/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-jetty9-server + Vaadin Jetty 9 Test + war + + false + 9.3.21.v20170918 + jetty9 + + + + + + com.vaadin + vaadin-test-server-ui + ${project.version} + + + com.vaadin + vaadin-test-server-tests + ${project.version} + test + + + + + + + + org.eclipse.jetty + jetty-maven-plugin + + + + diff --git a/test/servlet-containers/jsp-integration/pom.xml b/test/servlet-containers/jsp-integration/pom.xml new file mode 100644 index 0000000000..dbc45289b6 --- /dev/null +++ b/test/servlet-containers/jsp-integration/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-jsp-integration + vaadin-test-jsp-integration + war + + + / + + + + + + com.vaadin + vaadin-client-compiled + + + + + diff --git a/test/servlet-containers/jsp-integration/src/main/java/com/vaadin/tests/integration/AnotherTrivialUI.java b/test/servlet-containers/jsp-integration/src/main/java/com/vaadin/tests/integration/AnotherTrivialUI.java new file mode 100644 index 0000000000..446e9a3340 --- /dev/null +++ b/test/servlet-containers/jsp-integration/src/main/java/com/vaadin/tests/integration/AnotherTrivialUI.java @@ -0,0 +1,28 @@ +/* + * Copyright 2000-2017 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.integration; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.ui.Label; +import com.vaadin.ui.UI; + +public class AnotherTrivialUI extends UI { + @Override + protected void init(VaadinRequest request) { + setContent(new Label("Another Trivial UI")); + } + +} diff --git a/test/servlet-containers/jsp-integration/src/main/java/com/vaadin/tests/integration/TrivialUI.java b/test/servlet-containers/jsp-integration/src/main/java/com/vaadin/tests/integration/TrivialUI.java new file mode 100644 index 0000000000..e360f21bdc --- /dev/null +++ b/test/servlet-containers/jsp-integration/src/main/java/com/vaadin/tests/integration/TrivialUI.java @@ -0,0 +1,28 @@ +/* + * Copyright 2000-2017 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.integration; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.ui.Label; +import com.vaadin.ui.UI; + +public class TrivialUI extends UI { + @Override + protected void init(VaadinRequest request) { + setContent(new Label("Trivial UI")); + } + +} diff --git a/test/servlet-containers/jsp-integration/src/main/webapp/WEB-INF/web.xml b/test/servlet-containers/jsp-integration/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..1d0326bd19 --- /dev/null +++ b/test/servlet-containers/jsp-integration/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,57 @@ + + + + + + Vaadin + Vaadin JSP Integration Test + + + productionMode + false + + + + VaadinStaticFiles + com.vaadin.server.VaadinServlet + false + + + + PrimaryUIServlet + com.vaadin.server.VaadinServlet + + UI + com.vaadin.tests.integration.TrivialUI + + true + + + + SecondaryUIServlet + com.vaadin.server.VaadinServlet + + UI + com.vaadin.tests.integration.AnotherTrivialUI + + true + + + + PrimaryUIServlet + /primaryui/* + + + + SecondaryUIServlet + /secondaryui/* + + + + VaadinStaticFiles + /VAADIN/* + + + diff --git a/test/servlet-containers/jsp-integration/src/main/webapp/staticfiles/vaadinsessions.jsp b/test/servlet-containers/jsp-integration/src/main/webapp/staticfiles/vaadinsessions.jsp new file mode 100644 index 0000000000..b22787a203 --- /dev/null +++ b/test/servlet-containers/jsp-integration/src/main/webapp/staticfiles/vaadinsessions.jsp @@ -0,0 +1,54 @@ + +<%@page import="com.vaadin.ui.UI"%> +<%@page import="com.vaadin.server.VaadinSession"%> + + +JSP integration + + + + + + + + + + + + + + + <% + HttpSession httpSession = request.getSession(false); + for (VaadinSession vs : VaadinSession.getAllSessions(httpSession)) { + try { + vs.lock(); + for (UI ui : vs.getUIs()) { + out.append(""); + out.append(""); + out.append(""); + out.append(""); + out.append(""); + out.append(""); + out.append(""); + + } + } finally { + vs.unlock(); + } + + } + %> +
Available UIs:
Service NameCSRF tokenUI idUI typeMain content
" + vs.getService().getServiceName() + + "" + vs.getCsrfToken() + "" + ui.getUIId() + "" + ui.getClass().getName() + "" + ui.getContent().getClass().getName() + "
+ + \ No newline at end of file diff --git a/test/servlet-containers/jsp-integration/src/test/java/com/vaadin/tests/integration/JSPIntegrationIT.java b/test/servlet-containers/jsp-integration/src/test/java/com/vaadin/tests/integration/JSPIntegrationIT.java new file mode 100644 index 0000000000..230fc5f37e --- /dev/null +++ b/test/servlet-containers/jsp-integration/src/test/java/com/vaadin/tests/integration/JSPIntegrationIT.java @@ -0,0 +1,90 @@ +package com.vaadin.tests.integration; + +import com.vaadin.testbench.TestBenchTestCase; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.phantomjs.PhantomJSDriver; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; + +public class JSPIntegrationIT extends TestBenchTestCase { + + private static final String URL_PREFIX = "http://localhost:8080/"; + + private static final String primaryUIUrl = URL_PREFIX + "primaryui"; + private static final String jspUrl = URL_PREFIX + "staticfiles/vaadinsessions.jsp"; + private static final String secondaryUIUrl = URL_PREFIX + "secondaryui"; + + @Test + public void listVaadinSessions() { + + assertUICount(0); + + // Open a new UI + getDriver().navigate().to(primaryUIUrl); + + + assertUICount(1); + UIData firstUI = getUIs().get(0); + + // Open a new UI + getDriver().navigate().to(primaryUIUrl); + UIData secondUI = getUIs().get(0); + + // Should now have UI for the same service with different uiId + assertUICount(1); + assertNotEquals(firstUI.uiId, secondUI.uiId); + assertEquals(firstUI.serviceName, secondUI.serviceName); + + getDriver().navigate().to(secondaryUIUrl); + // Should now have another services + List twoUIs = getUIs(); + assertEquals(2, twoUIs.size()); + assertNotEquals(twoUIs.get(0).serviceName, twoUIs.get(1).serviceName); + } + + private static class UIData { + private String serviceName; + private int uiId; + } + + private List getUIs() { + List uis = new ArrayList(); + + getDriver().get(jspUrl); + List rows = getDriver() + .findElements(By.xpath("//tr[@class='uirow']")); + for (WebElement row : rows) { + UIData data = new UIData(); + List tds = row.findElements(By.xpath("./td")); + + data.serviceName = tds.get(0).getText(); + data.uiId = Integer.parseInt(tds.get(2).getText()); + + uis.add(data); + } + + return uis; + } + + private void assertUICount(int i) { + assertEquals(i, getUIs().size()); + } + + @Before + public void setup() { + setDriver(new PhantomJSDriver()); + } + + @After + public void teardown() { + getDriver().quit(); + } +} diff --git a/test/servlet-containers/liberty-javaee/pom.xml b/test/servlet-containers/liberty-javaee/pom.xml new file mode 100644 index 0000000000..5101d64e25 --- /dev/null +++ b/test/servlet-containers/liberty-javaee/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-liberty-javaee-server + Vaadin Liberty JavaEE7 Test + war + + true + 17.0.0.1 + wlp-javaee7 + liberty-javaee + + + + + + com.vaadin + vaadin-test-server-ui + ${project.version} + + + com.vaadin + vaadin-test-server-tests + ${project.version} + test + + + + + + + maven-failsafe-plugin + + + + http://localhost:9080 + + + + + + + net.wasdev.wlp.maven.plugins + liberty-maven-plugin + + + + diff --git a/test/servlet-containers/liberty-webprofile/pom.xml b/test/servlet-containers/liberty-webprofile/pom.xml new file mode 100644 index 0000000000..755d0ad718 --- /dev/null +++ b/test/servlet-containers/liberty-webprofile/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-liberty-webprofile-server + Vaadin Liberty WebProfile Test + war + + true + 17.0.0.1 + wlp-webProfile7 + liberty-webprofile + + + + + + com.vaadin + vaadin-test-server-ui + ${project.version} + + + com.vaadin + vaadin-test-server-tests + ${project.version} + test + + + + + + + maven-failsafe-plugin + + + + http://localhost:9080 + + + + + + + net.wasdev.wlp.maven.plugins + liberty-maven-plugin + + + + diff --git a/test/servlet-containers/pom.xml b/test/servlet-containers/pom.xml new file mode 100644 index 0000000000..4dd5460b74 --- /dev/null +++ b/test/servlet-containers/pom.xml @@ -0,0 +1,277 @@ + + + 4.0.0 + + com.vaadin + vaadin-test + 7.7-SNAPSHOT + + vaadin-servlet-containers-test + vaadin-servlet-containers-test + pom + + + jetty9 + /${project.build.finalName} + + + ${project.basedir}/../screenshots + + + + generic-ui + generic-tests + + + + + + + + org.wildfly.plugins + wildfly-maven-plugin + 1.2.0.Final + + + start-wildfly + pre-integration-test + + start + deploy + + + + stop-wildfly + post-integration-test + + shutdown + + + + + + + + org.glassfish.embedded + maven-embedded-glassfish-plugin + 4.1.1 + + + start-glassfish + pre-integration-test + + start + deploy + + + + stop-glassfish + post-integration-test + + stop + + + + + 8080 + + + + + + org.codehaus.cargo + cargo-maven2-plugin + + + standalone + + ${project.build.directory}/cargo-server + + + 8080 + + + + + ${project.groupId} + ${project.artifactId} + war + + ${context.path} + + + + + + + start-cargo-server + pre-integration-test + + start + + + + stop-cargo-server + post-integration-test + + stop + + + + + + + + net.wasdev.wlp.maven.plugins + liberty-maven-plugin + 2.0 + + + start-liberty + pre-integration-test + + start-server + deploy + + + + stop-liberty + post-integration-test + + stop-server + + + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + ${project.packaging} + + + com.ibm.websphere.appserver.runtime + ${liberty.profile} + ${liberty.version} + zip + + + + + + + org.eclipse.jetty + jetty-maven-plugin + + + ${context.path} + + + + + + + maven-deploy-plugin + + true + + + + maven-surefire-plugin + + true + + + + maven-failsafe-plugin + + + ${project.groupId}:vaadin-test-server-tests + + + ${context.path} + + + + + + + + + + all + + true + + + jsp-integration + wildfly13 + wildfly12 + wildfly11 + wildfly10 + wildfly9 + wildfly8 + jetty8 + jetty9 + glassfish + + tomcat7 + tomcat80 + tomcat85 + tomcat9 + liberty-javaee + liberty-webprofile + + + + + ant-test + + generic + + + + wildfly + + wildfly13 + wildfly12 + wildfly11 + wildfly10 + wildfly9 + wildfly8 + + + + jetty + + jetty9 + jetty8 + + + + liberty + + liberty-webprofile + liberty-javaee + + + + glassfish + + glassfish + + + + tomcat + + tomcat7 + tomcat80 + tomcat85 + tomcat9 + + + + + diff --git a/test/servlet-containers/screenshots/finland-phantomjs.png b/test/servlet-containers/screenshots/finland-phantomjs.png new file mode 100644 index 0000000000000000000000000000000000000000..78ee903b5a90dfb6b36155eb70cd233075eca5f2 GIT binary patch literal 10907 zcmds6c|6ox|94vzu3Hi%rlgcYQY6MyDp$m9BTFQevJTSFSi06*L{awTkxCLmreO?s zD6UN0QZbB~LD^@FT8- zA|et-Kkq*(BC-%KA~OG|=psN8XeT}{BBFA}X#d{hJ}m=naOjD#UwrUjHv566sqe{Ajiux$-Bj1Mww7#fKktVfnQvCCQ*01vUv-jj;>eK?s!qAZk5^j$ z>o-Le>w>FFdlW)KL@)=IxG!L+R!C8Iu3NIvb7yS{$Wh;*9;{s9)lkBi=$*UCjN8k^hWz0gOBN$y~mauSkTiVXjoLM7Z?ZjSBP% zHTqRh{>Ue>x{}@Jkq0GZIJ*<2q%NggEWym%%+lvDbCsl~Qo54iKaVqb~zUc)pj6CKPk3Hbi5GunZbPw>k5GEM7;sk~G4xjz1b<~)LJ{`}m9sjwp_};Ii zA30`4DM7kHDBl0TXB0^d$#LUV5@ExUp^2f+?3)jqjpp+>_zAy|_PDyb`pJdYcegpc zefZ1KqcKb`V!8j_(rIOI!!t%Q=!nJlcRbGM;yjb!_ukQL+6gZvy%sNGT(bz~JqxU#*-D)A*=RUc|&b=TmZx!{(E{V2csfk|Qv!!LuxdM;(AL@h%3Da_~xzuA&s zwtS_kl@ef#XB2kgxSrnxl#`qK*C)>UojZ5#nJ;A45>uP0jRA>Huq$S>gol7gEv$z# zD$S>(2Q8L)#=*hitCPIv&y251ay0;|Ap1w(l34Y+)O-7q@-|5DiYcekESt^>U66Ep z=UQ%g5b>44t8dOV4s9S#x;RbGU&{`n-zz=-a}fN{j7%~Z?y9n5A@HgWt=EnKkbIV5RyJ(<0l3yNVbJrK9QkF1UNSD_-`0+mP6DdQS`yvp|4z6rmW@fMnpmSD zIJ+`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RzU0q#!qHqFn zU0COP5yRGlMr~NV=Vt@G3fia#4&C(hIiS(IZ7Tyj-p=j=0K^7IDl zVWIjJGlt@05WF+Z+8tOuZtC7@u=89W&=4%!_d@V(>m0UK`{AcozZ|WuS?x{SG}2LO zc8*@ibsvLP)0=s$Nx!TD)U9E%_3M~VG=TBDR&b~$6>(yXEFqyzF^I0&w5pmG+a}1x zj3piG{YnHazwWL=axV8!;>}!nC+o`Xtg8qnYHDgeH5ZqTZp8^1y?SrS>T^ILH+8jV z^2lk751uwMQC?oY*N*)C0>k#iBu7OSSs!t`lMgMsBHKt#B8hLz@j2R$cMQZpk}}Hf zL#tU3Ey9(@tk2J~>~#+0e2?kx=idMwq5a&pdIU?HTE)5gygq%T(9H}S%!jf^+%AlQ z^LUR2deQ+OMoXIP?d|RJN;ik1aQ?4Y0}Yue!+A%3A(Ks3txC>jrVEL+P*%3@Z@_8n z8*_;~$YBX9fJ4V!n8UCiCiWH#;@lbnCsNJF&1dp; zPc1`h@#5taok233%0b}+=FN0`Z7N+ycN{f&sD?}OJ;%WI#|cpV`Bv+U%;+Rl`&Y|# zw$@3m9iqAWH2{J$SUu!)AL01}CY!_GyfK&=y}_O&p2US`6Y=RmbX_A_DzAx2KA#!f z{j80l!6lQhj zN`a&&Bg#Kp60VTGmT8kNeFvM=m<*c~h+Jdu(>4b#JqUx?=%OvZP0)We(BA5D3GpYW z_XZ)#w5Z<|an7pJ<{@z*l+LqZWJ3Y2`W%a?wP zvDhy@rpR}@e5r&=(%s0V-Cyf~j|j?pQ&fsmelp6Jeh5Xy%~5WE-VfyujLI#SMzeHI XQ115b8F(m6496`ln~T2sHv0bnk0XoM literal 0 HcmV?d00001 diff --git a/test/servlet-containers/tomcat7/pom.xml b/test/servlet-containers/tomcat7/pom.xml new file mode 100644 index 0000000000..4e4c57f34e --- /dev/null +++ b/test/servlet-containers/tomcat7/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-tomcat7-server + Vaadin Tomcat 7 Test + war + + true + 7.0.82 + tomcat7 + + + + + + com.vaadin + vaadin-test-server-ui + ${project.version} + + + com.vaadin + vaadin-test-server-tests + ${project.version} + test + + + + + + + + org.codehaus.cargo + cargo-maven2-plugin + + + tomcat7x + + org.apache.tomcat + tomcat + ${tomcat.version} + + + + + + + diff --git a/test/servlet-containers/tomcat80/pom.xml b/test/servlet-containers/tomcat80/pom.xml new file mode 100644 index 0000000000..c79fba6eb5 --- /dev/null +++ b/test/servlet-containers/tomcat80/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-tomcat80-server + Vaadin Tomcat 8.0 Test + war + + true + 8.0.47 + tomcat8.0 + + + + + + com.vaadin + vaadin-test-server-ui + ${project.version} + + + com.vaadin + vaadin-test-server-tests + ${project.version} + test + + + + + + + + org.codehaus.cargo + cargo-maven2-plugin + + + tomcat8x + + org.apache.tomcat + tomcat + ${tomcat.version} + + + + + + + diff --git a/test/servlet-containers/tomcat85/pom.xml b/test/servlet-containers/tomcat85/pom.xml new file mode 100644 index 0000000000..405de2a255 --- /dev/null +++ b/test/servlet-containers/tomcat85/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-tomcat85-server + Vaadin Tomcat 8.5 Test + war + + true + 8.5.23 + tomcat8.5 + + + + + + com.vaadin + vaadin-test-server-ui + ${project.version} + + + com.vaadin + vaadin-test-server-tests + ${project.version} + test + + + + + + + + org.codehaus.cargo + cargo-maven2-plugin + + + tomcat8x + + org.apache.tomcat + tomcat + ${tomcat.version} + + + + + + + diff --git a/test/servlet-containers/tomcat9/pom.xml b/test/servlet-containers/tomcat9/pom.xml new file mode 100644 index 0000000000..951353b76c --- /dev/null +++ b/test/servlet-containers/tomcat9/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-tomcat9-server + Vaadin Tomcat 9 Test + war + + true + 9.0.1 + tomcat9 + + + + + + com.vaadin + vaadin-test-server-ui + ${project.version} + + + com.vaadin + vaadin-test-server-tests + ${project.version} + test + + + + + + + + org.codehaus.cargo + cargo-maven2-plugin + + + tomcat9x + + org.apache.tomcat + tomcat + ${tomcat.version} + + + + + + + diff --git a/test/servlet-containers/wildfly10/pom.xml b/test/servlet-containers/wildfly10/pom.xml new file mode 100644 index 0000000000..345a7e7030 --- /dev/null +++ b/test/servlet-containers/wildfly10/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-wildfly10-server + Vaadin Wildfly 10 Test + war + + true + 10.1.0.Final + wildfly10 + + + + + + com.vaadin + vaadin-test-server-ui + ${project.version} + + + com.vaadin + vaadin-test-server-tests + ${project.version} + test + + + + + + + + org.wildfly.plugins + wildfly-maven-plugin + + + + diff --git a/test/servlet-containers/wildfly11/pom.xml b/test/servlet-containers/wildfly11/pom.xml new file mode 100644 index 0000000000..f1638b5db4 --- /dev/null +++ b/test/servlet-containers/wildfly11/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-wildfly11-server + Vaadin Wildfly 11 Test + war + + true + 11.0.0.Final + wildfly11 + + + + + + com.vaadin + vaadin-test-server-ui + ${project.version} + + + com.vaadin + vaadin-test-server-tests + ${project.version} + test + + + + + + + + org.wildfly.plugins + wildfly-maven-plugin + + + + diff --git a/test/servlet-containers/wildfly12/pom.xml b/test/servlet-containers/wildfly12/pom.xml new file mode 100644 index 0000000000..0df910e9c1 --- /dev/null +++ b/test/servlet-containers/wildfly12/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-wildfly12-server + Vaadin Wildfly 12 Test + war + + true + 12.0.0.Final + wildfly12 + + + + + + com.vaadin + vaadin-test-server-ui + ${project.version} + + + com.vaadin + vaadin-test-server-tests + ${project.version} + test + + + + + + + + org.wildfly.plugins + wildfly-maven-plugin + + + + diff --git a/test/servlet-containers/wildfly13/pom.xml b/test/servlet-containers/wildfly13/pom.xml new file mode 100644 index 0000000000..c1d18572f6 --- /dev/null +++ b/test/servlet-containers/wildfly13/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-wildfly13-server + Vaadin Wildfly 13 Test + war + + true + 13.0.0.Final + wildfly13 + + + + + + com.vaadin + vaadin-test-server-ui + ${project.version} + + + com.vaadin + vaadin-test-server-tests + ${project.version} + test + + + + + + + + org.wildfly.plugins + wildfly-maven-plugin + + + + diff --git a/test/servlet-containers/wildfly8/pom.xml b/test/servlet-containers/wildfly8/pom.xml new file mode 100644 index 0000000000..21fbeceda2 --- /dev/null +++ b/test/servlet-containers/wildfly8/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-wildfly8-server + Vaadin Wildfly 8 Test + war + + true + 8.2.1.Final + wildfly8 + + + + + + com.vaadin + vaadin-test-server-ui + ${project.version} + + + com.vaadin + vaadin-test-server-tests + ${project.version} + test + + + + + + + + org.wildfly.plugins + wildfly-maven-plugin + + + + diff --git a/test/servlet-containers/wildfly9/pom.xml b/test/servlet-containers/wildfly9/pom.xml new file mode 100644 index 0000000000..9f81a02032 --- /dev/null +++ b/test/servlet-containers/wildfly9/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + + com.vaadin + vaadin-servlet-containers-test + 7.7-SNAPSHOT + + vaadin-test-wildfly9-server + Vaadin Wildfly 9 Test + war + + true + 9.0.2.Final + wildfly9 + + + + + + com.vaadin + vaadin-test-server-ui + ${project.version} + + + com.vaadin + vaadin-test-server-tests + ${project.version} + test + + + + + + + + org.wildfly.plugins + wildfly-maven-plugin + + + + diff --git a/test/widget-set-testutil/src/test/java/com/vaadin/test/defaultwidgetset/AbstractWidgetSetIT.java b/test/widget-set-testutil/src/test/java/com/vaadin/test/defaultwidgetset/AbstractWidgetSetIT.java index c6d4f1756b..c492ab50f3 100644 --- a/test/widget-set-testutil/src/test/java/com/vaadin/test/defaultwidgetset/AbstractWidgetSetIT.java +++ b/test/widget-set-testutil/src/test/java/com/vaadin/test/defaultwidgetset/AbstractWidgetSetIT.java @@ -14,6 +14,8 @@ import com.vaadin.testbench.TestBenchTestCase; import com.vaadin.testbench.elements.ButtonElement; import com.vaadin.testbench.elements.LabelElement; import com.vaadin.testbench.elements.TextFieldElement; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; public abstract class AbstractWidgetSetIT extends TestBenchTestCase { @@ -68,11 +70,14 @@ public abstract class AbstractWidgetSetIT extends TestBenchTestCase { } protected void assertHasDebugMessage(String message) { + // Make sure the correct debug window tab is open. + findElements(By.className("v-debugwindow-tab")).get(0).click(); + List elements = getDriver().findElements( By.xpath("//span[@class='v-debugwindow-message']")); boolean found = false; for (WebElement element : elements) { - if (element.getText().contains(message)) { + if (element.getAttribute("innerText").contains(message)) { found = true; break; } diff --git a/uitest/vaadin-server.xml b/uitest/vaadin-server.xml deleted file mode 100644 index 5e9090a536..0000000000 --- a/uitest/vaadin-server.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Waiting for Servlet Container to start up. - - - - - - - -- 2.39.5