diff options
Diffstat (limited to 'test')
28 files changed, 858 insertions, 0 deletions
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..79939e6b1b --- /dev/null +++ b/test/addon-using-init-param-widget-set/pom.xml @@ -0,0 +1,58 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test</artifactId> + <version>8.0-SNAPSHOT</version> + </parent> + <artifactId>vaadin-test-addon-using-init-param-widget-set</artifactId> + <packaging>war</packaging> + + <dependencies> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-widget-set-testutil</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-widget-set-testutil</artifactId> + <version>${project.version}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + <!-- Included to ensure AppWidgetset is an option --> + <dependency> + <groupId>com.vaadin.addon</groupId> + <artifactId>vaadin-context-menu</artifactId> + <version>0.7.4</version> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-client-compiled</artifactId> + <version>${project.version}</version> + </dependency> + + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>resources</goal> + <goal>update-widgetset</goal> + <goal>compile</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project>
\ No newline at end of file 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..41a240e006 --- /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 { + } +}
\ No newline at end of file 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..42333fb2c7 --- /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"); + } + +}
\ No newline at end of file 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..97178f94f8 --- /dev/null +++ b/test/addon-using-no-defined-widget-set/pom.xml @@ -0,0 +1,52 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test</artifactId> + <version>8.0-SNAPSHOT</version> + </parent> + <artifactId>vaadin-test-addon-using-no-defined-widget-set</artifactId> + <packaging>war</packaging> + + <dependencies> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-widget-set-testutil</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-widget-set-testutil</artifactId> + <version>${project.version}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>com.vaadin.addon</groupId> + <artifactId>vaadin-context-menu</artifactId> + <version>0.7.4</version> + </dependency> + + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>resources</goal> + <goal>update-widgetset</goal> + <goal>compile</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project>
\ No newline at end of file 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..1893bb46e1 --- /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 { + } +}
\ No newline at end of file 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..93dc5f1e77 --- /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(); + } +}
\ No newline at end of file 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..fc52e47f4f --- /dev/null +++ b/test/addon-using-own-widget-set/pom.xml @@ -0,0 +1,52 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test</artifactId> + <version>8.0-SNAPSHOT</version> + </parent> + <artifactId>vaadin-test-addon-using-own-widget-set</artifactId> + <packaging>war</packaging> + + <dependencies> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-widget-set-testutil</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-widget-set-testutil</artifactId> + <version>${project.version}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>com.vaadin.addon</groupId> + <artifactId>vaadin-context-menu</artifactId> + <version>0.7.4</version> + </dependency> + + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>resources</goal> + <goal>update-widgetset</goal> + <goal>compile</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project>
\ No newline at end of file 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..15efad2295 --- /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 { + } +}
\ No newline at end of file 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..26be42e65b --- /dev/null +++ b/test/addon-using-own-widget-set/src/main/resources/com/vaadin/test/addonusingownwidgetset/AddonUsingOwnWidgetSet.gwt.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd"> +<module> + <inherits name="com.vaadin.DefaultWidgetSet" /> + + <inherits name="com.vaadin.addon.contextmenu.WidgetSet" /> +</module> 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..c22dbf8eb9 --- /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(); + } +}
\ No newline at end of file diff --git a/test/default-widget-set/pom.xml b/test/default-widget-set/pom.xml new file mode 100644 index 0000000000..68ee894911 --- /dev/null +++ b/test/default-widget-set/pom.xml @@ -0,0 +1,34 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test</artifactId> + <version>8.0-SNAPSHOT</version> + </parent> + <artifactId>vaadin-test-default-widget-set</artifactId> + <packaging>war</packaging> + + <dependencies> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-widget-set-testutil</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-widget-set-testutil</artifactId> + <version>${project.version}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-client-compiled</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> + + +</project>
\ No newline at end of file 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..fb58389ece --- /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 { + } +}
\ No newline at end of file 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..8fda5812d0 --- /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"); + } +}
\ No newline at end of file diff --git a/test/own-widget-set/pom.xml b/test/own-widget-set/pom.xml new file mode 100644 index 0000000000..6ce65c868f --- /dev/null +++ b/test/own-widget-set/pom.xml @@ -0,0 +1,45 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test</artifactId> + <version>8.0-SNAPSHOT</version> + </parent> + <artifactId>vaadin-test-own-widget-set</artifactId> + <packaging>war</packaging> + + <dependencies> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-widget-set-testutil</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-widget-set-testutil</artifactId> + <version>${project.version}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>resources</goal> + <goal>update-widgetset</goal> + <goal>compile</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project>
\ No newline at end of file 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..8801dacbae --- /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 { + } +}
\ No newline at end of file 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..7501fbabbb --- /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"); + } +}
\ No newline at end of file diff --git a/test/pom.xml b/test/pom.xml new file mode 100644 index 0000000000..b1ee2fb074 --- /dev/null +++ b/test/pom.xml @@ -0,0 +1,143 @@ +<?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-root</artifactId> + <version>8.0-SNAPSHOT</version> + </parent> + <artifactId>vaadin-test</artifactId> + <name>vaadin-test</name> + <packaging>pom</packaging> + <properties> + <failOnMissingWebXml>false</failOnMissingWebXml> + </properties> + + <repositories> + <repository> + <id>vaadin-addons</id> + <url>http://maven.vaadin.com/vaadin-addons</url> + </repository> + </repositories> + + <dependencies> + + <!-- API DEPENDENCIES --> + <!-- Project modules --> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-server</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-themes</artifactId> + <version>${project.version}</version> + </dependency> + + <!-- Servlet 3.0 API --> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>javax.servlet-api</artifactId> + <scope>provided</scope> + </dependency> + + + <!-- Testing --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-all</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-testbench</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + + <modules> + <module>widget-set-testutil</module> + <module>default-widget-set</module> + <module>own-widget-set</module> + <module>addon-using-own-widget-set</module> + <module>addon-using-no-defined-widget-set</module> + <module>addon-using-init-param-widget-set</module> + <module>space in directory</module> + <module>vaadinservletconfiguration-widget-set</module> + </modules> + + <build> + <plugins> + <plugin> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-maven-plugin</artifactId> + <version>${jetty.version}</version> + <configuration> + <scanIntervalSeconds>-1</scanIntervalSeconds> + <stopPort>8081</stopPort> + <stopWait>5</stopWait> + <stopKey>foo</stopKey> + </configuration> + <executions> + <!-- start and stop jetty (running our app) when running + integration tests --> + <execution> + <id>start-jetty</id> + <phase>pre-integration-test</phase> + <goals> + <goal>start</goal> + </goals> + </execution> + <execution> + <id>stop-jetty</id> + <phase>post-integration-test</phase> + <goals> + <goal>stop</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>com.github.klieber</groupId> + <artifactId>phantomjs-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>install</goal> + </goals> + <configuration> + <version>${phantomjs.version}</version> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + </plugin> + <plugin> + <artifactId>maven-failsafe-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>integration-test</goal> + <goal>verify</goal> + </goals> + </execution> + </executions> + <configuration> + <systemPropertyVariables> + <phantomjs.binary.path>${phantomjs.binary}</phantomjs.binary.path> + </systemPropertyVariables> + </configuration> + </plugin> + </plugins> + </build> +</project>
\ No newline at end of file diff --git a/test/space in directory/pom.xml b/test/space in directory/pom.xml new file mode 100644 index 0000000000..65c3574ead --- /dev/null +++ b/test/space in directory/pom.xml @@ -0,0 +1,44 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test</artifactId> + <version>8.0-SNAPSHOT</version> + </parent> + <artifactId>vaadin-test-space-in-directory</artifactId> + <packaging>war</packaging> + <dependencies> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-widget-set-testutil</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-widget-set-testutil</artifactId> + <version>${project.version}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>resources</goal> + <goal>update-widgetset</goal> + <goal>compile</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project>
\ No newline at end of file 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..ccf023c871 --- /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 { + } +}
\ No newline at end of file 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..ad42d087ce --- /dev/null +++ b/test/space in directory/src/main/resources/com/vaadin/test/spaceindirectory/SpaceInDirectory.gwt.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd"> +<module> + <inherits name="com.vaadin.DefaultWidgetSet" /> +</module>
\ No newline at end of file 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..f8fbfb6f8a --- /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"); + + } +}
\ No newline at end of file diff --git a/test/vaadinservletconfiguration-widget-set/pom.xml b/test/vaadinservletconfiguration-widget-set/pom.xml new file mode 100644 index 0000000000..96a9a94d7f --- /dev/null +++ b/test/vaadinservletconfiguration-widget-set/pom.xml @@ -0,0 +1,45 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test</artifactId> + <version>8.0-SNAPSHOT</version> + </parent> + <artifactId>vaadin-test-vaadinservletconfiguration-widget-set</artifactId> + <packaging>war</packaging> + + <dependencies> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-widget-set-testutil</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test-widget-set-testutil</artifactId> + <version>${project.version}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>resources</goal> + <goal>update-widgetset</goal> + <goal>compile</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project>
\ No newline at end of file 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..e607df30c2 --- /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.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 { + } +}
\ No newline at end of file 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..ad42d087ce --- /dev/null +++ b/test/vaadinservletconfiguration-widget-set/src/main/resources/com/vaadin/test/vaadinservletconfigurationwidgetset/VaadinServletConfigurationWidgetSet.gwt.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd"> +<module> + <inherits name="com.vaadin.DefaultWidgetSet" /> +</module>
\ No newline at end of file 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..6727cef4c7 --- /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"); + } +}
\ No newline at end of file diff --git a/test/widget-set-testutil/pom.xml b/test/widget-set-testutil/pom.xml new file mode 100644 index 0000000000..3dcc6db865 --- /dev/null +++ b/test/widget-set-testutil/pom.xml @@ -0,0 +1,32 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-test</artifactId> + <version>8.0-SNAPSHOT</version> + </parent> + <artifactId>vaadin-test-widget-set-testutil</artifactId> + <packaging>jar</packaging> + + <dependencies> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>test-jar</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project>
\ No newline at end of file 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..c03645517a --- /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); + } + +}
\ No newline at end of file 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..e84296819c --- /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)); + } + +}
\ No newline at end of file |