diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-10-05 10:09:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-05 10:09:22 +0300 |
commit | 3cbd834842319d151d9248706bc14e14a3abca42 (patch) | |
tree | a2e918d9632512acecf0fcadc31a2ac1a10de71c | |
parent | eda970f667f5784977b63a158b24bd1c1f28ffc4 (diff) | |
download | vaadin-framework-3cbd834842319d151d9248706bc14e14a3abca42.tar.gz vaadin-framework-3cbd834842319d151d9248706bc14e14a3abca42.zip |
Add maven based server tests for Wildfly and Jetty (#10116)
This patch refactors the generic integration test war into
two jar dependencies and individual modules for different servers.
There is now a common approach for making configurations for the
remaining server tests still executed through an Ant build script.
44 files changed, 440 insertions, 124 deletions
diff --git a/test/README.md b/test/README.md index ca9e61c57c..b89a34da49 100644 --- a/test/README.md +++ b/test/README.md @@ -1,5 +1,24 @@ +# Vaadin Test + This is a test project to verify the basic functionality of various related plugins and addons. -To validate a given Vaadin Version, run `mvn clean verify -Dvaadin.version=VERSIONNUMBER` +## General use + +To validate a given Vaadin Version, run `mvn clean verify -Dvaadin.version=VERSIONNUMBER`. + +## Server testing + +To validate only server compatibility, run `mvn clean verify -Dvaadin.version=VERSIONNUMBER` in the `servlet-containers` module. + +To test only a subset of the servers, there are profiles with the server name. For example `-P wildfly` runs all Wildfly tests, `-P glassfish,jetty` runs all the Glassfish and Jetty tests. + +## Running an individual test locally + +To install dependencies for testing an individual module locally, run `mvn clean install -Dinstall.skip=false` in the dependency module. + +For example you can install all dependencies for running any individual server test module with the following command in the test root: +``` +mvn clean install -Dinstall.skip=false -pl .,servlet-containers,servlet-containers/generic-ui,servlet-containers/generic-tests +``` -Note that `mvn clean install` needs to be executed in the top-level test project or in the widget-set-testutil subproject before running tests for any individual submodule. +This will install the parent POMs on both levels as well as the UI and server test dependencies. diff --git a/test/pom.xml b/test/pom.xml index 421eeae590..57b0143a80 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -18,8 +18,18 @@ <failOnMissingWebXml>false</failOnMissingWebXml> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + <!-- Don't care about coding style for tests --> <sonar.skip>true</sonar.skip> + + <!-- Allow installing for local testing purposes --> + <install.skip>true</install.skip> + + <!-- Default server.name is "jetty", used in server tests --> + <server.name>jetty</server.name> + + <!-- Default reference screenshot location, relative to the module path --> + <reference.directory>${project.basedir}/../screenshots</reference.directory> </properties> <repositories> @@ -53,6 +63,11 @@ <artifactId>vaadin-test-widget-set-testutil</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + </dependency> </dependencies> </dependencyManagement> @@ -80,7 +95,6 @@ <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> - <version>4.12</version> <scope>test</scope> </dependency> <dependency> @@ -101,10 +115,11 @@ <module>space in directory</module> <module>vaadinservletconfiguration-widget-set</module> <module>spring-boot</module> - <module>servlet-containers/generic</module> <module>cdi</module> - <module>servlet-containers/jsp-integration</module> - <module>servlet-containers/karaf</module> + + <!-- Servlet container tests --> + <module>servlet-containers</module> + <module>bean-api-validation</module> <module>bean-impl-validation</module> <module>dependency-rewrite-addon</module> @@ -150,7 +165,7 @@ <artifactId>maven-install-plugin</artifactId> <version>2.5.1</version> <configuration> - <skip>true</skip> + <skip>${install.skip}</skip> </configuration> </plugin> <plugin> @@ -233,7 +248,12 @@ <configuration> <systemPropertyVariables> <phantomjs.binary.path>${phantomjs.binary}</phantomjs.binary.path> + <server-name>${server.name}</server-name> + <com.vaadin.testbench.Parameters.screenshotReferenceDirectory>${reference.directory}</com.vaadin.testbench.Parameters.screenshotReferenceDirectory> + <com.vaadin.testbench.Parameters.screenshotErrorDirectory>target/error-screenshots</com.vaadin.testbench.Parameters.screenshotErrorDirectory> </systemPropertyVariables> + <!-- Run all the tests, don't stop on first failure --> + <testFailureIgnore>true</testFailureIgnore> </configuration> </plugin> </plugins> diff --git a/test/servlet-containers/generic-tests/pom.xml b/test/servlet-containers/generic-tests/pom.xml new file mode 100644 index 0000000000..b107c40d0a --- /dev/null +++ b/test/servlet-containers/generic-tests/pom.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-servlet-containers-test</artifactId> + <version>8.2-SNAPSHOT</version> + </parent> + <artifactId>vaadin-test-server-tests</artifactId> + <name>vaadin-test-server-tests</name> + <packaging>jar</packaging> + <properties> + <jetty.skip>true</jetty.skip> + </properties> + + <dependencies> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-server-ui</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-testbench-api</artifactId> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </dependency> + </dependencies> +</project> diff --git a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/AbstractIntegrationTest.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/AbstractIntegrationTest.java index 10ad299a4b..79d75f6651 100644 --- a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/AbstractIntegrationTest.java +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/AbstractIntegrationTest.java @@ -3,7 +3,6 @@ package com.vaadin.tests.integration; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; -import java.util.List; import java.util.logging.Logger; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -12,24 +11,19 @@ import javax.imageio.ImageIO; import org.junit.After; import org.junit.runner.RunWith; -import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.support.ui.ExpectedCondition; import org.openqa.selenium.support.ui.WebDriverWait; -import com.vaadin.testbench.annotations.BrowserConfiguration; -import com.vaadin.testbench.annotations.BrowserFactory; -import com.vaadin.testbench.annotations.RunOnHub; +import com.vaadin.testbench.annotations.RunLocally; import com.vaadin.testbench.elements.UIElement; import com.vaadin.testbench.parallel.Browser; -import com.vaadin.testbench.parallel.BrowserUtil; import com.vaadin.testbench.parallel.ParallelRunner; import com.vaadin.testbench.parallel.ParallelTest; import com.vaadin.testbench.parallel.TestNameSuffix; import com.vaadin.testbench.screenshot.ImageFileUtil; -@RunOnHub("tb3-hub.intra.itmill.com") +@RunLocally(Browser.PHANTOMJS) @RunWith(ParallelRunner.class) -@BrowserFactory(CustomBrowserFactory.class) @TestNameSuffix(property = "server-name") public abstract class AbstractIntegrationTest extends ParallelTest { @@ -45,16 +39,6 @@ public abstract class AbstractIntegrationTest extends ParallelTest { private boolean screenshotErrors; - @BrowserConfiguration - public final List<DesiredCapabilities> getBrowsersToTest() { - return getBrowsers().map(BrowserUtil.getBrowserFactory()::create) - .collect(Collectors.toList()); - } - - protected Stream<Browser> getBrowsers() { - return Stream.of(Browser.PHANTOMJS); - } - @Override public void setup() throws Exception { super.setup(); @@ -88,8 +72,8 @@ public abstract class AbstractIntegrationTest extends ParallelTest { private String getDeploymentURL() { String deploymentUrl = System.getProperty("deployment.url"); if (deploymentUrl == null || deploymentUrl.isEmpty()) { - throw new RuntimeException( - "Deployment url must be given as deployment.url"); + // Default to http://localhost:8080 + return "http://localhost:8080"; } return deploymentUrl; } @@ -100,7 +84,8 @@ public abstract class AbstractIntegrationTest extends ParallelTest { + ".png"; String errorFileName = identifier + "-" + getDesiredCapabilities().getBrowserName().toLowerCase() + "-" - + System.getProperty("server-name") + ".png"; + + System.getProperty("server-name") + "[" + + getClass().getSimpleName() + "].png"; File referenceFile = ImageFileUtil .getReferenceScreenshotFile(refFileName); try { 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/src/test/java/com/vaadin/tests/integration/ServletIntegrationDefaultPushIT.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationDefaultPushIT.java index 68b8f36205..68b8f36205 100644 --- a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/ServletIntegrationDefaultPushIT.java +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationDefaultPushIT.java diff --git a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/ServletIntegrationIT.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationIT.java index 2d37779eb7..2d37779eb7 100644 --- a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/ServletIntegrationIT.java +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationIT.java diff --git a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/ServletIntegrationLongPollingIT.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationLongPollingIT.java index 10e36d87bb..10e36d87bb 100644 --- a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/ServletIntegrationLongPollingIT.java +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationLongPollingIT.java diff --git a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/ServletIntegrationStreamingIT.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationStreamingIT.java index 5aad9899f7..5aad9899f7 100644 --- a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/ServletIntegrationStreamingIT.java +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationStreamingIT.java diff --git a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/ServletIntegrationTests.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationTests.java index 36b6c5b9f7..36b6c5b9f7 100644 --- a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/ServletIntegrationTests.java +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/ServletIntegrationTests.java diff --git a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/push/LongPollingProxyServerIT.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/push/LongPollingProxyServerIT.java index aa8f87686a..7dfd2aa6e6 100644 --- a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/push/LongPollingProxyServerIT.java +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/push/LongPollingProxyServerIT.java @@ -20,6 +20,8 @@ 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; @@ -28,7 +30,6 @@ import org.junit.runners.Parameterized.Parameters; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; -import com.vaadin.testbench.parallel.Browser; import com.vaadin.tests.integration.AbstractIntegrationTest; @RunWith(Parameterized.class) @@ -56,9 +57,10 @@ public class LongPollingProxyServerIT extends AbstractIntegrationTest { @Parameter(1) public String path; - @Override + @Before public void setup() throws Exception { - setDesiredCapabilities(Browser.PHANTOMJS.getDesiredCapabilities()); + Assume.assumeTrue( + "wildfly9-nginx".equals(System.getProperty("server-name"))); super.setup(); } @@ -81,10 +83,15 @@ public class LongPollingProxyServerIT extends AbstractIntegrationTest { } @Override - protected String getTestPath() { + protected String getContextPath() { return "/" + path + "/demo"; } + @Override + protected String getTestPath() { + return "/"; + } + private int getClientCounter() { WebElement clientCounterElem = findElement( By.id(BasicPush.CLIENT_COUNTER_ID)); diff --git a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/websocket/ServletIntegrationWebsocketIT.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/ServletIntegrationWebsocketIT.java index 525e4545e4..525e4545e4 100644 --- a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/websocket/ServletIntegrationWebsocketIT.java +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/ServletIntegrationWebsocketIT.java diff --git a/test/servlet-containers/generic/src/test/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 index f49d3656db..f49d3656db 100644 --- a/test/servlet-containers/generic/src/test/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 diff --git a/test/servlet-containers/generic-ui/pom.xml b/test/servlet-containers/generic-ui/pom.xml new file mode 100644 index 0000000000..d54579cec6 --- /dev/null +++ b/test/servlet-containers/generic-ui/pom.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-servlet-containers-test</artifactId> + <version>8.2-SNAPSHOT</version> + </parent> + <artifactId>vaadin-test-server-ui</artifactId> + <name>vaadin-test-server-ui</name> + <packaging>jar</packaging> + <properties> + <jetty.skip>true</jetty.skip> + </properties> + + <dependencies> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-client-compiled</artifactId> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-push</artifactId> + </dependency> + </dependencies> +</project> diff --git a/test/servlet-containers/generic/src/main/java/com/vaadin/tests/IntegrationTestUIProvider.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/IntegrationTestUIProvider.java index 6f265b10f7..6f265b10f7 100644 --- a/test/servlet-containers/generic/src/main/java/com/vaadin/tests/IntegrationTestUIProvider.java +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/IntegrationTestUIProvider.java diff --git a/test/servlet-containers/generic/src/main/java/com/vaadin/tests/JSR356Servlet.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/JSR356Servlet.java index 1a6c138f36..1a6c138f36 100644 --- a/test/servlet-containers/generic/src/main/java/com/vaadin/tests/JSR356Servlet.java +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/JSR356Servlet.java diff --git a/test/servlet-containers/generic/src/main/java/com/vaadin/tests/ServerIntegrationTestServlet.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/ServerIntegrationTestServlet.java index 9ca79b31a8..9ca79b31a8 100644 --- a/test/servlet-containers/generic/src/main/java/com/vaadin/tests/ServerIntegrationTestServlet.java +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/ServerIntegrationTestServlet.java diff --git a/test/servlet-containers/generic/src/main/java/com/vaadin/tests/integration/FlagSeResource.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/FlagSeResource.java index 8f8fce77c2..8f8fce77c2 100644 --- a/test/servlet-containers/generic/src/main/java/com/vaadin/tests/integration/FlagSeResource.java +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/FlagSeResource.java diff --git a/test/servlet-containers/generic/src/main/java/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java index 530e093d8e..530e093d8e 100644 --- a/test/servlet-containers/generic/src/main/java/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java diff --git a/test/servlet-containers/generic/src/main/java/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java index be74683026..be74683026 100644 --- a/test/servlet-containers/generic/src/main/java/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java diff --git a/test/servlet-containers/generic/src/main/java/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java index 540fd70df5..540fd70df5 100644 --- a/test/servlet-containers/generic/src/main/java/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java diff --git a/test/servlet-containers/generic/src/main/java/com/vaadin/tests/integration/ServletIntegrationUI.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationUI.java index 0d4010beaa..0d4010beaa 100644 --- a/test/servlet-containers/generic/src/main/java/com/vaadin/tests/integration/ServletIntegrationUI.java +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationUI.java diff --git a/test/servlet-containers/generic/src/main/java/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java index cfffa04c11..cfffa04c11 100644 --- a/test/servlet-containers/generic/src/main/java/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java +++ b/test/servlet-containers/generic-ui/src/main/java/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java diff --git a/test/servlet-containers/generic/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 index c9ef1b82b0..c9ef1b82b0 100644 --- a/test/servlet-containers/generic/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 diff --git a/test/servlet-containers/generic/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 index a3f2dd1c47..a3f2dd1c47 100644 --- a/test/servlet-containers/generic/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 diff --git a/test/servlet-containers/generic/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 index 1ed7848a12..1ed7848a12 100644 --- a/test/servlet-containers/generic/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 diff --git a/test/servlet-containers/generic/src/main/resources/com/vaadin/tests/integration/LabelFromDesign.html b/test/servlet-containers/generic-ui/src/main/resources/com/vaadin/tests/integration/LabelFromDesign.html index 56329d7d19..56329d7d19 100644 --- a/test/servlet-containers/generic/src/main/resources/com/vaadin/tests/integration/LabelFromDesign.html +++ b/test/servlet-containers/generic-ui/src/main/resources/com/vaadin/tests/integration/LabelFromDesign.html diff --git a/test/servlet-containers/generic/src/main/resources/com/vaadin/tests/integration/fi.gif b/test/servlet-containers/generic-ui/src/main/resources/com/vaadin/tests/integration/fi.gif Binary files differindex 8d3a191828..8d3a191828 100644 --- a/test/servlet-containers/generic/src/main/resources/com/vaadin/tests/integration/fi.gif +++ b/test/servlet-containers/generic-ui/src/main/resources/com/vaadin/tests/integration/fi.gif diff --git a/test/servlet-containers/generic/src/main/resources/com/vaadin/tests/integration/se.gif b/test/servlet-containers/generic-ui/src/main/resources/com/vaadin/tests/integration/se.gif Binary files differindex 80f6285228..80f6285228 100644 --- a/test/servlet-containers/generic/src/main/resources/com/vaadin/tests/integration/se.gif +++ b/test/servlet-containers/generic-ui/src/main/resources/com/vaadin/tests/integration/se.gif diff --git a/test/servlet-containers/generic/integration_tests.xml b/test/servlet-containers/generic/integration_tests.xml index d8a5bba18b..28f941e696 100644 --- a/test/servlet-containers/generic/integration_tests.xml +++ b/test/servlet-containers/generic/integration_tests.xml @@ -56,6 +56,7 @@ </antcall> </target> <target name="run-tb3-test"> + <fail unless="phantomjs.binary.path" message="Define PhantomJS binary using -Dphantomjs.binary.path" /> <fail unless="server-name" message="Server name must be defined in server-name" /> <fail unless="deployment.url" message="Deplyoment url must be defined in deployment.url" /> <fail unless="com.vaadin.testbench.screenshot.directory" message="Screenshot directory must be defined in com.vaadin.testbench.screenshot.directory" /> @@ -73,6 +74,7 @@ <jvmarg value="-Djava.awt.headless=true" /> <jvmarg value="-Ddemo.war=${demo.war}" /> <jvmarg value="-Dvaadin.testbench.developer.license=${vaadin.testbench.developer.license}" /> + <jvmarg value="-Dphantomjs.binary.path=${phantomjs.binary.path}" /> <test name="${junit.test.suite}" todir="${server.report.dir}" /> </junit> </target> @@ -102,14 +104,14 @@ <param name="target-server" value="jetty8" /> </antcall> </target> - +<!-- <target name="integration-test-jetty9"> <antcall target="run-generic-integration-test"> <param name="startDelay" value="90" /> <param name="target-server" value="jetty9" /> </antcall> </target> - +--> <target name="integration-test-jboss-eap6"> <antcall target="run-generic-integration-test"> <param name="startDelay" value="10" /> @@ -123,6 +125,7 @@ <param name="target-server" value="wildfly8" /> </antcall> </target> +<!-- <target name="integration-test-wildfly9"> <antcall target="run-generic-integration-test"> <param name="startDelay" value="10" /> @@ -135,6 +138,7 @@ <param name="target-server" value="wildfly10" /> </antcall> </target> +--> <target name="integration-test-wildfly9-nginx"> <antcall target="run-generic-integration-test"> <param name="startDelay" value="10" /> @@ -180,10 +184,10 @@ <antcall target="integration-test-payara" /> <antcall target="integration-test-jboss-eap6" /> <antcall target="integration-test-wildfly8" /> - <antcall target="integration-test-wildfly9" /> - <antcall target="integration-test-wildfly10" /> +<!-- <antcall target="integration-test-wildfly9" /> + <antcall target="integration-test-wildfly10" /> --> <antcall target="integration-test-jetty8" /> - <antcall target="integration-test-jetty9" /> +<!-- <antcall target="integration-test-jetty9" /> --> <antcall target="integration-test-tomcat7" /> <antcall target="integration-test-tomcat8" /> <antcall target="integration-test-tomcat7apacheproxy" /> diff --git a/test/servlet-containers/generic/pom.xml b/test/servlet-containers/generic/pom.xml index aff6403ff5..95e30c7fed 100644 --- a/test/servlet-containers/generic/pom.xml +++ b/test/servlet-containers/generic/pom.xml @@ -4,9 +4,8 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.vaadin</groupId> - <artifactId>vaadin-test</artifactId> + <artifactId>vaadin-servlet-containers-test</artifactId> <version>8.2-SNAPSHOT</version> - <relativePath>../..</relativePath> </parent> <artifactId>vaadin-test-generic-integration</artifactId> <name>vaadin-test-generic-integration</name> @@ -15,51 +14,42 @@ <jetty.skip>true</jetty.skip> </properties> - <dependencies> - - <!-- Project modules --> - <dependency> - <groupId>com.vaadin</groupId> - <artifactId>vaadin-compatibility-server</artifactId> - </dependency> + <!-- This module exists only to run the Ant based server tests. + It will be removed in the future. --> + <dependencies> <dependency> <groupId>com.vaadin</groupId> - <artifactId>vaadin-compatibility-client-compiled</artifactId> - </dependency> - <dependency> - <groupId>com.vaadin</groupId> - <artifactId>vaadin-compatibility-themes</artifactId> - </dependency> - <dependency> - <groupId>com.vaadin</groupId> - <artifactId>vaadin-client-compiled</artifactId> - </dependency> - <dependency> - <groupId>com.vaadin</groupId> - <artifactId>vaadin-push</artifactId> - </dependency> - <dependency> - <groupId>com.vaadin</groupId> - <artifactId>vaadin-testbench-api</artifactId> - <scope>test</scope> + <artifactId>vaadin-test-server-ui</artifactId> + <version>${project.version}</version> </dependency> </dependencies> - <build> - <plugins> - <!--TODO run this on different servers --> + <!-- Extract test classes for ant script to use --> <plugin> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-maven-plugin</artifactId> - <version>${jetty.version}</version> - <configuration> - <webApp> - <contextPath>/demo</contextPath> - </webApp> - </configuration> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>unpack-tests</id> + <phase>package</phase> + <configuration> + <artifactItems> + <artifactItem> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-server-tests</artifactId> + <version>${project.version}</version> + <includes>**/*.class</includes> + </artifactItem> + </artifactItems> + <outputDirectory>${project.build.directory}/test-classes</outputDirectory> + </configuration> + <goals> + <goal>unpack</goal> + </goals> + </execution> + </executions> </plugin> <plugin> <artifactId>maven-deploy-plugin</artifactId> diff --git a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/AbstractServletIntegrationTest.java b/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/AbstractServletIntegrationTest.java deleted file mode 100644 index ddfcb9ec3b..0000000000 --- a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/AbstractServletIntegrationTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.vaadin.tests.integration; - -import org.junit.Test; - -import com.vaadin.testbench.elements.GridElement; - -public abstract class AbstractServletIntegrationTest - extends AbstractIntegrationTest { - - @Test - public void runTest() throws Exception { - // make sure no fading progress indicator from table update is lingering - Thread.sleep(2000); - compareScreen("initial"); - $(GridElement.class).first().getCell(0, 1).click(); - // without this, table fetch might have a fading progress indicator - Thread.sleep(2000); - compareScreen("finland"); - } - -} diff --git a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/CustomBrowserFactory.java b/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/CustomBrowserFactory.java deleted file mode 100644 index e66d4b6df5..0000000000 --- a/test/servlet-containers/generic/src/test/java/com/vaadin/tests/integration/CustomBrowserFactory.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.vaadin.tests.integration; - -import org.openqa.selenium.remote.DesiredCapabilities; - -import com.vaadin.testbench.parallel.Browser; -import com.vaadin.testbench.parallel.BrowserUtil; -import com.vaadin.testbench.parallel.DefaultBrowserFactory; - -public class CustomBrowserFactory extends DefaultBrowserFactory { - - @Override - public DesiredCapabilities create(Browser browser) { - DesiredCapabilities capabilities = super.create(browser); - if (BrowserUtil.isPhantomJS(capabilities)) { - capabilities.setVersion("2"); - capabilities.setCapability("phantomjs.binary.path", - "/usr/bin/phantomjs2"); - } - return capabilities; - } -} diff --git a/test/servlet-containers/jetty9/pom.xml b/test/servlet-containers/jetty9/pom.xml new file mode 100644 index 0000000000..d53486f9ff --- /dev/null +++ b/test/servlet-containers/jetty9/pom.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-servlet-containers-test</artifactId> + <version>8.2-SNAPSHOT</version> + </parent> + <artifactId>vaadin-test-jetty9-server</artifactId> + <name>Vaadin Jetty 9 Test</name> + <packaging>war</packaging> + <properties> + <jetty.skip>false</jetty.skip> + <jetty.version>9.3.21.v20170918</jetty.version> + <server.name>jetty9</server.name> + </properties> + + <dependencies> + <!-- UI classes and tests from dependencies --> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-server-ui</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-server-tests</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <!-- Server configuration --> + <plugin> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-maven-plugin</artifactId> + </plugin> + </plugins> + </build> +</project> diff --git a/test/servlet-containers/jsp-integration/pom.xml b/test/servlet-containers/jsp-integration/pom.xml index ed77a8b931..41eaf6cbf4 100644 --- a/test/servlet-containers/jsp-integration/pom.xml +++ b/test/servlet-containers/jsp-integration/pom.xml @@ -4,9 +4,8 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.vaadin</groupId> - <artifactId>vaadin-test</artifactId> + <artifactId>vaadin-servlet-containers-test</artifactId> <version>8.2-SNAPSHOT</version> - <relativePath>../..</relativePath> </parent> <artifactId>vaadin-test-jsp-integration</artifactId> <name>vaadin-test-jsp-integration</name> diff --git a/test/servlet-containers/karaf/karaf-run/pom.xml b/test/servlet-containers/karaf/karaf-run/pom.xml index 95a7a6f6c6..ca4e7dcd96 100644 --- a/test/servlet-containers/karaf/karaf-run/pom.xml +++ b/test/servlet-containers/karaf/karaf-run/pom.xml @@ -5,7 +5,6 @@ <parent> <artifactId>vaadin-test-karaf</artifactId> <groupId>com.vaadin</groupId> - <relativePath>..</relativePath> <version>8.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/test/servlet-containers/karaf/pom.xml b/test/servlet-containers/karaf/pom.xml index b7411f3523..5e4915e90c 100644 --- a/test/servlet-containers/karaf/pom.xml +++ b/test/servlet-containers/karaf/pom.xml @@ -4,9 +4,8 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.vaadin</groupId> - <artifactId>vaadin-test</artifactId> + <artifactId>vaadin-servlet-containers-test</artifactId> <version>8.2-SNAPSHOT</version> - <relativePath>../..</relativePath> </parent> <artifactId>vaadin-test-karaf</artifactId> <packaging>pom</packaging> diff --git a/test/servlet-containers/karaf/vaadin-karaf-bundle1/pom.xml b/test/servlet-containers/karaf/vaadin-karaf-bundle1/pom.xml index fed65baf27..b49842c4dc 100644 --- a/test/servlet-containers/karaf/vaadin-karaf-bundle1/pom.xml +++ b/test/servlet-containers/karaf/vaadin-karaf-bundle1/pom.xml @@ -7,7 +7,6 @@ <groupId>com.vaadin</groupId> <artifactId>vaadin-test-karaf</artifactId> <version>8.2-SNAPSHOT</version> - <relativePath>..</relativePath> </parent> <artifactId>vaadin-karaf-bundle1</artifactId> <packaging>jar</packaging> diff --git a/test/servlet-containers/karaf/vaadin-karaf-bundle2/pom.xml b/test/servlet-containers/karaf/vaadin-karaf-bundle2/pom.xml index 4a6a0efe24..52227d0a66 100644 --- a/test/servlet-containers/karaf/vaadin-karaf-bundle2/pom.xml +++ b/test/servlet-containers/karaf/vaadin-karaf-bundle2/pom.xml @@ -6,7 +6,6 @@ <parent> <artifactId>vaadin-test-karaf</artifactId> <groupId>com.vaadin</groupId> - <relativePath>..</relativePath> <version>8.2-SNAPSHOT</version> </parent> <artifactId>vaadin-karaf-bundle2</artifactId> diff --git a/test/servlet-containers/pom.xml b/test/servlet-containers/pom.xml new file mode 100644 index 0000000000..7727c86c4f --- /dev/null +++ b/test/servlet-containers/pom.xml @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test</artifactId> + <version>8.2-SNAPSHOT</version> + </parent> + <artifactId>vaadin-servlet-containers-test</artifactId> + <name>vaadin-servlet-containers-test</name> + <packaging>pom</packaging> + + <modules> + <module>generic-ui</module> + <module>generic-tests</module> + </modules> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.wildfly.plugins</groupId> + <artifactId>wildfly-maven-plugin</artifactId> + <version>1.2.0.Final</version> + <executions> + <execution> + <id>start-wildfly</id> + <phase>pre-integration-test</phase> + <goals> + <goal>start</goal> + <goal>deploy</goal> + </goals> + <configuration> + <!-- Context path comes from WAR deployment name --> + <name>demo.war</name> + </configuration> + </execution> + <execution> + <id>stop-wildfly</id> + <phase>post-integration-test</phase> + <goals> + <goal>shutdown</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-maven-plugin</artifactId> + <configuration> + <webApp> + <contextPath>/demo</contextPath> + </webApp> + </configuration> + </plugin> + + <!-- General purpose plugins --> + <plugin> + <artifactId>maven-deploy-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + <plugin> + <artifactId>maven-failsafe-plugin</artifactId> + <configuration> + <dependenciesToScan> + <dependency>${project.groupId}:vaadin-test-server-tests</dependency> + </dependenciesToScan> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> + + <profiles> + <profile> + <id>all</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <modules> + <module>jsp-integration</module> + <module>karaf</module> + <module>wildfly10</module> + <module>wildfly9</module> + <module>jetty9</module> + </modules> + </profile> + <!-- TODO Remove this when the ant build is no longer used. --> + <profile> + <id>ant-test</id> + <modules> + <module>generic</module> + </modules> + </profile> + <profile> + <id>wildfly</id> + <modules> + <module>wildfly10</module> + <module>wildfly9</module> + </modules> + </profile> + <profile> + <id>jetty</id> + <modules> + <module>jetty9</module> + </modules> + </profile> + </profiles> + +</project> diff --git a/test/servlet-containers/screenshots/finland-phantomjs.png b/test/servlet-containers/screenshots/finland-phantomjs.png Binary files differnew file mode 100644 index 0000000000..7853307584 --- /dev/null +++ b/test/servlet-containers/screenshots/finland-phantomjs.png diff --git a/test/servlet-containers/screenshots/initial-phantomjs.png b/test/servlet-containers/screenshots/initial-phantomjs.png Binary files differnew file mode 100644 index 0000000000..8764e467f2 --- /dev/null +++ b/test/servlet-containers/screenshots/initial-phantomjs.png diff --git a/test/servlet-containers/wildfly10/pom.xml b/test/servlet-containers/wildfly10/pom.xml new file mode 100644 index 0000000000..97697110d4 --- /dev/null +++ b/test/servlet-containers/wildfly10/pom.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-servlet-containers-test</artifactId> + <version>8.2-SNAPSHOT</version> + </parent> + <artifactId>vaadin-test-wildfly10-server</artifactId> + <name>Vaadin Wildfly 10 Test</name> + <packaging>war</packaging> + <properties> + <jetty.skip>true</jetty.skip> + <wildfly.version>10.1.0.Final</wildfly.version> + <server.name>wildfly10</server.name> + </properties> + + <dependencies> + <!-- UI classes and tests from dependencies --> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-server-ui</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-server-tests</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <!-- Server configuration --> + <plugin> + <groupId>org.wildfly.plugins</groupId> + <artifactId>wildfly-maven-plugin</artifactId> + </plugin> + </plugins> + </build> +</project> diff --git a/test/servlet-containers/wildfly9/pom.xml b/test/servlet-containers/wildfly9/pom.xml new file mode 100644 index 0000000000..074dc4aa52 --- /dev/null +++ b/test/servlet-containers/wildfly9/pom.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-servlet-containers-test</artifactId> + <version>8.2-SNAPSHOT</version> + </parent> + <artifactId>vaadin-test-wildfly9-server</artifactId> + <name>Vaadin Wildfly 9 Test</name> + <packaging>war</packaging> + <properties> + <jetty.skip>true</jetty.skip> + <wildfly.version>9.0.2.Final</wildfly.version> + <server.name>wildfly9</server.name> + </properties> + + <dependencies> + <!-- UI classes and tests from dependencies --> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-server-ui</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-server-tests</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <!-- Server configuration --> + <plugin> + <groupId>org.wildfly.plugins</groupId> + <artifactId>wildfly-maven-plugin</artifactId> + </plugin> + </plugins> + </build> +</project> |