From 0aad93ecc1ce743dffc093ce7ae2ef88831f6073 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Sat, 24 Sep 2016 10:20:21 +0300 Subject: [PATCH] Add tests for widgetset compilation in different modes * Using the default widget set * Using no add-ons but a custom widget set * Using add-ons with a defined widget set * Using add-ons with no defined widget set * Using directories with special characters (space) Change-Id: I85450de359f410003bed94b120915b4736bc2d4f --- pom.xml | 23 ++- .../addon-using-init-param-widget-set/pom.xml | 58 +++++++ .../AddonUsingInitParamWidgetSetUI.java | 25 +++ .../AddonUsingInitParamWidgetSetIT.java | 15 ++ .../addon-using-no-defined-widget-set/pom.xml | 52 +++++++ .../AddonUsingNoDefinedWidgetSetUI.java | 24 +++ .../AddonUsingNoDefinedWidgetSetIT.java | 14 ++ test/addon-using-own-widget-set/pom.xml | 52 +++++++ .../AddonUsingOwnWidgetSetUI.java | 26 ++++ .../AddonUsingOwnWidgetSet.gwt.xml | 5 + .../AddonUsingOwnWidgetSetIT.java | 15 ++ test/default-widget-set/pom.xml | 34 ++++ .../defaultwidgetset/DefaultWidgetSetUI.java | 15 ++ .../defaultwidgetset/DefaultWidgetSetIT.java | 11 ++ test/own-widget-set/pom.xml | 45 ++++++ .../test/ownwidgetset/OwnWidgetSetUI.java | 17 ++ .../test/ownwidgetset/OwnWidgetSet.gwt.xml | 5 + .../test/ownwidgetset/OwnWidgetSetIT.java | 14 ++ test/pom.xml | 147 ++++++++++++++++++ test/space in directory/pom.xml | 44 ++++++ .../spaceindirectory/SpaceInDirectoryUI.java | 17 ++ .../spaceindirectory/SpaceInDirectory.gwt.xml | 5 + .../spaceindirectory/SpaceInDirectoryIT.java | 15 ++ .../pom.xml | 45 ++++++ ...VaadinServletConfigurationWidgetSetUI.java | 16 ++ ...aadinServletConfigurationWidgetSet.gwt.xml | 5 + ...VaadinServletConfigurationWidgetSetIT.java | 14 ++ test/widget-set-testutil/pom.xml | 32 ++++ .../widgetset/AbstractTestWidgetSetUI.java | 39 +++++ .../defaultwidgetset/AbstractWidgetSetIT.java | 59 +++++++ uitest/pom.xml | 1 - 31 files changed, 885 insertions(+), 4 deletions(-) create mode 100644 test/addon-using-init-param-widget-set/pom.xml create mode 100644 test/addon-using-init-param-widget-set/src/main/java/com/vaadin/test/addonusinginitparamwidgetset/AddonUsingInitParamWidgetSetUI.java create mode 100644 test/addon-using-init-param-widget-set/src/test/java/com/vaadin/test/addonusinginitparamwidgetset/AddonUsingInitParamWidgetSetIT.java create mode 100644 test/addon-using-no-defined-widget-set/pom.xml create mode 100644 test/addon-using-no-defined-widget-set/src/main/java/com/vaadin/test/addonusingnodefinedwidgetset/AddonUsingNoDefinedWidgetSetUI.java create mode 100644 test/addon-using-no-defined-widget-set/src/test/java/com/vaadin/test/addonusingnodefinedwidgetset/AddonUsingNoDefinedWidgetSetIT.java create mode 100644 test/addon-using-own-widget-set/pom.xml create mode 100644 test/addon-using-own-widget-set/src/main/java/com/vaadin/test/addonusingownwidgetset/AddonUsingOwnWidgetSetUI.java create mode 100644 test/addon-using-own-widget-set/src/main/resources/com/vaadin/test/addonusingownwidgetset/AddonUsingOwnWidgetSet.gwt.xml create mode 100644 test/addon-using-own-widget-set/src/test/java/com/vaadin/test/addonusingownwidgetset/AddonUsingOwnWidgetSetIT.java create mode 100644 test/default-widget-set/pom.xml create mode 100644 test/default-widget-set/src/main/java/com/vaadin/test/defaultwidgetset/DefaultWidgetSetUI.java create mode 100644 test/default-widget-set/src/test/java/com/vaadin/test/defaultwidgetset/DefaultWidgetSetIT.java create mode 100644 test/own-widget-set/pom.xml create mode 100644 test/own-widget-set/src/main/java/com/vaadin/test/ownwidgetset/OwnWidgetSetUI.java create mode 100644 test/own-widget-set/src/main/resources/com/vaadin/test/ownwidgetset/OwnWidgetSet.gwt.xml create mode 100644 test/own-widget-set/src/test/java/com/vaadin/test/ownwidgetset/OwnWidgetSetIT.java create mode 100644 test/pom.xml create mode 100644 test/space in directory/pom.xml create mode 100644 test/space in directory/src/main/java/com/vaadin/test/spaceindirectory/SpaceInDirectoryUI.java create mode 100644 test/space in directory/src/main/resources/com/vaadin/test/spaceindirectory/SpaceInDirectory.gwt.xml create mode 100644 test/space in directory/src/test/java/com/vaadin/test/spaceindirectory/SpaceInDirectoryIT.java create mode 100644 test/vaadinservletconfiguration-widget-set/pom.xml create mode 100644 test/vaadinservletconfiguration-widget-set/src/main/java/com/vaadin/test/vaadinservletconfigurationwidgetset/VaadinServletConfigurationWidgetSetUI.java create mode 100644 test/vaadinservletconfiguration-widget-set/src/main/resources/com/vaadin/test/vaadinservletconfigurationwidgetset/VaadinServletConfigurationWidgetSet.gwt.xml create mode 100644 test/vaadinservletconfiguration-widget-set/src/test/java/com/vaadin/test/vaadinservletconfigurationwidgetset/VaadinServletConfigurationWidgetSetIT.java create mode 100644 test/widget-set-testutil/pom.xml create mode 100644 test/widget-set-testutil/src/main/java/com/vaadin/test/widgetset/AbstractTestWidgetSetUI.java create mode 100644 test/widget-set-testutil/src/test/java/com/vaadin/test/defaultwidgetset/AbstractWidgetSetIT.java diff --git a/pom.xml b/pom.xml index b2bea62ac3..f13efa021c 100644 --- a/pom.xml +++ b/pom.xml @@ -7,20 +7,20 @@ vaadin-parent 1.0.0 - com.vaadin vaadin-root vaadin-root pom 7.7-SNAPSHOT - 3.0.5 + 3.1.0 1.6 1.6 UTF-8 + UTF-8 2.4 @@ -46,6 +46,9 @@ ${project.build.directory}/dependency-unpack + + 9.3.7.v20160115 + 2.1.1 @@ -74,7 +77,6 @@ https://github.com/vaadin/vaadin - buildhelpers shared @@ -132,6 +134,15 @@ maven-surefire-plugin 2.19.1 + + maven-failsafe-plugin + 2.19.1 + + + com.github.klieber + phantomjs-maven-plugin + 0.7 + maven-antrun-plugin 1.8 @@ -297,6 +308,12 @@ + + slowtest + + test + + release diff --git a/test/addon-using-init-param-widget-set/pom.xml b/test/addon-using-init-param-widget-set/pom.xml new file mode 100644 index 0000000000..cd1f3d1b17 --- /dev/null +++ b/test/addon-using-init-param-widget-set/pom.xml @@ -0,0 +1,58 @@ + + + 4.0.0 + + com.vaadin + vaadin-test + 7.7-SNAPSHOT + + vaadin-test-addon-using-init-param-widget-set + war + + + + com.vaadin + vaadin-test-widget-set-testutil + ${project.version} + + + com.vaadin + vaadin-test-widget-set-testutil + ${project.version} + test-jar + test + + + + com.vaadin.addon + vaadin-context-menu + 0.7.4 + + + com.vaadin + vaadin-client-compiled + ${project.version} + + + + + + + + com.vaadin + vaadin-maven-plugin + + + + resources + update-widgetset + compile + + + + + + + + diff --git a/test/addon-using-init-param-widget-set/src/main/java/com/vaadin/test/addonusinginitparamwidgetset/AddonUsingInitParamWidgetSetUI.java b/test/addon-using-init-param-widget-set/src/main/java/com/vaadin/test/addonusinginitparamwidgetset/AddonUsingInitParamWidgetSetUI.java new file mode 100644 index 0000000000..29ed63c56a --- /dev/null +++ b/test/addon-using-init-param-widget-set/src/main/java/com/vaadin/test/addonusinginitparamwidgetset/AddonUsingInitParamWidgetSetUI.java @@ -0,0 +1,25 @@ +package com.vaadin.test.addonusinginitparamwidgetset; + +import javax.servlet.annotation.WebInitParam; +import javax.servlet.annotation.WebServlet; + +import com.vaadin.addon.contextmenu.ContextMenu; +import com.vaadin.annotations.VaadinServletConfiguration; +import com.vaadin.server.VaadinRequest; +import com.vaadin.server.VaadinServlet; +import com.vaadin.test.widgetset.AbstractTestWidgetSetUI; +import com.vaadin.ui.AbstractComponent; + +public class AddonUsingInitParamWidgetSetUI extends AbstractTestWidgetSetUI { + + @Override + protected void init(VaadinRequest vaadinRequest) { + super.init(vaadinRequest); + new ContextMenu((AbstractComponent) getContent(), true); + } + + @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true, initParams = @WebInitParam(name = "widgetset", value = "com.vaadin.DefaultWidgetSet")) + @VaadinServletConfiguration(ui = AddonUsingInitParamWidgetSetUI.class, productionMode = false) + public static class MyUIServlet extends VaadinServlet { + } +} diff --git a/test/addon-using-init-param-widget-set/src/test/java/com/vaadin/test/addonusinginitparamwidgetset/AddonUsingInitParamWidgetSetIT.java b/test/addon-using-init-param-widget-set/src/test/java/com/vaadin/test/addonusinginitparamwidgetset/AddonUsingInitParamWidgetSetIT.java new file mode 100644 index 0000000000..f11034c8ef --- /dev/null +++ b/test/addon-using-init-param-widget-set/src/test/java/com/vaadin/test/addonusinginitparamwidgetset/AddonUsingInitParamWidgetSetIT.java @@ -0,0 +1,15 @@ +package com.vaadin.test.addonusinginitparamwidgetset; + +import org.junit.Test; + +import com.vaadin.test.defaultwidgetset.AbstractWidgetSetIT; + +public class AddonUsingInitParamWidgetSetIT extends AbstractWidgetSetIT { + + @Test + public void appStartsUserCanInteract() { + testAppStartsUserCanInteract("com.vaadin.DefaultWidgetSet"); + assertUnknownComponentShown("com.vaadin.addon.contextmenu.ContextMenu"); + } + +} diff --git a/test/addon-using-no-defined-widget-set/pom.xml b/test/addon-using-no-defined-widget-set/pom.xml new file mode 100644 index 0000000000..784c4251df --- /dev/null +++ b/test/addon-using-no-defined-widget-set/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + com.vaadin + vaadin-test + 7.7-SNAPSHOT + + vaadin-test-addon-using-no-defined-widget-set + war + + + + com.vaadin + vaadin-test-widget-set-testutil + ${project.version} + + + com.vaadin + vaadin-test-widget-set-testutil + ${project.version} + test-jar + test + + + com.vaadin.addon + vaadin-context-menu + 0.7.4 + + + + + + + + com.vaadin + vaadin-maven-plugin + + + + resources + update-widgetset + compile + + + + + + + + diff --git a/test/addon-using-no-defined-widget-set/src/main/java/com/vaadin/test/addonusingnodefinedwidgetset/AddonUsingNoDefinedWidgetSetUI.java b/test/addon-using-no-defined-widget-set/src/main/java/com/vaadin/test/addonusingnodefinedwidgetset/AddonUsingNoDefinedWidgetSetUI.java new file mode 100644 index 0000000000..d70da5bca2 --- /dev/null +++ b/test/addon-using-no-defined-widget-set/src/main/java/com/vaadin/test/addonusingnodefinedwidgetset/AddonUsingNoDefinedWidgetSetUI.java @@ -0,0 +1,24 @@ +package com.vaadin.test.addonusingnodefinedwidgetset; + +import javax.servlet.annotation.WebServlet; + +import com.vaadin.addon.contextmenu.ContextMenu; +import com.vaadin.annotations.VaadinServletConfiguration; +import com.vaadin.server.VaadinRequest; +import com.vaadin.server.VaadinServlet; +import com.vaadin.test.widgetset.AbstractTestWidgetSetUI; +import com.vaadin.ui.AbstractComponent; + +public class AddonUsingNoDefinedWidgetSetUI extends AbstractTestWidgetSetUI { + + @Override + protected void init(VaadinRequest vaadinRequest) { + super.init(vaadinRequest); + new ContextMenu((AbstractComponent) getContent(), true); + } + + @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true) + @VaadinServletConfiguration(ui = AddonUsingNoDefinedWidgetSetUI.class, productionMode = false) + public static class MyUIServlet extends VaadinServlet { + } +} diff --git a/test/addon-using-no-defined-widget-set/src/test/java/com/vaadin/test/addonusingnodefinedwidgetset/AddonUsingNoDefinedWidgetSetIT.java b/test/addon-using-no-defined-widget-set/src/test/java/com/vaadin/test/addonusingnodefinedwidgetset/AddonUsingNoDefinedWidgetSetIT.java new file mode 100644 index 0000000000..4da1b802b5 --- /dev/null +++ b/test/addon-using-no-defined-widget-set/src/test/java/com/vaadin/test/addonusingnodefinedwidgetset/AddonUsingNoDefinedWidgetSetIT.java @@ -0,0 +1,14 @@ +package com.vaadin.test.addonusingnodefinedwidgetset; + +import org.junit.Test; + +import com.vaadin.test.defaultwidgetset.AbstractWidgetSetIT; + +public class AddonUsingNoDefinedWidgetSetIT extends AbstractWidgetSetIT { + + @Test + public void appStartsUserCanInteract() { + testAppStartsUserCanInteract("AppWidgetset"); + assertNoUnknownComponentShown(); + } +} diff --git a/test/addon-using-own-widget-set/pom.xml b/test/addon-using-own-widget-set/pom.xml new file mode 100644 index 0000000000..09c9ddc665 --- /dev/null +++ b/test/addon-using-own-widget-set/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + com.vaadin + vaadin-test + 7.7-SNAPSHOT + + vaadin-test-addon-using-own-widget-set + war + + + + com.vaadin + vaadin-test-widget-set-testutil + ${project.version} + + + com.vaadin + vaadin-test-widget-set-testutil + ${project.version} + test-jar + test + + + com.vaadin.addon + vaadin-context-menu + 0.7.4 + + + + + + + + com.vaadin + vaadin-maven-plugin + + + + resources + update-widgetset + compile + + + + + + + + diff --git a/test/addon-using-own-widget-set/src/main/java/com/vaadin/test/addonusingownwidgetset/AddonUsingOwnWidgetSetUI.java b/test/addon-using-own-widget-set/src/main/java/com/vaadin/test/addonusingownwidgetset/AddonUsingOwnWidgetSetUI.java new file mode 100644 index 0000000000..d5a75127d5 --- /dev/null +++ b/test/addon-using-own-widget-set/src/main/java/com/vaadin/test/addonusingownwidgetset/AddonUsingOwnWidgetSetUI.java @@ -0,0 +1,26 @@ +package com.vaadin.test.addonusingownwidgetset; + +import javax.servlet.annotation.WebServlet; + +import com.vaadin.addon.contextmenu.ContextMenu; +import com.vaadin.annotations.VaadinServletConfiguration; +import com.vaadin.annotations.Widgetset; +import com.vaadin.server.VaadinRequest; +import com.vaadin.server.VaadinServlet; +import com.vaadin.test.widgetset.AbstractTestWidgetSetUI; +import com.vaadin.ui.AbstractComponent; + +@Widgetset("com.vaadin.test.addonusingownwidgetset.AddonUsingOwnWidgetSet") +public class AddonUsingOwnWidgetSetUI extends AbstractTestWidgetSetUI { + + @Override + protected void init(VaadinRequest vaadinRequest) { + super.init(vaadinRequest); + new ContextMenu((AbstractComponent) getContent(), true); + } + + @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true) + @VaadinServletConfiguration(ui = AddonUsingOwnWidgetSetUI.class, productionMode = false) + public static class MyUIServlet extends VaadinServlet { + } +} diff --git a/test/addon-using-own-widget-set/src/main/resources/com/vaadin/test/addonusingownwidgetset/AddonUsingOwnWidgetSet.gwt.xml b/test/addon-using-own-widget-set/src/main/resources/com/vaadin/test/addonusingownwidgetset/AddonUsingOwnWidgetSet.gwt.xml new file mode 100644 index 0000000000..b9d1309108 --- /dev/null +++ b/test/addon-using-own-widget-set/src/main/resources/com/vaadin/test/addonusingownwidgetset/AddonUsingOwnWidgetSet.gwt.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/test/addon-using-own-widget-set/src/test/java/com/vaadin/test/addonusingownwidgetset/AddonUsingOwnWidgetSetIT.java b/test/addon-using-own-widget-set/src/test/java/com/vaadin/test/addonusingownwidgetset/AddonUsingOwnWidgetSetIT.java new file mode 100644 index 0000000000..8b4a84e780 --- /dev/null +++ b/test/addon-using-own-widget-set/src/test/java/com/vaadin/test/addonusingownwidgetset/AddonUsingOwnWidgetSetIT.java @@ -0,0 +1,15 @@ +package com.vaadin.test.addonusingownwidgetset; + +import org.junit.Test; + +import com.vaadin.test.defaultwidgetset.AbstractWidgetSetIT; + +public class AddonUsingOwnWidgetSetIT extends AbstractWidgetSetIT { + + @Test + public void appStartsUserCanInteract() { + testAppStartsUserCanInteract( + "com.vaadin.test.addonusingownwidgetset.AddonUsingOwnWidgetSet"); + assertNoUnknownComponentShown(); + } +} diff --git a/test/default-widget-set/pom.xml b/test/default-widget-set/pom.xml new file mode 100644 index 0000000000..22699f2a5e --- /dev/null +++ b/test/default-widget-set/pom.xml @@ -0,0 +1,34 @@ + + + 4.0.0 + + com.vaadin + vaadin-test + 7.7-SNAPSHOT + + vaadin-test-default-widget-set + war + + + + com.vaadin + vaadin-test-widget-set-testutil + ${project.version} + + + com.vaadin + vaadin-test-widget-set-testutil + ${project.version} + test-jar + test + + + com.vaadin + vaadin-client-compiled + ${project.version} + + + + + diff --git a/test/default-widget-set/src/main/java/com/vaadin/test/defaultwidgetset/DefaultWidgetSetUI.java b/test/default-widget-set/src/main/java/com/vaadin/test/defaultwidgetset/DefaultWidgetSetUI.java new file mode 100644 index 0000000000..73d8041191 --- /dev/null +++ b/test/default-widget-set/src/main/java/com/vaadin/test/defaultwidgetset/DefaultWidgetSetUI.java @@ -0,0 +1,15 @@ +package com.vaadin.test.defaultwidgetset; + +import javax.servlet.annotation.WebServlet; + +import com.vaadin.annotations.VaadinServletConfiguration; +import com.vaadin.server.VaadinServlet; +import com.vaadin.test.widgetset.AbstractTestWidgetSetUI; + +public class DefaultWidgetSetUI extends AbstractTestWidgetSetUI { + + @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true) + @VaadinServletConfiguration(ui = DefaultWidgetSetUI.class, productionMode = false) + public static class MyUIServlet extends VaadinServlet { + } +} diff --git a/test/default-widget-set/src/test/java/com/vaadin/test/defaultwidgetset/DefaultWidgetSetIT.java b/test/default-widget-set/src/test/java/com/vaadin/test/defaultwidgetset/DefaultWidgetSetIT.java new file mode 100644 index 0000000000..6da98100b4 --- /dev/null +++ b/test/default-widget-set/src/test/java/com/vaadin/test/defaultwidgetset/DefaultWidgetSetIT.java @@ -0,0 +1,11 @@ +package com.vaadin.test.defaultwidgetset; + +import org.junit.Test; + +public abstract class DefaultWidgetSetIT extends AbstractWidgetSetIT { + + @Test + public void appStartsUserCanInteract() { + testAppStartsUserCanInteract("com.vaadin.DefaultWidgetSet"); + } +} diff --git a/test/own-widget-set/pom.xml b/test/own-widget-set/pom.xml new file mode 100644 index 0000000000..e1560ffba8 --- /dev/null +++ b/test/own-widget-set/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + com.vaadin + vaadin-test + 7.7-SNAPSHOT + + vaadin-test-own-widget-set + war + + + + com.vaadin + vaadin-test-widget-set-testutil + ${project.version} + + + com.vaadin + vaadin-test-widget-set-testutil + ${project.version} + test-jar + test + + + + + + com.vaadin + vaadin-maven-plugin + + + + resources + update-widgetset + compile + + + + + + + + diff --git a/test/own-widget-set/src/main/java/com/vaadin/test/ownwidgetset/OwnWidgetSetUI.java b/test/own-widget-set/src/main/java/com/vaadin/test/ownwidgetset/OwnWidgetSetUI.java new file mode 100644 index 0000000000..3495b56320 --- /dev/null +++ b/test/own-widget-set/src/main/java/com/vaadin/test/ownwidgetset/OwnWidgetSetUI.java @@ -0,0 +1,17 @@ +package com.vaadin.test.ownwidgetset; + +import javax.servlet.annotation.WebServlet; + +import com.vaadin.annotations.VaadinServletConfiguration; +import com.vaadin.annotations.Widgetset; +import com.vaadin.server.VaadinServlet; +import com.vaadin.test.widgetset.AbstractTestWidgetSetUI; + +@Widgetset("com.vaadin.test.ownwidgetset.OwnWidgetSet") +public class OwnWidgetSetUI extends AbstractTestWidgetSetUI { + + @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true) + @VaadinServletConfiguration(ui = OwnWidgetSetUI.class, productionMode = false) + public static class MyUIServlet extends VaadinServlet { + } +} diff --git a/test/own-widget-set/src/main/resources/com/vaadin/test/ownwidgetset/OwnWidgetSet.gwt.xml b/test/own-widget-set/src/main/resources/com/vaadin/test/ownwidgetset/OwnWidgetSet.gwt.xml new file mode 100644 index 0000000000..b9d1309108 --- /dev/null +++ b/test/own-widget-set/src/main/resources/com/vaadin/test/ownwidgetset/OwnWidgetSet.gwt.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/test/own-widget-set/src/test/java/com/vaadin/test/ownwidgetset/OwnWidgetSetIT.java b/test/own-widget-set/src/test/java/com/vaadin/test/ownwidgetset/OwnWidgetSetIT.java new file mode 100644 index 0000000000..68925abc03 --- /dev/null +++ b/test/own-widget-set/src/test/java/com/vaadin/test/ownwidgetset/OwnWidgetSetIT.java @@ -0,0 +1,14 @@ +package com.vaadin.test.ownwidgetset; + +import org.junit.Test; + +import com.vaadin.test.defaultwidgetset.AbstractWidgetSetIT; + +public class OwnWidgetSetIT extends AbstractWidgetSetIT { + + @Test + public void appStartsUserCanInteract() { + testAppStartsUserCanInteract( + "com.vaadin.test.ownwidgetset.OwnWidgetSet"); + } +} diff --git a/test/pom.xml b/test/pom.xml new file mode 100644 index 0000000000..b9c3456b03 --- /dev/null +++ b/test/pom.xml @@ -0,0 +1,147 @@ + + + 4.0.0 + + com.vaadin + vaadin-root + 7.7-SNAPSHOT + + vaadin-test + vaadin-test + pom + + false + + + + + vaadin-addons + http://maven.vaadin.com/vaadin-addons + + + + + + + + + com.vaadin + vaadin-server + ${project.version} + + + com.vaadin + vaadin-themes + ${project.version} + + + + + javax.servlet + javax.servlet-api + 3.0.1 + provided + + + + + + junit + junit + 4.11 + test + + + org.hamcrest + hamcrest-all + 1.3 + test + + + com.vaadin + vaadin-testbench + 4.0.3 + test + + + + + widget-set-testutil + default-widget-set + own-widget-set + addon-using-own-widget-set + addon-using-no-defined-widget-set + addon-using-init-param-widget-set + space in directory + vaadinservletconfiguration-widget-set + + + + + + org.eclipse.jetty + jetty-maven-plugin + ${jetty.version} + + -1 + 8081 + 5 + foo + + + + + start-jetty + pre-integration-test + + start + + + + stop-jetty + post-integration-test + + stop + + + + + + com.github.klieber + phantomjs-maven-plugin + + + + install + + + ${phantomjs.version} + + + + + + + maven-surefire-plugin + + + maven-failsafe-plugin + + + + integration-test + verify + + + + + + ${phantomjs.binary} + + + + + + diff --git a/test/space in directory/pom.xml b/test/space in directory/pom.xml new file mode 100644 index 0000000000..7876f839ab --- /dev/null +++ b/test/space in directory/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + + com.vaadin + vaadin-test + 7.7-SNAPSHOT + + vaadin-test-space-in-directory + war + + + com.vaadin + vaadin-test-widget-set-testutil + ${project.version} + + + com.vaadin + vaadin-test-widget-set-testutil + ${project.version} + test-jar + test + + + + + + com.vaadin + vaadin-maven-plugin + + + + resources + update-widgetset + compile + + + + + + + + diff --git a/test/space in directory/src/main/java/com/vaadin/test/spaceindirectory/SpaceInDirectoryUI.java b/test/space in directory/src/main/java/com/vaadin/test/spaceindirectory/SpaceInDirectoryUI.java new file mode 100644 index 0000000000..99155197df --- /dev/null +++ b/test/space in directory/src/main/java/com/vaadin/test/spaceindirectory/SpaceInDirectoryUI.java @@ -0,0 +1,17 @@ +package com.vaadin.test.spaceindirectory; + +import javax.servlet.annotation.WebServlet; + +import com.vaadin.annotations.VaadinServletConfiguration; +import com.vaadin.annotations.Widgetset; +import com.vaadin.server.VaadinServlet; +import com.vaadin.test.widgetset.AbstractTestWidgetSetUI; + +@Widgetset("com.vaadin.test.spaceindirectory.SpaceInDirectory") +public class SpaceInDirectoryUI extends AbstractTestWidgetSetUI { + + @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true) + @VaadinServletConfiguration(ui = SpaceInDirectoryUI.class, productionMode = false) + public static class MyUIServlet extends VaadinServlet { + } +} diff --git a/test/space in directory/src/main/resources/com/vaadin/test/spaceindirectory/SpaceInDirectory.gwt.xml b/test/space in directory/src/main/resources/com/vaadin/test/spaceindirectory/SpaceInDirectory.gwt.xml new file mode 100644 index 0000000000..b9d1309108 --- /dev/null +++ b/test/space in directory/src/main/resources/com/vaadin/test/spaceindirectory/SpaceInDirectory.gwt.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/test/space in directory/src/test/java/com/vaadin/test/spaceindirectory/SpaceInDirectoryIT.java b/test/space in directory/src/test/java/com/vaadin/test/spaceindirectory/SpaceInDirectoryIT.java new file mode 100644 index 0000000000..f243a6f4a8 --- /dev/null +++ b/test/space in directory/src/test/java/com/vaadin/test/spaceindirectory/SpaceInDirectoryIT.java @@ -0,0 +1,15 @@ +package com.vaadin.test.spaceindirectory; + +import org.junit.Test; + +import com.vaadin.test.defaultwidgetset.AbstractWidgetSetIT; + +public class SpaceInDirectoryIT extends AbstractWidgetSetIT { + + @Test + public void appStartsUserCanInteract() { + testAppStartsUserCanInteract( + "com.vaadin.test.spaceindirectory.SpaceInDirectory"); + + } +} diff --git a/test/vaadinservletconfiguration-widget-set/pom.xml b/test/vaadinservletconfiguration-widget-set/pom.xml new file mode 100644 index 0000000000..09533d60da --- /dev/null +++ b/test/vaadinservletconfiguration-widget-set/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + com.vaadin + vaadin-test + 7.7-SNAPSHOT + + vaadin-test-vaadinservletconfiguration-widget-set + war + + + + com.vaadin + vaadin-test-widget-set-testutil + ${project.version} + + + com.vaadin + vaadin-test-widget-set-testutil + ${project.version} + test-jar + test + + + + + + com.vaadin + vaadin-maven-plugin + + + + resources + update-widgetset + compile + + + + + + + + diff --git a/test/vaadinservletconfiguration-widget-set/src/main/java/com/vaadin/test/vaadinservletconfigurationwidgetset/VaadinServletConfigurationWidgetSetUI.java b/test/vaadinservletconfiguration-widget-set/src/main/java/com/vaadin/test/vaadinservletconfigurationwidgetset/VaadinServletConfigurationWidgetSetUI.java new file mode 100644 index 0000000000..e1be31a3a6 --- /dev/null +++ b/test/vaadinservletconfiguration-widget-set/src/main/java/com/vaadin/test/vaadinservletconfigurationwidgetset/VaadinServletConfigurationWidgetSetUI.java @@ -0,0 +1,16 @@ +package com.vaadin.test.vaadinservletconfigurationwidgetset; + +import javax.servlet.annotation.WebServlet; + +import com.vaadin.annotations.VaadinServletConfiguration; +import com.vaadin.annotations.Widgetset; +import com.vaadin.server.VaadinServlet; +import com.vaadin.test.widgetset.AbstractTestWidgetSetUI; + +public class VaadinServletConfigurationWidgetSetUI extends AbstractTestWidgetSetUI { + + @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true) + @VaadinServletConfiguration(ui = VaadinServletConfigurationWidgetSetUI.class, productionMode = false, widgetset="com.vaadin.test.vaadinservletconfigurationwidgetset.VaadinServletConfigurationWidgetSet") + public static class MyUIServlet extends VaadinServlet { + } +} diff --git a/test/vaadinservletconfiguration-widget-set/src/main/resources/com/vaadin/test/vaadinservletconfigurationwidgetset/VaadinServletConfigurationWidgetSet.gwt.xml b/test/vaadinservletconfiguration-widget-set/src/main/resources/com/vaadin/test/vaadinservletconfigurationwidgetset/VaadinServletConfigurationWidgetSet.gwt.xml new file mode 100644 index 0000000000..b9d1309108 --- /dev/null +++ b/test/vaadinservletconfiguration-widget-set/src/main/resources/com/vaadin/test/vaadinservletconfigurationwidgetset/VaadinServletConfigurationWidgetSet.gwt.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/test/vaadinservletconfiguration-widget-set/src/test/java/com/vaadin/test/vaadinservletconfigurationwidgetset/VaadinServletConfigurationWidgetSetIT.java b/test/vaadinservletconfiguration-widget-set/src/test/java/com/vaadin/test/vaadinservletconfigurationwidgetset/VaadinServletConfigurationWidgetSetIT.java new file mode 100644 index 0000000000..c8809dc564 --- /dev/null +++ b/test/vaadinservletconfiguration-widget-set/src/test/java/com/vaadin/test/vaadinservletconfigurationwidgetset/VaadinServletConfigurationWidgetSetIT.java @@ -0,0 +1,14 @@ +package com.vaadin.test.vaadinservletconfigurationwidgetset; + +import org.junit.Test; + +import com.vaadin.test.defaultwidgetset.AbstractWidgetSetIT; + +public class VaadinServletConfigurationWidgetSetIT extends AbstractWidgetSetIT { + + @Test + public void appStartsUserCanInteract() { + testAppStartsUserCanInteract( + "com.vaadin.test.vaadinservletconfigurationwidgetset.VaadinServletConfigurationWidgetSet"); + } +} diff --git a/test/widget-set-testutil/pom.xml b/test/widget-set-testutil/pom.xml new file mode 100644 index 0000000000..86fa35cfca --- /dev/null +++ b/test/widget-set-testutil/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + com.vaadin + vaadin-test + 7.7-SNAPSHOT + + vaadin-test-widget-set-testutil + jar + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + + + + + diff --git a/test/widget-set-testutil/src/main/java/com/vaadin/test/widgetset/AbstractTestWidgetSetUI.java b/test/widget-set-testutil/src/main/java/com/vaadin/test/widgetset/AbstractTestWidgetSetUI.java new file mode 100644 index 0000000000..7886d5dd25 --- /dev/null +++ b/test/widget-set-testutil/src/main/java/com/vaadin/test/widgetset/AbstractTestWidgetSetUI.java @@ -0,0 +1,39 @@ +package com.vaadin.test.widgetset; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Label; +import com.vaadin.ui.TextField; +import com.vaadin.ui.UI; +import com.vaadin.ui.VerticalLayout; + +public abstract class AbstractTestWidgetSetUI extends UI { + + @Override + protected void init(VaadinRequest vaadinRequest) { + final VerticalLayout layout = new VerticalLayout(); + final Label widgetsetInfo = new Label(); + widgetsetInfo.setId("widgetsetinfo"); + final TextField name = new TextField(); + name.setCaption("Type your name here:"); + + Button button = new Button("Click Me"); + button.addClickListener(new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent clickEvent) { + layout.addComponent( + new Label("Thanks " + name.getValue() + ", it works!")); + } + }); + + getPage().getJavaScript().execute( + "widgetsetinfo.innerText=document.querySelector('iframe').id;"); + layout.addComponents(widgetsetInfo, name, button); + layout.setMargin(true); + layout.setSpacing(true); + + setContent(layout); + } + +} 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 new file mode 100644 index 0000000000..d29828158b --- /dev/null +++ b/test/widget-set-testutil/src/test/java/com/vaadin/test/defaultwidgetset/AbstractWidgetSetIT.java @@ -0,0 +1,59 @@ +package com.vaadin.test.defaultwidgetset; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.phantomjs.PhantomJSDriver; + +import com.vaadin.testbench.ScreenshotOnFailureRule; +import com.vaadin.testbench.TestBenchTestCase; +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.LabelElement; +import com.vaadin.testbench.elements.TextFieldElement; + +public abstract class AbstractWidgetSetIT extends TestBenchTestCase { + + @Rule + public ScreenshotOnFailureRule rule = new ScreenshotOnFailureRule(this, + true); + + @Before + public void setup() { + // Screenshot rule tears down the driver + setDriver(new PhantomJSDriver()); + } + + protected void testAppStartsUserCanInteract(String expectedWidgetSet) { + getDriver().get("http://localhost:8080"); + + TextFieldElement nameInput = $(TextFieldElement.class).first(); + nameInput.setValue("John DÃ¥e"); + + $(ButtonElement.class).first().click(); + + Assert.assertEquals("Label shown", 2, + $(LabelElement.class).all().size()); + + Assert.assertEquals("Thanks John DÃ¥e, it works!", + $(LabelElement.class).get(1).getText()); + + Assert.assertEquals(expectedWidgetSet, + findElement(By.id("widgetsetinfo")).getText()); + + } + + protected void assertNoUnknownComponentShown() { + Assert.assertEquals(0, + findElements(By.className("vaadin-unknown-caption")).size()); + } + + protected void assertUnknownComponentShown(String componentClass) { + WebElement unknownComponentCaption = findElement( + By.className("vaadin-unknown-caption")); + Assert.assertTrue(unknownComponentCaption.getText().contains( + "does not contain implementation for " + componentClass)); + } + +} diff --git a/uitest/pom.xml b/uitest/pom.xml index cffa431dca..71ba0592e5 100644 --- a/uitest/pom.xml +++ b/uitest/pom.xml @@ -11,7 +11,6 @@ vaadin-uitest war - 9.3.9.v20160517 true -- 2.39.5