diff options
author | Henri Sara <hesara@vaadin.com> | 2014-05-16 11:41:42 +0300 |
---|---|---|
committer | Henri Sara <hesara@vaadin.com> | 2014-05-16 13:03:09 +0300 |
commit | b4180f2388a6ec97c422097f16da617114aba590 (patch) | |
tree | 86d73cb261f89d7360d5810e2986a6e78e066374 /uitest | |
parent | e65231e6028892bd6847777c5bad982b73278b14 (diff) | |
parent | 0f74fdff68cef4eac27913bb4fd0943ff39ca604 (diff) | |
download | vaadin-framework-7.3.0.alpha2.tar.gz vaadin-framework-7.3.0.alpha2.zip |
Merge master into valo7.3.0.alpha2
This change does not include all release notes updates
from master.
Change-Id: I209dc06d03d4541ac33746d1161630f0ca8ae5d9
Diffstat (limited to 'uitest')
619 files changed, 5557 insertions, 1598 deletions
diff --git a/uitest/integration_tests.xml b/uitest/integration_tests.xml index 77c5a94e26..c0d73580bb 100644 --- a/uitest/integration_tests.xml +++ b/uitest/integration_tests.xml @@ -114,7 +114,7 @@ <property name="server.report.dir" location="${report.dir}/integration-test-tb3/${server-name}" /> <!-- The junit task does not create the report dir... --> <mkdir dir="${server.report.dir}" /> - + <junit showoutput="no" printsummary="no" fork="yes"> <formatter type="xml" /> <classpath refid="classpath.tb3" /> @@ -123,6 +123,7 @@ <jvmarg value="-Ddeployment.url=${deployment.url}" /> <jvmarg value="-Dserver-name=${server-name}" /> <jvmarg value="-Djava.awt.headless=true" /> + <jvmarg value="-Ddemo.war=${demo.war}" /> <test name="${junit.test.suite}" todir="${server.report.dir}" /> </junit> </target> @@ -343,6 +344,20 @@ </antcall> </target> + <target name="integration-test-websphereportal8"> + <concat>##teamcity[testStarted name='websphereportal8' flowId='websphereportal8']</concat> + <antcall target="run-tb3-test" inheritall="true"> + <param name="junit.test.suite" value="com.vaadin.tests.integration.WebSpherePortalIntegrationTest" /> + <param name="server-name" value="websphereportal8" /> + + <!-- Fill out dummy values for params required by run-tb3-test target --> + <param name="test.integration.server" value="" /> + <param name="test.integration.user" value="" /> + <param name="test.integration.antfile" value="" /> + </antcall> + <concat>##teamcity[testFinished name='websphereportal8' flowId='websphereportal8']"</concat> + </target> + <target name="integration-test-weblogic10"> <antcall target="run-generic-integration-test"> <param name="startDelay" value="600" /> @@ -375,7 +390,7 @@ <antcall target="integration-test-test-GAE" /> </target> - <!-- Upload demo, clean error screenshots and test deployment on all + <!-- Upload demo, clean error screenshots and test deployment on all servers --> <target name="integration-test-all" unless="tests.integration.skip"> <property name="passphrase" value="${passphrase}" /> @@ -387,7 +402,7 @@ <parallel> <antcontrib:trycatch property="tried"> <try> - <!-- Still running GAE test from the old server which + <!-- Still running GAE test from the old server which requires its own lock --> <echo message="Getting lock" /> @@ -439,6 +454,7 @@ <antcall target="integration-test-tomcat8" /> <antcall target="integration-test-tomcat7apacheproxy" /> <antcall target="integration-test-websphere8" /> + <antcall target="integration-test-websphereportal8" /> </parallel> </target> @@ -468,11 +484,11 @@ </fileset> </scp> - <!-- trycatch probably not needed any more as it just fails with + <!-- trycatch probably not needed any more as it just fails with the original message and doesn't do anything in the finally block --> <antcontrib:trycatch property="error_message"> <try> - <!-- timeout in one hour (remote end should timeout in 55 + <!-- timeout in one hour (remote end should timeout in 55 minutes) --> <sshexec host="${target-host}" outputproperty="lock-output" timeout="3600000" username="${user}" keyfile="${sshkey.file}" trust="yes" command="chmod +x *.sh; ant -f deploy.xml get-lock" /> <antcall target="echo-prefix"> @@ -515,7 +531,7 @@ </antcontrib:else> </antcontrib:if> - <!-- Run theme tests in all browsers if there's a property + <!-- Run theme tests in all browsers if there's a property with the test files --> <antcontrib:if> <isset property="testfiles-theme" /> @@ -565,7 +581,7 @@ <target name="teamcity-escape"> <property name="returnTo" value="return" /> - <!-- Should also perform other escaping (\u0085, \u2028 and \u2029) + <!-- Should also perform other escaping (\u0085, \u2028 and \u2029) - see http://confluence.jetbrains.net/display/TCD65/Build+Script+Interaction+with+TeamCity --> <!-- Immutable properties -> needs to create a new one every time --> <antcontrib:propertyregex property="details-escaped1" input="${message}" regexp="['|\[\]]" replace="|\0" global="true" defaultValue="${message}" /> diff --git a/uitest/ivy.xml b/uitest/ivy.xml index 170ffd21cf..020543c53f 100644 --- a/uitest/ivy.xml +++ b/uitest/ivy.xml @@ -57,7 +57,9 @@ <!-- For compiling TestingWidgetSet --> <dependency org="com.vaadin" name="vaadin-client-compiler" - rev="${vaadin.version}" conf="build-provided-> build"></dependency> + rev="${vaadin.version}" conf="build-provided-> build"> + <exclude type="pom" /> + </dependency> <!-- Servlet 3.0 API --> <dependency org="javax.servlet" name="javax.servlet-api" @@ -81,6 +83,8 @@ <dependency org="junit" name="junit" rev="4.11" conf="build,ide -> default" /> + <dependency org="org.hamcrest" name="hamcrest-all" rev="1.3" + conf="build,ide->default" /> <dependency org="com.jcraft" name="jsch" rev="0.1.50" conf="ide, build->default" /> <dependency org="commons-codec" name="commons-codec" @@ -91,7 +95,7 @@ <dependency org="org.hsqldb" name="hsqldb" rev="2.2.6" conf="build,ide -> default" /> <dependency org="com.vaadin" name="vaadin-testbench" - rev="3.1.3" conf="build-provided,ide -> default" /> + rev="4.0.0.alpha1" conf="build-provided,ide -> default" /> <!-- This should be removed once tests have been updated to use lang3 --> <dependency org="commons-lang" name="commons-lang" rev="2.6" conf="build,ide -> default" /> diff --git a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java index 47d3a19fde..a89ec4e587 100644 --- a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java +++ b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/launcher/DevelopmentServerLauncher.java b/uitest/src/com/vaadin/launcher/DevelopmentServerLauncher.java index ecaf4ded32..d94518ca9c 100644 --- a/uitest/src/com/vaadin/launcher/DevelopmentServerLauncher.java +++ b/uitest/src/com/vaadin/launcher/DevelopmentServerLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -17,15 +17,20 @@ package com.vaadin.launcher; import java.io.File; +import java.io.FilenameFilter; import java.io.IOException; import java.io.OutputStream; import java.net.InetAddress; import java.net.ServerSocket; import java.net.Socket; +import java.net.URL; +import java.net.URLClassLoader; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Calendar; import java.util.EnumSet; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -43,6 +48,8 @@ import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.nio.SelectChannelConnector; import org.eclipse.jetty.server.ssl.SslSocketConnector; +import org.eclipse.jetty.util.Scanner; +import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.webapp.WebAppContext; import com.vaadin.launcher.util.BrowserLauncher; @@ -70,6 +77,7 @@ public class DevelopmentServerLauncher { assertAssertionsEnabled(); + // // Pass-through of arguments for Jetty final Map<String, String> serverArgs = parseArguments(args); if (!serverArgs.containsKey("shutdownPort")) { @@ -160,19 +168,18 @@ public class DevelopmentServerLauncher { if (serverArgs.containsKey("withssl")) { final SslSocketConnector sslConnector = new SslSocketConnector(); sslConnector.setPort(8444); - sslConnector.setTruststore(KEYSTORE); - sslConnector.setTrustPassword("password"); - sslConnector.setKeystore(KEYSTORE); - sslConnector.setKeyPassword("password"); - sslConnector.setPassword("password"); + SslContextFactory sslFact = sslConnector.getSslContextFactory(); + sslFact.setTrustStore(KEYSTORE); + sslFact.setTrustStorePassword("password"); + sslFact.setKeyStorePath(KEYSTORE); + sslFact.setKeyManagerPassword("password"); + sslFact.setKeyStorePassword("password"); server.setConnectors(new Connector[] { connector, sslConnector }); } else { server.setConnectors(new Connector[] { connector }); } final WebAppContext webappcontext = new WebAppContext(); - String path = DevelopmentServerLauncher.class.getPackage().getName() - .replace(".", File.separator); webappcontext.setContextPath(serverArgs.get("context")); webappcontext.setWar(serverArgs.get("webroot")); server.setHandler(webappcontext); @@ -198,6 +205,73 @@ public class DevelopmentServerLauncher { } } + // --autoreload=all --autoreload=WebContent/classes,other/path + // --scaninterval=1 + // Configure Jetty to auto-reload when a any class is compiled in + // any folder included in the list of folders passed as arguments + // or in the entire classpath if the keyworkd all is passed. + if (serverArgs.containsKey("autoreload")) { + int interval = 1; + if (serverArgs.containsKey("scaninterval")) { + interval = Integer.parseInt(serverArgs.get("scaninterval")); + } + + List<File> classFolders = new ArrayList<File>(); + String[] paths = serverArgs.get("autoreload").split(","); + if (paths.length == 1 && "all".equals(paths[0])) { + ClassLoader cl = server.getClass().getClassLoader(); + for (URL u : ((URLClassLoader) cl).getURLs()) { + File f = new File(u.getPath()); + if (f.isDirectory()) { + classFolders.add(f); + } + } + } else { + for (String p : paths) { + File f = new File(p); + if (f.isDirectory()) { + classFolders.add(f); + } + } + } + if (!classFolders.isEmpty()) { + System.out + .println("Enabling context auto-reload.\n Scan interval: " + + interval + " secs.\n Scanned folders: "); + for (File f : classFolders) { + System.out.println(" " + f.getAbsolutePath()); + webappcontext.setExtraClasspath(f.getAbsolutePath()); + } + System.out.println(""); + + Scanner scanner = new Scanner(); + scanner.setScanInterval(interval); + + scanner.setRecursive(true); + scanner.addListener(new Scanner.BulkListener() { + @Override + public void filesChanged(List<String> filenames) + throws Exception { + webappcontext.stop(); + server.stop(); + webappcontext.start(); + server.start(); + } + }); + scanner.setReportExistingFilesOnStartup(false); + scanner.setFilenameFilter(new FilenameFilter() { + @Override + public boolean accept(File folder, String name) { + return name.endsWith(".class"); + } + }); + + scanner.setScanDirs(classFolders); + scanner.start(); + server.getContainer().addBean(scanner); + } + } + try { server.start(); @@ -380,7 +454,6 @@ public class DevelopmentServerLauncher { public void destroy() { // TODO Auto-generated method stub } - } private static void dumpThreadStacks() { @@ -395,7 +468,6 @@ public class DevelopmentServerLauncher { } System.out.println(); } - } } diff --git a/uitest/src/com/vaadin/launcher/util/BrowserLauncher.java b/uitest/src/com/vaadin/launcher/util/BrowserLauncher.java index 101655501e..04c6a46e64 100644 --- a/uitest/src/com/vaadin/launcher/util/BrowserLauncher.java +++ b/uitest/src/com/vaadin/launcher/util/BrowserLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/CustomLayoutDemo.java b/uitest/src/com/vaadin/tests/CustomLayoutDemo.java index 7474ec2f8a..7b9f3d9926 100644 --- a/uitest/src/com/vaadin/tests/CustomLayoutDemo.java +++ b/uitest/src/com/vaadin/tests/CustomLayoutDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/LayoutDemo.java b/uitest/src/com/vaadin/tests/LayoutDemo.java index e7a2526174..c62a9ea51b 100644 --- a/uitest/src/com/vaadin/tests/LayoutDemo.java +++ b/uitest/src/com/vaadin/tests/LayoutDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/ModalWindow.java b/uitest/src/com/vaadin/tests/ModalWindow.java index 86e80d8c56..559fc5ca0e 100644 --- a/uitest/src/com/vaadin/tests/ModalWindow.java +++ b/uitest/src/com/vaadin/tests/ModalWindow.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/NativeWindowing.java b/uitest/src/com/vaadin/tests/NativeWindowing.java index 3be6693c2d..b646655c35 100644 --- a/uitest/src/com/vaadin/tests/NativeWindowing.java +++ b/uitest/src/com/vaadin/tests/NativeWindowing.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/OrderedLayoutSwapComponents.java b/uitest/src/com/vaadin/tests/OrderedLayoutSwapComponents.java index 5d41e413de..1474afe28c 100644 --- a/uitest/src/com/vaadin/tests/OrderedLayoutSwapComponents.java +++ b/uitest/src/com/vaadin/tests/OrderedLayoutSwapComponents.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/Parameters.java b/uitest/src/com/vaadin/tests/Parameters.java index 6f3b15f386..7e71c4dc76 100644 --- a/uitest/src/com/vaadin/tests/Parameters.java +++ b/uitest/src/com/vaadin/tests/Parameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/PerformanceTestBasicComponentRendering.java b/uitest/src/com/vaadin/tests/PerformanceTestBasicComponentRendering.java index ce92e68a70..c58c73753f 100644 --- a/uitest/src/com/vaadin/tests/PerformanceTestBasicComponentRendering.java +++ b/uitest/src/com/vaadin/tests/PerformanceTestBasicComponentRendering.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java b/uitest/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java index 236b369897..08f8bc4d7a 100644 --- a/uitest/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java +++ b/uitest/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/PerformanceTestSubTreeCaching.java b/uitest/src/com/vaadin/tests/PerformanceTestSubTreeCaching.java index 7616d2f017..a6f112cff0 100644 --- a/uitest/src/com/vaadin/tests/PerformanceTestSubTreeCaching.java +++ b/uitest/src/com/vaadin/tests/PerformanceTestSubTreeCaching.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/RandomLayoutStress.java b/uitest/src/com/vaadin/tests/RandomLayoutStress.java index 37f65054de..e9f04a4c85 100644 --- a/uitest/src/com/vaadin/tests/RandomLayoutStress.java +++ b/uitest/src/com/vaadin/tests/RandomLayoutStress.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/StressComponentsInTable.java b/uitest/src/com/vaadin/tests/StressComponentsInTable.java index 5619273599..84c9d70299 100644 --- a/uitest/src/com/vaadin/tests/StressComponentsInTable.java +++ b/uitest/src/com/vaadin/tests/StressComponentsInTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TableChangingDatasource.java b/uitest/src/com/vaadin/tests/TableChangingDatasource.java index ddc9b89632..162c850fb5 100644 --- a/uitest/src/com/vaadin/tests/TableChangingDatasource.java +++ b/uitest/src/com/vaadin/tests/TableChangingDatasource.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TableSelectTest.java b/uitest/src/com/vaadin/tests/TableSelectTest.java index 4583e40331..61c93d0eae 100644 --- a/uitest/src/com/vaadin/tests/TableSelectTest.java +++ b/uitest/src/com/vaadin/tests/TableSelectTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestBench.java b/uitest/src/com/vaadin/tests/TestBench.java index 0323899ee8..bd01fa2087 100644 --- a/uitest/src/com/vaadin/tests/TestBench.java +++ b/uitest/src/com/vaadin/tests/TestBench.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestCaptionWrapper.java b/uitest/src/com/vaadin/tests/TestCaptionWrapper.java index 67e6c3adc4..edd70ece4e 100644 --- a/uitest/src/com/vaadin/tests/TestCaptionWrapper.java +++ b/uitest/src/com/vaadin/tests/TestCaptionWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestDateField.java b/uitest/src/com/vaadin/tests/TestDateField.java index e09e874c6d..b5611b8246 100644 --- a/uitest/src/com/vaadin/tests/TestDateField.java +++ b/uitest/src/com/vaadin/tests/TestDateField.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestForAlignments.java b/uitest/src/com/vaadin/tests/TestForAlignments.java index dcc821b806..7927b7f0ee 100644 --- a/uitest/src/com/vaadin/tests/TestForAlignments.java +++ b/uitest/src/com/vaadin/tests/TestForAlignments.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java b/uitest/src/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java index 26d5e42134..d6c72ee8e9 100644 --- a/uitest/src/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java +++ b/uitest/src/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestForBasicApplicationLayout.java b/uitest/src/com/vaadin/tests/TestForBasicApplicationLayout.java index 918494fa12..705f2e1766 100644 --- a/uitest/src/com/vaadin/tests/TestForBasicApplicationLayout.java +++ b/uitest/src/com/vaadin/tests/TestForBasicApplicationLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestForChildComponentRendering.java b/uitest/src/com/vaadin/tests/TestForChildComponentRendering.java index c3f954a5ce..e07d00a04f 100644 --- a/uitest/src/com/vaadin/tests/TestForChildComponentRendering.java +++ b/uitest/src/com/vaadin/tests/TestForChildComponentRendering.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestForContainerFilterable.java b/uitest/src/com/vaadin/tests/TestForContainerFilterable.java index e00042a790..f5edc40c56 100644 --- a/uitest/src/com/vaadin/tests/TestForContainerFilterable.java +++ b/uitest/src/com/vaadin/tests/TestForContainerFilterable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java b/uitest/src/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java index 9d87ec432d..ba7d59fb2b 100644 --- a/uitest/src/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java +++ b/uitest/src/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestForMultipleStyleNames.java b/uitest/src/com/vaadin/tests/TestForMultipleStyleNames.java index 69d561cef3..a4f2dcd106 100644 --- a/uitest/src/com/vaadin/tests/TestForMultipleStyleNames.java +++ b/uitest/src/com/vaadin/tests/TestForMultipleStyleNames.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestForNativeWindowing.java b/uitest/src/com/vaadin/tests/TestForNativeWindowing.java index c60a234ba1..a9faeb8f38 100644 --- a/uitest/src/com/vaadin/tests/TestForNativeWindowing.java +++ b/uitest/src/com/vaadin/tests/TestForNativeWindowing.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestForPreconfiguredComponents.java b/uitest/src/com/vaadin/tests/TestForPreconfiguredComponents.java index 7fedaf1412..b8d1c17241 100644 --- a/uitest/src/com/vaadin/tests/TestForPreconfiguredComponents.java +++ b/uitest/src/com/vaadin/tests/TestForPreconfiguredComponents.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestForRichTextEditor.java b/uitest/src/com/vaadin/tests/TestForRichTextEditor.java index 44c59b3cdb..1963dfbf12 100644 --- a/uitest/src/com/vaadin/tests/TestForRichTextEditor.java +++ b/uitest/src/com/vaadin/tests/TestForRichTextEditor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestForStyledUpload.java b/uitest/src/com/vaadin/tests/TestForStyledUpload.java index 834da5e505..de79dba2f6 100644 --- a/uitest/src/com/vaadin/tests/TestForStyledUpload.java +++ b/uitest/src/com/vaadin/tests/TestForStyledUpload.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestForTabSheet.java b/uitest/src/com/vaadin/tests/TestForTabSheet.java index d180bd4be3..8d5fe71ed3 100644 --- a/uitest/src/com/vaadin/tests/TestForTabSheet.java +++ b/uitest/src/com/vaadin/tests/TestForTabSheet.java @@ -57,4 +57,4 @@ public class TestForTabSheet extends CustomComponent implements } } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java b/uitest/src/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java index b63804cc97..cfd7f58866 100644 --- a/uitest/src/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java +++ b/uitest/src/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestForTrees.java b/uitest/src/com/vaadin/tests/TestForTrees.java index f67ce4fe6b..67f7faf44e 100644 --- a/uitest/src/com/vaadin/tests/TestForTrees.java +++ b/uitest/src/com/vaadin/tests/TestForTrees.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestForUpload.java b/uitest/src/com/vaadin/tests/TestForUpload.java index 3c198ef4fd..0046457f30 100644 --- a/uitest/src/com/vaadin/tests/TestForUpload.java +++ b/uitest/src/com/vaadin/tests/TestForUpload.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestForWindowOpen.java b/uitest/src/com/vaadin/tests/TestForWindowOpen.java index 48d133aa91..5de80fd833 100644 --- a/uitest/src/com/vaadin/tests/TestForWindowOpen.java +++ b/uitest/src/com/vaadin/tests/TestForWindowOpen.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestForWindowing.java b/uitest/src/com/vaadin/tests/TestForWindowing.java index 986bef549a..02d1e21d5a 100644 --- a/uitest/src/com/vaadin/tests/TestForWindowing.java +++ b/uitest/src/com/vaadin/tests/TestForWindowing.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestIFrames.java b/uitest/src/com/vaadin/tests/TestIFrames.java index 6a08501095..244ea10dfa 100644 --- a/uitest/src/com/vaadin/tests/TestIFrames.java +++ b/uitest/src/com/vaadin/tests/TestIFrames.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java b/uitest/src/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java index a793883ad6..84ea616e3f 100644 --- a/uitest/src/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java +++ b/uitest/src/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestSetVisibleAndCaching.java b/uitest/src/com/vaadin/tests/TestSetVisibleAndCaching.java index ed04541da6..b8ade0d8b6 100644 --- a/uitest/src/com/vaadin/tests/TestSetVisibleAndCaching.java +++ b/uitest/src/com/vaadin/tests/TestSetVisibleAndCaching.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestSizeableIncomponents.java b/uitest/src/com/vaadin/tests/TestSizeableIncomponents.java index e4ce16506e..90b9088f76 100644 --- a/uitest/src/com/vaadin/tests/TestSizeableIncomponents.java +++ b/uitest/src/com/vaadin/tests/TestSizeableIncomponents.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TestSplitPanel.java b/uitest/src/com/vaadin/tests/TestSplitPanel.java index 574f49d82c..0266bcc108 100644 --- a/uitest/src/com/vaadin/tests/TestSplitPanel.java +++ b/uitest/src/com/vaadin/tests/TestSplitPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TreeFilesystem.java b/uitest/src/com/vaadin/tests/TreeFilesystem.java index 409cf882a7..238e7bf317 100644 --- a/uitest/src/com/vaadin/tests/TreeFilesystem.java +++ b/uitest/src/com/vaadin/tests/TreeFilesystem.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/TreeFilesystemContainer.java b/uitest/src/com/vaadin/tests/TreeFilesystemContainer.java index d42bfc0ed9..55e57a7d92 100644 --- a/uitest/src/com/vaadin/tests/TreeFilesystemContainer.java +++ b/uitest/src/com/vaadin/tests/TreeFilesystemContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java b/uitest/src/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java index 291e55a03f..833087029d 100644 --- a/uitest/src/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java +++ b/uitest/src/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/UsingObjectsInSelect.java b/uitest/src/com/vaadin/tests/UsingObjectsInSelect.java index f1cf3955e1..85da6d671f 100644 --- a/uitest/src/com/vaadin/tests/UsingObjectsInSelect.java +++ b/uitest/src/com/vaadin/tests/UsingObjectsInSelect.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/VerifyAssertionsEnabled.java b/uitest/src/com/vaadin/tests/VerifyAssertionsEnabled.java index aa35a793c7..84ea3a0def 100644 --- a/uitest/src/com/vaadin/tests/VerifyAssertionsEnabled.java +++ b/uitest/src/com/vaadin/tests/VerifyAssertionsEnabled.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java b/uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java index c2dc400d8b..53317bd581 100644 --- a/uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java +++ b/uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -47,6 +47,9 @@ public class VerifyBrowserVersionTest extends MultiBrowserTest { expectedUserAgent .put(Browser.CHROME.getDesiredCapabilities(), "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36"); + expectedUserAgent + .put(Browser.PHANTOMJS.getDesiredCapabilities(), + "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.7 Safari/534.34"); } @@ -58,4 +61,4 @@ public class VerifyBrowserVersionTest extends MultiBrowserTest { Assert.assertEquals("Touch device? No", vaadinElementById("touchDevice").getText()); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/VerifyJreVersion.java b/uitest/src/com/vaadin/tests/VerifyJreVersion.java index a41955f826..025a66f022 100644 --- a/uitest/src/com/vaadin/tests/VerifyJreVersion.java +++ b/uitest/src/com/vaadin/tests/VerifyJreVersion.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/VerifyJreVersionTest.java b/uitest/src/com/vaadin/tests/VerifyJreVersionTest.java index aba120ac0b..0203423787 100644 --- a/uitest/src/com/vaadin/tests/VerifyJreVersionTest.java +++ b/uitest/src/com/vaadin/tests/VerifyJreVersionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/actions/ActionsOnInvisibleComponentsTest.java b/uitest/src/com/vaadin/tests/actions/ActionsOnInvisibleComponentsTest.java index 1d08ee5ede..8dfcf52b75 100644 --- a/uitest/src/com/vaadin/tests/actions/ActionsOnInvisibleComponentsTest.java +++ b/uitest/src/com/vaadin/tests/actions/ActionsOnInvisibleComponentsTest.java @@ -4,26 +4,22 @@ import java.util.List; import org.junit.Assert; import org.junit.Test; -import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.remote.DesiredCapabilities; import com.vaadin.tests.tb3.MultiBrowserTest; public class ActionsOnInvisibleComponentsTest extends MultiBrowserTest { - private static final String LAST_INIT_LOG = "3. 'C' triggers a click on a visible and enabled button"; // This method should be removed once #12785 is fixed @Override public List<DesiredCapabilities> getBrowsersToTest() { List<DesiredCapabilities> browsers = super.getBrowsersToTest(); - // sendKeys does nothing on these browsers + // Send Keys does not function correctly on these browsers. + browsers.remove(Browser.CHROME.getDesiredCapabilities()); browsers.remove(Browser.FIREFOX.getDesiredCapabilities()); browsers.remove(Browser.IE8.getDesiredCapabilities()); - browsers.remove(Browser.OPERA.getDesiredCapabilities()); - - // Causes 'cannot focus element' - browsers.remove(Browser.CHROME.getDesiredCapabilities()); return browsers; } @@ -40,7 +36,6 @@ public class ActionsOnInvisibleComponentsTest extends MultiBrowserTest { } private void invokeShortcut(CharSequence key) { - WebElement shortcutTarget = vaadinElementById("test-root"); - shortcutTarget.sendKeys(key); + new Actions(getDriver()).sendKeys(key).perform(); } } diff --git a/uitest/src/com/vaadin/tests/annotations/TestCategory.java b/uitest/src/com/vaadin/tests/annotations/TestCategory.java index c48df2bf8c..5ba6cc3faa 100644 --- a/uitest/src/com/vaadin/tests/annotations/TestCategory.java +++ b/uitest/src/com/vaadin/tests/annotations/TestCategory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.java b/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.java index 154c84b4f5..8cb670c0fb 100644 --- a/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.java +++ b/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/application/ErrorInUnloadEvent.java b/uitest/src/com/vaadin/tests/application/ErrorInUnloadEvent.java index a5a7e3f274..a09c4c845a 100644 --- a/uitest/src/com/vaadin/tests/application/ErrorInUnloadEvent.java +++ b/uitest/src/com/vaadin/tests/application/ErrorInUnloadEvent.java @@ -103,4 +103,4 @@ public class ErrorInUnloadEvent extends AbstractTestCase { protected Integer getTicketNumber() { return 6316; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java index 6e31862f24..e66e8b9752 100644 --- a/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java +++ b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java @@ -39,4 +39,4 @@ public class RefreshStatePreserve extends AbstractTestUI { protected Integer getTicketNumber() { return Integer.valueOf(8068); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.java b/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.java index 88b3a9b9f4..524091aff6 100644 --- a/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.java +++ b/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.java @@ -27,4 +27,4 @@ public class RefreshStatePreserveTitle extends AbstractTestUI { protected Integer getTicketNumber() { return Integer.valueOf(11054); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/application/TerminalErrorNotification.java b/uitest/src/com/vaadin/tests/application/TerminalErrorNotification.java index e261da7570..7dbfa8cf40 100644 --- a/uitest/src/com/vaadin/tests/application/TerminalErrorNotification.java +++ b/uitest/src/com/vaadin/tests/application/TerminalErrorNotification.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/application/VaadinSessionAttribute.java b/uitest/src/com/vaadin/tests/application/VaadinSessionAttribute.java index 0576fd2090..ddef40b2d0 100644 --- a/uitest/src/com/vaadin/tests/application/VaadinSessionAttribute.java +++ b/uitest/src/com/vaadin/tests/application/VaadinSessionAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/application/calculator/Calc.java b/uitest/src/com/vaadin/tests/application/calculator/Calc.java index 7911556f4e..3059017faa 100644 --- a/uitest/src/com/vaadin/tests/application/calculator/Calc.java +++ b/uitest/src/com/vaadin/tests/application/calculator/Calc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/applicationcontext/ChangeSessionId.java b/uitest/src/com/vaadin/tests/applicationcontext/ChangeSessionId.java index c59039e81b..93e9464054 100644 --- a/uitest/src/com/vaadin/tests/applicationcontext/ChangeSessionId.java +++ b/uitest/src/com/vaadin/tests/applicationcontext/ChangeSessionId.java @@ -67,4 +67,4 @@ public class ChangeSessionId extends AbstractTestCase { return 6094; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/applicationcontext/UIRunSafelyThread.java b/uitest/src/com/vaadin/tests/applicationcontext/UIRunSafelyThread.java index c9af2c000d..a7edd2c0d0 100644 --- a/uitest/src/com/vaadin/tests/applicationcontext/UIRunSafelyThread.java +++ b/uitest/src/com/vaadin/tests/applicationcontext/UIRunSafelyThread.java @@ -21,4 +21,4 @@ public abstract class UIRunSafelyThread extends Thread { } protected abstract void runSafely(); -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java b/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java index 4b373c9526..3750fdd370 100644 --- a/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java +++ b/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/applicationservlet/NoApplicationClassTest.java b/uitest/src/com/vaadin/tests/applicationservlet/NoApplicationClassTest.java index 9d1b052182..5a815fb40c 100644 --- a/uitest/src/com/vaadin/tests/applicationservlet/NoApplicationClassTest.java +++ b/uitest/src/com/vaadin/tests/applicationservlet/NoApplicationClassTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/applicationservlet/SessionExpiration.java b/uitest/src/com/vaadin/tests/applicationservlet/SessionExpiration.java index df46c92f56..8fc6d56161 100644 --- a/uitest/src/com/vaadin/tests/applicationservlet/SessionExpiration.java +++ b/uitest/src/com/vaadin/tests/applicationservlet/SessionExpiration.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/browserfeatures/WebkitScrollbarTest.java b/uitest/src/com/vaadin/tests/browserfeatures/WebkitScrollbarTest.java index a031fb0c7a..a7920b5410 100644 --- a/uitest/src/com/vaadin/tests/browserfeatures/WebkitScrollbarTest.java +++ b/uitest/src/com/vaadin/tests/browserfeatures/WebkitScrollbarTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/AbstractTestUIWithLog.java b/uitest/src/com/vaadin/tests/components/AbstractTestUIWithLog.java index cace7c3404..a74692b169 100644 --- a/uitest/src/com/vaadin/tests/components/AbstractTestUIWithLog.java +++ b/uitest/src/com/vaadin/tests/components/AbstractTestUIWithLog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java b/uitest/src/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java index 926af72a2f..c619ceb200 100644 --- a/uitest/src/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java +++ b/uitest/src/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java @@ -80,4 +80,4 @@ public class AddRemoveSetStyleNamesTest extends TestBase { return 8664; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java b/uitest/src/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java index dd95ff6842..853f2863ef 100644 --- a/uitest/src/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java +++ b/uitest/src/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java @@ -83,4 +83,4 @@ public class CustomComponentwithUndefinedSize extends TestBase { return layout; } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/DisableEnableCascadeStyles.java b/uitest/src/com/vaadin/tests/components/DisableEnableCascadeStyles.java index 0279a92437..7c5f0c9282 100644 --- a/uitest/src/com/vaadin/tests/components/DisableEnableCascadeStyles.java +++ b/uitest/src/com/vaadin/tests/components/DisableEnableCascadeStyles.java @@ -143,4 +143,4 @@ public class DisableEnableCascadeStyles extends TestBase { return 8708; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/HierarchicalContainerSorting.java b/uitest/src/com/vaadin/tests/components/HierarchicalContainerSorting.java index d0638be54c..ec33b8f0e3 100644 --- a/uitest/src/com/vaadin/tests/components/HierarchicalContainerSorting.java +++ b/uitest/src/com/vaadin/tests/components/HierarchicalContainerSorting.java @@ -106,4 +106,4 @@ public class HierarchicalContainerSorting extends TestBase { return 3095; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/SaneErrorsTest.java b/uitest/src/com/vaadin/tests/components/SaneErrorsTest.java index 6cf49151b3..bf84695c3b 100644 --- a/uitest/src/com/vaadin/tests/components/SaneErrorsTest.java +++ b/uitest/src/com/vaadin/tests/components/SaneErrorsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/UnknownComponentConnector.java b/uitest/src/com/vaadin/tests/components/UnknownComponentConnector.java index b6358b6c56..982ff8d71e 100644 --- a/uitest/src/com/vaadin/tests/components/UnknownComponentConnector.java +++ b/uitest/src/com/vaadin/tests/components/UnknownComponentConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/UnknownComponentConnectorTest.java b/uitest/src/com/vaadin/tests/components/UnknownComponentConnectorTest.java index 49a3c29e2d..49539fcae1 100644 --- a/uitest/src/com/vaadin/tests/components/UnknownComponentConnectorTest.java +++ b/uitest/src/com/vaadin/tests/components/UnknownComponentConnectorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutHideComponent.java b/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutHideComponent.java index b8afc11e4b..8b76b0e4e1 100644 --- a/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutHideComponent.java +++ b/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutHideComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java b/uitest/src/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java index 4bfd724c99..777eb4b518 100644 --- a/uitest/src/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java +++ b/uitest/src/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/abstractcomponent/RemSizeUnitTest.java b/uitest/src/com/vaadin/tests/components/abstractcomponent/RemSizeUnitTest.java index 98c0538cd8..5924ab7d32 100644 --- a/uitest/src/com/vaadin/tests/components/abstractcomponent/RemSizeUnitTest.java +++ b/uitest/src/com/vaadin/tests/components/abstractcomponent/RemSizeUnitTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/abstractfield/FieldFocusOnClick.java b/uitest/src/com/vaadin/tests/components/abstractfield/FieldFocusOnClick.java index 161f9cd520..716c1d4348 100644 --- a/uitest/src/com/vaadin/tests/components/abstractfield/FieldFocusOnClick.java +++ b/uitest/src/com/vaadin/tests/components/abstractfield/FieldFocusOnClick.java @@ -29,4 +29,4 @@ public class FieldFocusOnClick extends AbstractTestUI { protected Integer getTicketNumber() { return 11854; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.html b/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.html deleted file mode 100644 index a7b8e24ae7..0000000000 --- a/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.html +++ /dev/null @@ -1,203 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="http://artur-laptop.office.itmill.com:8888/" /> -<title>New Test</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.abstractfield.ShortcutAddAndRemove?restartApplication</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/domChild[0]</td> - <td>316,58</td> -</tr> -<!--Enter on background - should cause event--> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::</td> - <td>enter</td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>1. Log button was clicked</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>102,51</td> -</tr> -<!--Enter in textfield - should cause event--> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>enter</td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>2. Log button was clicked</td> -</tr> -<!--Remove shortcut--> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>110,62</td> -</tr> -<!--Enter in field - should not cause event--> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>97,26</td> -</tr> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>up</td> -</tr> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>down</td> -</tr> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>down</td> -</tr> -<tr> - <td>enterCharacter</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>row1</td> -</tr> -<tr> - <td>keyPress</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>13</td> -</tr> -<tr> - <td>keyPress</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>r</td> -</tr> -<tr> - <td>keyPress</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>o</td> -</tr> -<tr> - <td>keyPress</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>w</td> -</tr> -<tr> - <td>keyPress</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>2</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>2. Log button was clicked</td> -</tr> -<!-- Commented out because TestBench does not enter the text correctly using keyPress in any browser except Firefox --> -<!-- <tr> - <td>assertValue</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>row1<br />row2</td> -</tr>--> -<!--Add shortcut again--> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>85,46</td> -</tr> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>enter</td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>3. Log button was clicked</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/VVerticalLayout[0]/domChild[2]/domChild[0]/domChild[0]</td> - <td>625,2</td> -</tr> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::</td> - <td>enter</td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>4. Log button was clicked</td> -</tr> -<!--Remove shortcut once more--> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/VVerticalLayout[0]</td> - <td>631,52</td> -</tr> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::</td> - <td>enter</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>4. Log button was clicked</td> -</tr> -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.java b/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.java index 309e297374..d6e8d72297 100644 --- a/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.java +++ b/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.java @@ -1,25 +1,22 @@ package com.vaadin.tests.components.abstractfield; import com.vaadin.event.ShortcutAction.KeyCode; -import com.vaadin.tests.components.TestBase; -import com.vaadin.tests.util.Log; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.TextArea; +import com.vaadin.ui.TextField; -public class ShortcutAddAndRemove extends TestBase { +public class ShortcutAddAndRemove extends AbstractTestUIWithLog { - private Log log; - private TextArea textArea; + private TextField textField; @Override - protected void setup() { - log = new Log(4); - + protected void setup(VaadinRequest request) { final Button logButton = new Button("Log a row (enter shortcut)"); logButton.setClickShortcut(KeyCode.ENTER); - logButton.addListener(new ClickListener() { + logButton.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { log.log("Log button was clicked"); @@ -27,7 +24,7 @@ public class ShortcutAddAndRemove extends TestBase { }); final Button removeShortcut = new Button("Remove shortcut"); - removeShortcut.addListener(new ClickListener() { + removeShortcut.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { logButton.removeClickShortcut(); @@ -35,7 +32,7 @@ public class ShortcutAddAndRemove extends TestBase { } }); final Button addShortcut = new Button("Add shortcut"); - addShortcut.addListener(new ClickListener() { + addShortcut.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { logButton.setClickShortcut(KeyCode.ENTER); @@ -44,17 +41,17 @@ public class ShortcutAddAndRemove extends TestBase { }); addComponent(log); addComponent(logButton); - textArea = new TextArea("Enter key does not break lines ..."); - textArea.setRows(5); - textArea.setColumns(20); - addComponent(textArea); + textField = new TextField("Enter key is a shortcut..."); + textField.setWidth("20em"); + addComponent(textField); addComponent(removeShortcut); addComponent(addShortcut); } @Override - protected String getDescription() { + protected String getTestDescription() { + // TODO Auto-generated method stub return null; } diff --git a/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemoveTest.java b/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemoveTest.java new file mode 100644 index 0000000000..edae0a24c2 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemoveTest.java @@ -0,0 +1,84 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.abstractfield; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +import org.junit.Test; +import org.openqa.selenium.Keys; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.elements.AbstractComponentElement; +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.TextFieldElement; +import com.vaadin.testbench.elements.VerticalLayoutElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class ShortcutAddAndRemoveTest extends MultiBrowserTest { + + @Test + public void addAndRemoveShortcut() { + openTestURL(); + + VerticalLayoutElement mainLayout = $(VerticalLayoutElement.class) + .first(); + + TextFieldElement textField = $(TextFieldElement.class).first(); + // Enter in mainlayout -> should trigger shortcut + sendEnter(mainLayout); + assertLastLogRowIs("1. Log button was clicked"); + + // Enter in textfield -> should trigger shortcut + sendEnter(textField); + assertLastLogRowIs("2. Log button was clicked"); + + // Remove enter shortcut + removeEnterShortcut(); + + // Enter in field - should not trigger any shortcut anymore + sendEnter(textField); + assertLastLogRowIs("2. Log button was clicked"); + + // Add shortcut again + addEnterShortcut(); + sendEnter(textField); + assertLastLogRowIs("3. Log button was clicked"); + + sendEnter(mainLayout); + assertLastLogRowIs("4. Log button was clicked"); + + removeEnterShortcut(); + sendEnter(mainLayout); + assertLastLogRowIs("4. Log button was clicked"); + } + + private void removeEnterShortcut() { + $(ButtonElement.class).caption("Remove shortcut").first().click(); + } + + private void addEnterShortcut() { + $(ButtonElement.class).caption("Add shortcut").first().click(); + } + + private void assertLastLogRowIs(String expected) { + assertThat(getLogRow(0), is(expected)); + } + + private void sendEnter(AbstractComponentElement target) { + new Actions(getDriver()).click(target).sendKeys(Keys.ENTER).perform(); + } +} diff --git a/uitest/src/com/vaadin/tests/components/accordion/AccordionAddTab.java b/uitest/src/com/vaadin/tests/components/accordion/AccordionAddTab.java index da0ad3685a..46fdbac797 100644 --- a/uitest/src/com/vaadin/tests/components/accordion/AccordionAddTab.java +++ b/uitest/src/com/vaadin/tests/components/accordion/AccordionAddTab.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/accordion/AccordionAddTabTest.java b/uitest/src/com/vaadin/tests/components/accordion/AccordionAddTabTest.java index 68aa61cc87..95b7a9c416 100644 --- a/uitest/src/com/vaadin/tests/components/accordion/AccordionAddTabTest.java +++ b/uitest/src/com/vaadin/tests/components/accordion/AccordionAddTabTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/accordion/AccordionClipsContent.html b/uitest/src/com/vaadin/tests/components/accordion/AccordionClipsContent.html deleted file mode 100644 index 30414094c8..0000000000 --- a/uitest/src/com/vaadin/tests/components/accordion/AccordionClipsContent.html +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="http://arturwin.office.itmill.com:8888/" /> -<title>New Test</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/AccordionTest?restartApplication</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runAccordionTest::PID_Smenu#item0</td> - <td>45,2</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runAccordionTest::Root/VOverlay[0]/VMenuBar[0]#item3</td> - <td>136,8</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runAccordionTest::Root/VOverlay[1]/VMenuBar[0]#item0</td> - <td>65,4</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runAccordionTest::Root/VOverlay[2]/VMenuBar[0]#item1</td> - <td>86,2</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runAccordionTest::Root/VOverlay[3]/VMenuBar[0]#item0</td> - <td>48,0</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runAccordionTest::PID_StestComponent/VAccordion$StackItem[0]/VNativeButton[0]</td> - <td>63,11</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>button-clicked</td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/accordion/AccordionClipsContentTest.java b/uitest/src/com/vaadin/tests/components/accordion/AccordionClipsContentTest.java new file mode 100644 index 0000000000..b4f830d106 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/accordion/AccordionClipsContentTest.java @@ -0,0 +1,57 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.accordion; + +import org.junit.Test; + +import com.vaadin.testbench.elements.NativeButtonElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class AccordionClipsContentTest extends MultiBrowserTest { + @Override + protected Class<?> getUIClass() { + return AccordionTest.class; + } + + @Test + public void testAccordionClipsContent() throws Exception { + openTestURL(); + + /* + * MenuBarElement doesn't have any API, so this part is ugly until + * #13364 is fixed + */ + + // Component + vaadinElement("PID_Smenu#item0").click(); + // Component container features + clickAt("Root/VOverlay[0]/VMenuBar[0]#item3", 136, 8); + // Add component + clickAt("Root/VOverlay[1]/VMenuBar[0]#item0", 65, 4); + // NativeButton + clickAt("Root/VOverlay[2]/VMenuBar[0]#item1", 86, 2); + // autoxauto + vaadinElement("Root/VOverlay[3]/VMenuBar[0]#item0").click(); + + $(NativeButtonElement.class).first().click(); + + compareScreen("button-clicked"); + } + + private void clickAt(String vaadinLocator, int x, int y) { + testBenchElement(vaadinElement(vaadinLocator)).click(x, y); + } +} diff --git a/uitest/src/com/vaadin/tests/components/accordion/AccordionRemoveTab.java b/uitest/src/com/vaadin/tests/components/accordion/AccordionRemoveTab.java new file mode 100644 index 0000000000..86e718596e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/accordion/AccordionRemoveTab.java @@ -0,0 +1,78 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.accordion; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Accordion; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Label; +import com.vaadin.ui.TabSheet.Tab; +import com.vaadin.ui.VerticalLayout; + +/** + * Test UI for Accordion: tabs should stay selectable after remove tab. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class AccordionRemoveTab extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + final Accordion tabs = new Accordion(); + addComponent(tabs); + tabs.setHeight(300, Unit.PIXELS); + final VerticalLayout one = new VerticalLayout(); + one.setCaption("One"); + one.addComponent(new Label("On first tab")); + tabs.addTab(one); + VerticalLayout two = new VerticalLayout(); + two.setCaption("Two"); + two.addComponent(new Label("On second tab")); + tabs.addTab(two); + + tabs.setSelectedTab(two); + + VerticalLayout l = new VerticalLayout(); + l.addComponent(new Label("On third tab")); + Tab last = tabs.addTab(l); + last.setCaption("Three"); + + Button remove = new Button("Remove First"); + remove.addClickListener(new Button.ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + tabs.removeComponent(tabs.iterator().next()); + } + }); + + addComponent(remove); + } + + @Override + protected String getTestDescription() { + return "Tabs should stay selectable after remove tab."; + } + + @Override + protected Integer getTicketNumber() { + return 11366; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/accordion/AccordionRemoveTabTest.java b/uitest/src/com/vaadin/tests/components/accordion/AccordionRemoveTabTest.java new file mode 100644 index 0000000000..f5651e0ada --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/accordion/AccordionRemoveTabTest.java @@ -0,0 +1,59 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.accordion; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test for Accordion: tabs should stay selectable after remove tab. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class AccordionRemoveTabTest extends MultiBrowserTest { + + @Test + public void testRemoveTab() { + openTestURL(); + + WebElement button = driver.findElement(By.className("v-button")); + button.click(); + + checkFirstItemHeight("On second tab"); + + button.click(); + + checkFirstItemHeight("On third tab"); + } + + private void checkFirstItemHeight(String text) { + WebElement firstItem = driver.findElement(By + .className("v-accordion-item-first")); + WebElement label = firstItem.findElement(By.className("v-label")); + Assert.assertEquals("Unexpected text in first item", text, + label.getText()); + int height = firstItem.getSize().getHeight(); + WebElement accordion = driver.findElement(By.className("v-accordion")); + Assert.assertTrue("First item in accordion has unexpected height", + height > accordion.getSize().getHeight() / 2); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonClick.java b/uitest/src/com/vaadin/tests/components/button/ButtonClick.java index 30692649c5..9b10473d0f 100644 --- a/uitest/src/com/vaadin/tests/components/button/ButtonClick.java +++ b/uitest/src/com/vaadin/tests/components/button/ButtonClick.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonClickTest.java b/uitest/src/com/vaadin/tests/components/button/ButtonClickTest.java index 77b35092de..4ea02b20d0 100644 --- a/uitest/src/com/vaadin/tests/components/button/ButtonClickTest.java +++ b/uitest/src/com/vaadin/tests/components/button/ButtonClickTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonIOSDragTest.java b/uitest/src/com/vaadin/tests/components/button/ButtonIOSDragTest.java index 3d3d90728a..6031bff152 100644 --- a/uitest/src/com/vaadin/tests/components/button/ButtonIOSDragTest.java +++ b/uitest/src/com/vaadin/tests/components/button/ButtonIOSDragTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonTabIndex.java b/uitest/src/com/vaadin/tests/components/button/ButtonTabIndex.java index 563342e240..cfec4d1100 100644 --- a/uitest/src/com/vaadin/tests/components/button/ButtonTabIndex.java +++ b/uitest/src/com/vaadin/tests/components/button/ButtonTabIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java b/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java index 626ed1d250..25dd469903 100644 --- a/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java +++ b/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java @@ -35,4 +35,4 @@ public class ButtonToggleIcons extends UI { layout.addComponent(new Button("Toggle icon", iconToggleListener));
layout.addComponent(new NativeButton("Toggle icon", iconToggleListener));
}
-}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonUpdateAltText.java b/uitest/src/com/vaadin/tests/components/button/ButtonUpdateAltText.java index 8286398623..dd89d1b9a7 100644 --- a/uitest/src/com/vaadin/tests/components/button/ButtonUpdateAltText.java +++ b/uitest/src/com/vaadin/tests/components/button/ButtonUpdateAltText.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/calendar/CalendarActionEventSource.java b/uitest/src/com/vaadin/tests/components/calendar/CalendarActionEventSource.java index 3a5d61d793..ec40ef4649 100644 --- a/uitest/src/com/vaadin/tests/components/calendar/CalendarActionEventSource.java +++ b/uitest/src/com/vaadin/tests/components/calendar/CalendarActionEventSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/calendar/CalendarActionEventSourceTest.java b/uitest/src/com/vaadin/tests/components/calendar/CalendarActionEventSourceTest.java index 6fbe77040f..161f927681 100644 --- a/uitest/src/com/vaadin/tests/components/calendar/CalendarActionEventSourceTest.java +++ b/uitest/src/com/vaadin/tests/components/calendar/CalendarActionEventSourceTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.java b/uitest/src/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.java index 77225b2e4c..5b05d188bd 100644 --- a/uitest/src/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.java +++ b/uitest/src/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/calendar/CalendarDragAndDrop.java b/uitest/src/com/vaadin/tests/components/calendar/CalendarDragAndDrop.java index 7477fc84ce..56c4eacba1 100644 --- a/uitest/src/com/vaadin/tests/components/calendar/CalendarDragAndDrop.java +++ b/uitest/src/com/vaadin/tests/components/calendar/CalendarDragAndDrop.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/calendar/CalendarTestEvent.java b/uitest/src/com/vaadin/tests/components/calendar/CalendarTestEvent.java index 29b8f62403..b4e759b20b 100644 --- a/uitest/src/com/vaadin/tests/components/calendar/CalendarTestEvent.java +++ b/uitest/src/com/vaadin/tests/components/calendar/CalendarTestEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/calendar/HiddenFwdBackButtons.java b/uitest/src/com/vaadin/tests/components/calendar/HiddenFwdBackButtons.java index 8b789098e6..04b00dd039 100644 --- a/uitest/src/com/vaadin/tests/components/calendar/HiddenFwdBackButtons.java +++ b/uitest/src/com/vaadin/tests/components/calendar/HiddenFwdBackButtons.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/calendar/NotificationTestUI.java b/uitest/src/com/vaadin/tests/components/calendar/NotificationTestUI.java index 6e5718a652..2313ad891a 100644 --- a/uitest/src/com/vaadin/tests/components/calendar/NotificationTestUI.java +++ b/uitest/src/com/vaadin/tests/components/calendar/NotificationTestUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/checkbox/CheckBoxRevertValueChange.java b/uitest/src/com/vaadin/tests/components/checkbox/CheckBoxRevertValueChange.java index cc26cf8845..0513c9db4f 100644 --- a/uitest/src/com/vaadin/tests/components/checkbox/CheckBoxRevertValueChange.java +++ b/uitest/src/com/vaadin/tests/components/checkbox/CheckBoxRevertValueChange.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerInputFormatsTest.java b/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerInputFormatsTest.java new file mode 100644 index 0000000000..90c01116cc --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerInputFormatsTest.java @@ -0,0 +1,98 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.colorpicker; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test legal color values according to + * http://www.w3schools.com/cssref/css_colors_legal.asp + */ +public class ColorPickerInputFormatsTest extends MultiBrowserTest { + + @Override + protected Class<?> getUIClass() { + return ColorPickerTestUI.class; + } + + @Test + public void testRGBValue() throws Exception { + openTestURL(); + + setColorpickerValue("rgb(100,100,100)"); + + assertEquals("#646464", getColorpickerValue()); + } + + @Test + public void testRGBAValue() { + openTestURL(); + + setColorpickerValue("rgba(100,100,100, 0.5)"); + + assertEquals("#646464", getColorpickerValue()); + } + + @Test + public void testHSLValue() { + openTestURL(); + + setColorpickerValue("hsl(120,100%,50%)"); + + assertEquals("#00ff00", getColorpickerValue()); + } + + @Test + public void testHSLAValue() { + openTestURL(); + + setColorpickerValue("hsla(120,100%,50%, 0.3)"); + + assertEquals("#00ff00", getColorpickerValue()); + } + + private void setColorpickerValue(String value) { + + // Open colorpicker + getDriver().findElement(By.id("colorpicker1")).click(); + + // Add RGB value + WebElement field = getDriver().findElement( + By.className("v-colorpicker-preview-textfield")); + + // Select all text + field.sendKeys(Keys.chord(Keys.CONTROL, "a")); + + // Replace with rgb value + field.sendKeys(value); + + // Submit + field.sendKeys(Keys.ENTER); + } + + private String getColorpickerValue() { + WebElement field = getDriver().findElement( + By.className("v-colorpicker-preview-textfield")); + return field.getAttribute("value"); + } +} diff --git a/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerTest.html b/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerTest.html index 23c44d3cc0..48a4219c87 100644 --- a/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerTest.html +++ b/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerTest.html @@ -4,16 +4,16 @@ <head profile="http://selenium-ide.openqa.org/profiles/test-case"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="selenium.base" href="" /> -<title>ColorPickerTest</title> +<title>ColorPickerTestUI</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> <thead> -<tr><td rowspan="1" colspan="3">ColorPickerTest</td></tr> +<tr><td rowspan="1" colspan="3">ColorPickerTestUI</td></tr> </thead><tbody> <tr> <td>open</td> - <td>/run/com.vaadin.tests.components.colorpicker.ColorPickerTest?restartApplication</td> + <td>/run/com.vaadin.tests.components.colorpicker.ColorPickerTestUI?restartApplication</td> <td></td> </tr> @@ -25,17 +25,17 @@ </tr> <tr> <td>waitForElementPresent</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> <td></td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> <td>190,87</td> </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> @@ -47,12 +47,12 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> <td>51,33</td> </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> @@ -64,42 +64,42 @@ <!-- change foreground color with area button --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_Scolorpicker5/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_Scolorpicker5/domChild[1]</td> <td>10,15</td> </tr> <!-- expand history --> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VButton[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VButton[0]/domChild[0]</td> <td></td> </tr> <!-- choose from history --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[0]/domChild[3]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[0]/domChild[3]</td> <td>9,9</td> </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <!-- change background color with area button --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_Scolorpicker6/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_Scolorpicker6/domChild[1]</td> <td>12,24</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[0]/domChild[1]</td> <td>9,12</td> </tr> <!-- choose from history --> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]</td> <td></td> </tr> <tr> @@ -123,59 +123,59 @@ <!-- open and close using area button --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_Scolorpicker5/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_Scolorpicker5/domChild[1]</td> <td>11,17</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_Scolorpicker5/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_Scolorpicker5/domChild[1]</td> <td>11,17</td> </tr> <!-- open background (using area button) to display HSV effects --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_Scolorpicker6/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_Scolorpicker6/domChild[1]</td> <td>21,15</td> </tr> <!-- HSV tab --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]</td> <td>12,6</td> </tr> <!-- hue slider --> <tr> <td>dragAndDrop</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VSlider[0]/domChild[2]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VSlider[0]/domChild[2]/domChild[0]</td> <td>136,0</td> </tr> <!-- saturation slider --> <tr> <td>dragAndDrop</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VSlider[0]/domChild[2]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VSlider[0]/domChild[2]/domChild[0]</td> <td>100,0</td> </tr> <!-- value slider --> <tr> <td>dragAndDrop</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VSlider[0]/domChild[2]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VSlider[0]/domChild[2]/domChild[0]</td> <td>-60,0</td> </tr> <!-- Swatches tab (choose color) --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[0]/domChild[0]/domChild[0]</td> <td>43,8</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VCustomComponent[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[11]/domChild[9]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VCustomComponent[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[11]/domChild[9]</td> <td>12,10</td> </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> @@ -187,73 +187,73 @@ <!-- open foreground (using area button) to display checkbox effects --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_Scolorpicker5/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_Scolorpicker5/domChild[1]</td> <td>14,25</td> </tr> <!-- remove Swatches tab --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_SswaBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_SswaBox/domChild[0]</td> <td>9,6</td> </tr> <!-- remove css field --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_StxtBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_StxtBox/domChild[0]</td> <td>6,9</td> </tr> <!-- remove history --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_ShisBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_ShisBox/domChild[0]</td> <td>6,7</td> </tr> <!-- remove RGB tab --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_SrgbBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_SrgbBox/domChild[0]</td> <td>6,7</td> </tr> <!-- return RGB tab --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_SrgbBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_SrgbBox/domChild[0]</td> <td>6,7</td> </tr> <!-- remove HSV tab --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_ShsvBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_ShsvBox/domChild[0]</td> <td>6,9</td> </tr> <!-- return HSV tab --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_ShsvBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_ShsvBox/domChild[0]</td> <td>6,9</td> </tr> <!-- return css field --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_StxtBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_StxtBox/domChild[0]</td> <td>8,8</td> </tr> <!-- return history --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_ShisBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_ShisBox/domChild[0]</td> <td>6,8</td> </tr> <!-- return Swatches tab --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_SswaBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_SswaBox/domChild[0]</td> <td>4,8</td> </tr> <!-- close without choosing a new color --> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]</td> <td></td> </tr> @@ -265,12 +265,12 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> <td>148,127</td> </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> @@ -287,29 +287,29 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[0]/domChild[6]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[0]/domChild[6]</td> <td>10,7</td> </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <!-- change color of the last shade area --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_Sshadearea_16/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_Sshadearea_16/domChild[1]</td> <td>10,-65</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> <td>36,93</td> </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> @@ -321,17 +321,17 @@ <!-- reset the color back to white --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_Sshadearea_16/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_Sshadearea_16/domChild[1]</td> <td>19,-65</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[0]/domChild[4]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[0]/domChild[4]</td> <td>6,7</td> </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]</td> <td></td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerTest.java b/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java index 0f7e639725..544cdafaf0 100644 --- a/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerTest.java +++ b/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ package com.vaadin.tests.components.colorpicker; import java.awt.Graphics; @@ -13,9 +28,10 @@ import javax.imageio.ImageIO; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.server.StreamResource; +import com.vaadin.server.VaadinRequest; import com.vaadin.shared.ui.colorpicker.Color; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.tests.components.TestBase; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.AbstractColorPicker; import com.vaadin.ui.Alignment; import com.vaadin.ui.CheckBox; @@ -30,10 +46,11 @@ import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.components.colorpicker.ColorChangeEvent; import com.vaadin.ui.components.colorpicker.ColorChangeListener; -public class ColorPickerTest extends TestBase implements ColorChangeListener { +public class ColorPickerTestUI extends AbstractTestUI implements + ColorChangeListener { @Override - protected String getDescription() { + public String getTestDescription() { return "Vaadin 7 compatible ColorPicker"; } @@ -178,7 +195,7 @@ public class ColorPickerTest extends TestBase implements ColorChangeListener { } @Override - protected void setup() { + protected void setup(VaadinRequest request) { getLayout().setWidth("1000px"); getLayout().setHeight(null); getLayout().addStyleName("colorpicker-mainwindow-content"); diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxClosePopupRetainText.html b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxClosePopupRetainText.html deleted file mode 100644 index 9248938b28..0000000000 --- a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxClosePopupRetainText.html +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="" /> -<title></title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3"></td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.combobox.ComboBoxes2?restartApplication</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[0]</td> - <td>47,8</td> -</tr> -<tr> - <td>type</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[0]</td> - <td>I</td> -</tr> -<!--Open popup--> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[1]</td> - <td>14,10</td> -</tr> -<!--Close poup--> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[1]</td> - <td>14,10</td> -</tr> -<tr> - <td>assertValue</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[0]</td> - <td>I</td> -</tr> -<!--Select a value--> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.combobox.ComboBoxes2?restartApplication</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[1]</td> - <td>14,10</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item2</td> - <td>47,9</td> -</tr> -<tr> - <td>type</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[0]</td> - <td>I</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[1]</td> - <td>14,10</td> -</tr> -<!--Entered value should remain in the text field even though the popup is opened--> -<tr> - <td>assertValue</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[0]</td> - <td>I</td> -</tr> -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxClosePopupRetainTextTest.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxClosePopupRetainTextTest.java new file mode 100644 index 0000000000..a5efb44ec8 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxClosePopupRetainTextTest.java @@ -0,0 +1,60 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.combobox; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.elements.ComboBoxElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class ComboBoxClosePopupRetainTextTest extends MultiBrowserTest { + @Override + protected Class<?> getUIClass() { + return ComboBoxes2.class; + } + + @Test + public void testClosePopupRetainText() throws Exception { + openTestURL(); + + ComboBoxElement cb = $(ComboBoxElement.class).first(); + WebElement textbox = cb.findElement(By.vaadin("#textbox")); + textbox.sendKeys("I"); + cb.openPopup(); + cb.openPopup(); // openPopup() actually toggles + // The entered value should remain + assertEquals("I", textbox.getAttribute("value")); + } + + @Test + public void testClosePopupRetainText_selectingAValue() throws Exception { + openTestURL(); + ComboBoxElement cb = $(ComboBoxElement.class).first(); + cb.selectByText("Item 3"); + WebElement textbox = cb.findElement(By.vaadin("#textbox")); + textbox.clear(); + textbox.sendKeys("I"); + cb.openPopup(); + // Entered value should remain in the text field even though the popup + // is opened + assertEquals("I", textbox.getAttribute("value")); + + } +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxCursorPositionReset.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxCursorPositionReset.java index 20a62f2a33..ccbde5f2df 100644 --- a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxCursorPositionReset.java +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxCursorPositionReset.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxItemAddingWithFocusListener.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxItemAddingWithFocusListener.java new file mode 100644 index 0000000000..8242eb9e57 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxItemAddingWithFocusListener.java @@ -0,0 +1,65 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.combobox; + +import com.vaadin.event.FieldEvents.FocusEvent; +import com.vaadin.event.FieldEvents.FocusListener; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.ComboBox; + +/** + * Test UI to verify that focus event actually update the ComboBox suggestion + * popup + * + * @author Vaadin Ltd + */ +public class ComboBoxItemAddingWithFocusListener extends AbstractTestUI { + + private ComboBox cBox; + + @Override + protected void setup(VaadinRequest request) { + cBox = new ComboBox(); + addComponent(cBox); + cBox.setImmediate(true); + cBox.addItem("Foo"); + cBox.addItem("Bar"); + cBox.addFocusListener(new FocusListener() { + + int x = 0; + + @Override + public void focus(FocusEvent event) { + cBox.addItem("Focus" + (x++)); + } + + }); + addComponent(new Button("Focus Target")); + } + + @Override + protected String getTestDescription() { + return "Item adding in focus listener causes popup to clear"; + } + + @Override + protected Integer getTicketNumber() { + return 13635; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxItemAddingWithFocusListenerTest.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxItemAddingWithFocusListenerTest.java new file mode 100644 index 0000000000..66173db554 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxItemAddingWithFocusListenerTest.java @@ -0,0 +1,47 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.combobox; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.TestBenchElement; +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.ComboBoxElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class ComboBoxItemAddingWithFocusListenerTest extends MultiBrowserTest { + + @Test + public void testPopupViewContainsAddedItem() { + openTestURL(); + ComboBoxElement cBox = $(ComboBoxElement.class).first(); + ButtonElement focusTarget = $(ButtonElement.class).first(); + cBox.openPopup(); + int i = 0; + while (i < 3) { + assertTrue("No item added on focus", cBox.getPopupSuggestions() + .contains("Focus" + i++)); + focusTarget.focus(); + ((TestBenchElement) cBox.findElement(By.vaadin("#textbox"))) + .focus(); + } + assertTrue("No item added on focus", cBox.getPopupSuggestions() + .contains("Focus" + i)); + } +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxParentDisable.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxParentDisable.java index 84355c4d89..d1adeaaf88 100644 --- a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxParentDisable.java +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxParentDisable.java @@ -78,4 +78,4 @@ public class ComboBoxParentDisable extends AbstractTestUIWithLog { protected Integer getTicketNumber() { return 10734; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSQLContainerFilteredValueChange.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSQLContainerFilteredValueChange.java index 75010f0ea9..9f07d81cc9 100644 --- a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSQLContainerFilteredValueChange.java +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSQLContainerFilteredValueChange.java @@ -123,4 +123,4 @@ public class ComboBoxSQLContainerFilteredValueChange extends TestBase { connectionPool.releaseConnection(conn); } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSetNullWhenNewItemsAllowed.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSetNullWhenNewItemsAllowed.java new file mode 100644 index 0000000000..a052a29bba --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSetNullWhenNewItemsAllowed.java @@ -0,0 +1,61 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.combobox; + +import com.vaadin.data.Property; +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.ComboBox; +import com.vaadin.ui.Label; + +public class ComboBoxSetNullWhenNewItemsAllowed extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + final ComboBox comboBox = new ComboBox("My ComboBox"); + comboBox.setImmediate(true); + comboBox.setNullSelectionAllowed(false); + comboBox.setNewItemsAllowed(true); + for (int i = 0; i < 10; i++) { + comboBox.addItem("Item " + i); + } + + final Label value = new Label("Selected: "); + + comboBox.addValueChangeListener(new Property.ValueChangeListener() { + @Override + public void valueChange(ValueChangeEvent event) { + if (comboBox.getValue() != null) { + comboBox.setValue(null); + value.setValue("Selected: " + (String) comboBox.getValue()); + } + } + }); + addComponent(comboBox); + addComponent(value); + } + + @Override + protected String getTestDescription() { + return "ComboBox should clear its value when setting to null with new items."; + } + + @Override + protected Integer getTicketNumber() { + return 13413; + } +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSetNullWhenNewItemsAllowedTest.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSetNullWhenNewItemsAllowedTest.java new file mode 100644 index 0000000000..54d355ab0a --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSetNullWhenNewItemsAllowedTest.java @@ -0,0 +1,54 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.combobox; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.commands.TestBenchElementCommands; +import com.vaadin.testbench.elements.ComboBoxElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * ComboBox should clear its value when setting to null with new items. + */ +public class ComboBoxSetNullWhenNewItemsAllowedTest extends MultiBrowserTest { + + @Test + public void testNewValueIsClearedAppropriately() + throws InterruptedException { + setDebug(true); + openTestURL(); + + WebElement element = $(ComboBoxElement.class).first().findElement( + By.vaadin("#textbox")); + ((TestBenchElementCommands) element).click(8, 7); + element.clear(); + element.sendKeys("New value"); + assertEquals("New value", element.getAttribute("value")); + if (BrowserUtil.isPhantomJS(getDesiredCapabilities())) { + new Actions(getDriver()).sendKeys(Keys.ENTER).perform(); + } else { + element.sendKeys(Keys.RETURN); + } + assertEquals("", element.getAttribute("value")); + } +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/EscapeClosesComboboxNotWindow.java b/uitest/src/com/vaadin/tests/components/combobox/EscapeClosesComboboxNotWindow.java index dcd19f6b2a..02c212a3e1 100644 --- a/uitest/src/com/vaadin/tests/components/combobox/EscapeClosesComboboxNotWindow.java +++ b/uitest/src/com/vaadin/tests/components/combobox/EscapeClosesComboboxNotWindow.java @@ -40,4 +40,4 @@ public class EscapeClosesComboboxNotWindow extends UI { layout.addComponent(button); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentGrowingContent.java b/uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentGrowingContent.java index 4311ad1f08..9cebc58100 100644 --- a/uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentGrowingContent.java +++ b/uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentGrowingContent.java @@ -40,4 +40,4 @@ public class CustomComponentGrowingContent extends TestBase { protected Integer getTicketNumber() { return Integer.valueOf(7326); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/customfield/AddressField.java b/uitest/src/com/vaadin/tests/components/customfield/AddressField.java index 595a2e2cde..bc9f13c454 100644 --- a/uitest/src/com/vaadin/tests/components/customfield/AddressField.java +++ b/uitest/src/com/vaadin/tests/components/customfield/AddressField.java @@ -94,4 +94,4 @@ public class AddressField extends CustomField<Address> { public Class<Address> getType() { return Address.class; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/customfield/BooleanField.java b/uitest/src/com/vaadin/tests/components/customfield/BooleanField.java index 409ecccca8..20c004c068 100644 --- a/uitest/src/com/vaadin/tests/components/customfield/BooleanField.java +++ b/uitest/src/com/vaadin/tests/components/customfield/BooleanField.java @@ -43,4 +43,4 @@ public class BooleanField extends CustomField { public Class<?> getType() { return Boolean.class; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSize.java b/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSize.java index a3e19513b0..b6f46cadd0 100644 --- a/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSize.java +++ b/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSize.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSizeTest.java b/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSizeTest.java index c47ec0b792..a3f8f06976 100644 --- a/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSizeTest.java +++ b/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSizeTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/customfield/EmbeddedForm.java b/uitest/src/com/vaadin/tests/components/customfield/EmbeddedForm.java index d305afde1d..2703e01a27 100644 --- a/uitest/src/com/vaadin/tests/components/customfield/EmbeddedForm.java +++ b/uitest/src/com/vaadin/tests/components/customfield/EmbeddedForm.java @@ -64,4 +64,4 @@ public class EmbeddedForm extends Form { return super.removeItemProperty(id); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/AriaDisabled.java b/uitest/src/com/vaadin/tests/components/datefield/AriaDisabled.java index c192b561cc..0832f5afeb 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/AriaDisabled.java +++ b/uitest/src/com/vaadin/tests/components/datefield/AriaDisabled.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -45,4 +45,4 @@ public class AriaDisabled extends AbstractTestUI { protected Integer getTicketNumber() { return 13463; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/AriaDisabledTest.java b/uitest/src/com/vaadin/tests/components/datefield/AriaDisabledTest.java index 823638ef0c..f37042396b 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/AriaDisabledTest.java +++ b/uitest/src/com/vaadin/tests/components/datefield/AriaDisabledTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormatEEE.java b/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormatEEE.java index ce9d021c79..fc3c8c97e8 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormatEEE.java +++ b/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormatEEE.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormatEEETest.java b/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormatEEETest.java index 286da85f06..98094515e8 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormatEEETest.java +++ b/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormatEEETest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormats.java b/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormats.java index 77637fb339..f51c75d57a 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormats.java +++ b/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormats.java @@ -209,4 +209,4 @@ public class CustomDateFormats extends TestBase { protected Integer getTicketNumber() { return 5465; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/DateFieldFastForward.java b/uitest/src/com/vaadin/tests/components/datefield/DateFieldFastForward.java new file mode 100644 index 0000000000..b38f58e5cc --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/datefield/DateFieldFastForward.java @@ -0,0 +1,39 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.datefield; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.InlineDateField; + +public class DateFieldFastForward extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + addComponent(new InlineDateField()); + } + + @Override + protected String getTestDescription() { + return "Tests that right-click doesn't interfere with fast-forwarding (holding down left mouse button)."; + } + + @Override + protected Integer getTicketNumber() { + return 8012; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/DateFieldFastForwardTest.java b/uitest/src/com/vaadin/tests/components/datefield/DateFieldFastForwardTest.java new file mode 100644 index 0000000000..63d96e9bf9 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/datefield/DateFieldFastForwardTest.java @@ -0,0 +1,71 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.datefield; + +import static org.junit.Assert.assertEquals; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.elements.VerticalLayoutElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class DateFieldFastForwardTest extends MultiBrowserTest { + + @Test + public void testFastForwardOnRightMouseClick() throws Exception { + openTestURL(); + String firstMonth = getSelectedMonth(); + WebElement nextMonthButton = driver.findElement(By + .className("v-button-nextmonth")); + + // Click and hold left mouse button to start fast forwarding. + new Actions(driver).clickAndHold(nextMonthButton).perform(); + sleep(1000); + + // Right click and release the left button. + + new Actions(driver).contextClick(nextMonthButton) + .release(nextMonthButton).perform(); + + // Now the fast forwarding should be ended, get the expected month. + String expectedMonth = getSelectedMonth(); + + // Make browser context menu disappear, since it will crash IE + $(VerticalLayoutElement.class).first().click(); + + Assert.assertFalse("Month did not change during fast forward", + firstMonth.equals(expectedMonth)); + + // Wait for a while. + Thread.sleep(1000); + + // Verify that we didn't fast forward any further after the left button + // was released. + String actualMonth = getSelectedMonth(); + assertEquals(expectedMonth, actualMonth); + } + + private String getSelectedMonth() { + return driver.findElement( + By.className("v-inline-datefield-calendarpanel-month")) + .getText(); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/DateFieldTestTest.java b/uitest/src/com/vaadin/tests/components/datefield/DateFieldTestTest.java index 123fd167d0..5f659d389b 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/DateFieldTestTest.java +++ b/uitest/src/com/vaadin/tests/components/datefield/DateFieldTestTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -19,10 +19,10 @@ import org.junit.Assert; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.Dimension; -import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; +import com.vaadin.testbench.elements.NotificationElement; import com.vaadin.tests.tb3.MultiBrowserTest; public class DateFieldTestTest extends MultiBrowserTest { @@ -44,12 +44,8 @@ public class DateFieldTestTest extends MultiBrowserTest { } private void assertNoErrorNotification() { - try { - getDriver().findElement( - By.xpath("//div[contains(@class, 'v-Notification') ]")); - Assert.fail("Error notification shown!"); - } catch (NoSuchElementException e) { - // As expected + if (isElementPresent(NotificationElement.class)) { + Assert.fail("Notification was present"); } } @@ -122,4 +118,4 @@ public class DateFieldTestTest extends MultiBrowserTest { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopup.java b/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopup.java index c48d2383a7..49590a3cee 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopup.java +++ b/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopup.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -19,11 +19,6 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.DateField; -/** - * - * @since 7.1 - * @author Vaadin Ltd - */ public class DisabledDateFieldPopup extends AbstractTestUI { @Override diff --git a/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopupTest.java b/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopupTest.java index dc287c19da..a57017746a 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopupTest.java +++ b/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopupTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -15,38 +15,44 @@ */ package com.vaadin.tests.components.datefield; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + import org.junit.Assert; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; +import org.openqa.selenium.remote.DesiredCapabilities; import com.vaadin.tests.tb3.MultiBrowserTest; -/** - * - * @since 7.1 - * @author Vaadin Ltd - */ public class DisabledDateFieldPopupTest extends MultiBrowserTest { + @Override + public List<DesiredCapabilities> getBrowsersToTest() { + List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>(); + for (DesiredCapabilities browser : super.getBrowsersToTest()) { + if (BrowserUtil.isIE(browser)) { + browsers.add(browser); + } + } + return browsers; + } + @Test - public void testPopup() { + public void testPopup() throws IOException { openTestURL(); WebElement button = driver.findElement(By .className("v-datefield-button")); - button.click(); + new Actions(driver).moveToElement(button).click() + .sendKeys(Keys.ARROW_DOWN).perform(); Assert.assertFalse( - "Calendar popup should not be opened for disabled date field on mouse click", + "Calendar popup should not be opened for disabled date field", isElementPresent(By.className("v-datefield-popup"))); - - button.sendKeys(Keys.ARROW_DOWN); - - Assert.assertFalse("Calendar popup should not be opened for " - + "disabled date fild on down key", - isElementPresent(By.className("v-datefield-popup"))); - } } diff --git a/uitest/src/com/vaadin/tests/components/datefield/DisabledInlineDateField.java b/uitest/src/com/vaadin/tests/components/datefield/DisabledInlineDateField.java new file mode 100644 index 0000000000..affc5d322c --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/datefield/DisabledInlineDateField.java @@ -0,0 +1,58 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.datefield; + +import java.util.Calendar; +import java.util.Date; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.DateField; +import com.vaadin.ui.InlineDateField; + +public class DisabledInlineDateField extends AbstractTestUI { + + private static final Date testDate; + static { + Calendar cal = Calendar.getInstance(); + cal.set(2014, 5, 5); + testDate = cal.getTime(); + } + + @Override + protected void setup(VaadinRequest request) { + DateField df = new InlineDateField("Disabled"); + df.setValue(testDate); + df.setEnabled(false); + addComponent(df); + + df = new InlineDateField("Read-only"); + df.setValue(testDate); + df.setReadOnly(true); + addComponent(df); + } + + @Override + protected String getTestDescription() { + return "Testing disabled and read-only modes of InlineDateField."; + } + + @Override + protected Integer getTicketNumber() { + return 10262; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/DisabledInlineDateFieldTest.java b/uitest/src/com/vaadin/tests/components/datefield/DisabledInlineDateFieldTest.java new file mode 100644 index 0000000000..2c50030461 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/datefield/DisabledInlineDateFieldTest.java @@ -0,0 +1,79 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.datefield; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class DisabledInlineDateFieldTest extends MultiBrowserTest { + + @Test + public void testDisabled() { + openTestURL(); + testNextMonthControls(".v-disabled"); + testDaySelection(".v-disabled"); + } + + @Test + public void testReadOnly() { + openTestURL(); + testNextMonthControls(".v-readonly"); + testDaySelection(".v-readonly"); + } + + private void testNextMonthControls(String cssClass) { + // Get the currently selected month. + String expectedMonth = getSelectedMonth(cssClass); + + // Attempt to click the next month button. + driver.findElement(By.cssSelector(cssClass + " .v-button-nextmonth")) + .click(); + + // Assert that we did not navigate to next month. + String actualMonth = getSelectedMonth(cssClass); + assertEquals(expectedMonth, actualMonth); + } + + private void testDaySelection(String cssClass) { + // We know that the first day element is not selected, because of the + // fixed date in the test. + WebElement nonSelectedDay = driver.findElement(By.cssSelector(cssClass + + " .v-inline-datefield-calendarpanel-day")); + + // Assert it is not selected before click. + assertFalse(nonSelectedDay.getAttribute("class").contains("selected")); + + // Click on the non-selected day. + nonSelectedDay.click(); + + // Assert that clicking did not select the day. + assertFalse(nonSelectedDay.getAttribute("class").contains("selected")); + } + + private String getSelectedMonth(String selectorPrefix) { + return driver.findElement( + By.cssSelector(selectorPrefix + + " .v-inline-datefield-calendarpanel-month")) + .getText(); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayout.java b/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayout.java index cf09ff029d..49d88630a8 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayout.java +++ b/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -35,7 +35,6 @@ public class DisabledParentLayout extends AbstractTestUI { content.setMargin(true); final VerticalLayout pane = new VerticalLayout(); - pane.setEnabled(false); pane.addComponent(new DateField()); content.addComponent(pane); @@ -44,7 +43,7 @@ public class DisabledParentLayout extends AbstractTestUI { button.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { - pane.setEnabled(true); + pane.setEnabled(!pane.isEnabled()); } }); content.addComponent(button); diff --git a/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayoutTest.java b/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayoutTest.java index 3ee4544693..76486bf340 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayoutTest.java +++ b/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -35,17 +35,41 @@ public class DisabledParentLayoutTest extends MultiBrowserTest { WebElement button = driver.findElement(By.className("v-button")); button.click(); + WebElement textField = driver.findElement(By + .className("v-datefield-textfield")); + textField.click(); + + Assert.assertFalse( + "Date input text field shoud be disabled for disabled DateField", + textField.isEnabled()); + WebElement dataFieldButton = driver.findElement(By .className("v-datefield-button")); dataFieldButton.click(); - WebElement popup = driver - .findElement(By.className("v-datefield-popup")); + Assert.assertFalse( + "Disabled date popup is opened after click to its button", + isElementPresent(By.className("v-datefield-popup"))); + + button.click(); + + Assert.assertTrue( + "Date input text field shoud be enabled for enabled DateField", + textField.isEnabled()); + textField.click(); + String text = "text"; + textField.sendKeys(text); + + Assert.assertEquals("Unexpected text in date text field", text, + textField.getAttribute("value")); + + dataFieldButton.click(); Assert.assertFalse("Unexpected disabled element found", isElementPresent(By.className("v-disabled"))); - Assert.assertNotNull( - "Date popup is not opened after click to its button", popup); + Assert.assertTrue("Date popup is not opened after click to its button", + isElementPresent(By.className("v-datefield-popup"))); } + } diff --git a/uitest/src/com/vaadin/tests/components/datefield/DynamicallyChangeDateRange.java b/uitest/src/com/vaadin/tests/components/datefield/DynamicallyChangeDateRange.java index fb0fb2a546..31f97afabd 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/DynamicallyChangeDateRange.java +++ b/uitest/src/com/vaadin/tests/components/datefield/DynamicallyChangeDateRange.java @@ -90,4 +90,4 @@ public class DynamicallyChangeDateRange extends AbstractTestUI { return 11940; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/NarrowPopupDateFieldInTable.java b/uitest/src/com/vaadin/tests/components/datefield/NarrowPopupDateFieldInTable.java index dab47ebdd9..b77b782d2a 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/NarrowPopupDateFieldInTable.java +++ b/uitest/src/com/vaadin/tests/components/datefield/NarrowPopupDateFieldInTable.java @@ -31,4 +31,4 @@ public class NarrowPopupDateFieldInTable extends TestBase { return 6166; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEsc.java b/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEsc.java index f1422b28a3..0b8ffa52fa 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEsc.java +++ b/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEsc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEscTest.java b/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEscTest.java index 834517e1bb..1366d38705 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEscTest.java +++ b/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEscTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldLocaleTest.java b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldLocaleTest.java index f12a3dda58..86ce195609 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldLocaleTest.java +++ b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldLocaleTest.java @@ -50,4 +50,4 @@ public class PopupDateFieldLocaleTest extends AbstractTestUI { return 12135; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldPopup.java b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldPopup.java index 5a6f6517bd..ede5510c72 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldPopup.java +++ b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldPopup.java @@ -38,4 +38,4 @@ public class PopupDateFieldPopup extends TestBase { return 8391; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldTextEnabled.java b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldTextEnabled.java index 1ba6409a6f..130ed8f3c5 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldTextEnabled.java +++ b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldTextEnabled.java @@ -41,4 +41,4 @@ public class PopupDateFieldTextEnabled extends TestBase { return 6790; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldValueChangeEvents.java b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldValueChangeEvents.java index b875d86428..b6cc002872 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldValueChangeEvents.java +++ b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldValueChangeEvents.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropBatchUpload.java b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropBatchUpload.java index adb5cd9e3a..b820ccf788 100644 --- a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropBatchUpload.java +++ b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropBatchUpload.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropTextArea.java b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropTextArea.java new file mode 100644 index 0000000000..2ce3a42957 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropTextArea.java @@ -0,0 +1,56 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.draganddropwrapper; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.DragAndDropWrapper; +import com.vaadin.ui.DragAndDropWrapper.DragStartMode; +import com.vaadin.ui.TextArea; +import com.vaadin.ui.VerticalLayout; + +/** + * Test UI for text area: drag image should contain text-area text. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class DragAndDropTextArea extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + VerticalLayout dndLayout = new VerticalLayout(); + + TextArea area = new TextArea(); + area.setValue("text"); + + dndLayout.addComponent(area); + DragAndDropWrapper wrapper = new DragAndDropWrapper(dndLayout); + wrapper.setDragStartMode(DragStartMode.WRAPPER); + addComponent(wrapper); + } + + @Override + protected String getTestDescription() { + return "Drag image for textarea should contain text-area text"; + } + + @Override + protected Integer getTicketNumber() { + return 13557; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropTextAreaTest.java b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropTextAreaTest.java new file mode 100644 index 0000000000..c60eead918 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropTextAreaTest.java @@ -0,0 +1,61 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.draganddropwrapper; + +import java.util.List; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.By; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test for drag image of text area which should contain text-area text. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class DragAndDropTextAreaTest extends MultiBrowserTest { + + @Test + public void testTextAreaDndImage() { + openTestURL(); + + WebElement wrapper = driver.findElement(By + .className("v-verticallayout")); + Actions actions = new Actions(driver); + actions.clickAndHold(wrapper); + actions.moveByOffset(50, 50); + actions.perform(); + + WebElement dragElement = driver.findElement(By + .className("v-drag-element")); + List<WebElement> children = dragElement.findElements(By.xpath(".//*")); + boolean found = false; + for (WebElement child : children) { + if ("text".equals(child.getAttribute("value"))) { + found = true; + } + } + + Assert.assertTrue( + "Text value is not found in the DnD image of text area", found); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModes.html b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModes.html deleted file mode 100644 index 3e7a7cb0a7..0000000000 --- a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModes.html +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="" /> -<title>DragStartModes</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">DragStartModes</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.draganddropwrapper.DragStartModes?restartApplication</td> - <td></td> -</tr> -<tr> - <td>drag</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragStartModes::PID_SlabelCOMPONENT</td> - <td>50,10</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragStartModes::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VLabel[0]</td> - <td>50,10</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>drag-mode-component</td> -</tr> -<tr> - <td>drop</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragStartModes::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VLabel[0]</td> - <td>50,10</td> -</tr> -<tr> - <td>drag</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragStartModes::PID_SlabelWRAPPER</td> - <td>50,10</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragStartModes::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VLabel[0]</td> - <td>50,10</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>drag-mode-wrapper</td> -</tr> -<tr> - <td>drop</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragStartModes::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VLabel[0]</td> - <td>50,10</td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java new file mode 100644 index 0000000000..25aef1b815 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java @@ -0,0 +1,46 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.draganddropwrapper; + +import java.io.IOException; + +import org.junit.Test; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class DragStartModesTest extends MultiBrowserTest { + + @Test + public void testDragStartModes() throws IOException { + openTestURL(); + WebElement dropTarget = vaadinElement("/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]"); + dragToTarget("COMPONENT", dropTarget); + dragToTarget("WRAPPER", dropTarget); + } + + private void dragToTarget(String dragMode, WebElement dropTarget) + throws IOException { + WebElement draggable = vaadinElementById("label" + dragMode); + new Actions(driver).moveToElement(draggable, 10, 10).clickAndHold() + .moveByOffset(5, 0).perform(); + new Actions(driver).moveToElement(dropTarget, 12, 10).perform(); + compareScreen("dragMode" + dragMode); + new Actions(driver).release().perform(); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/formlayout/CaptionEnableDisable.java b/uitest/src/com/vaadin/tests/components/formlayout/CaptionEnableDisable.java index ce9067df29..a7fd9956e3 100644 --- a/uitest/src/com/vaadin/tests/components/formlayout/CaptionEnableDisable.java +++ b/uitest/src/com/vaadin/tests/components/formlayout/CaptionEnableDisable.java @@ -58,4 +58,4 @@ public class CaptionEnableDisable extends AbstractTestUI { return 12062; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java b/uitest/src/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java index 3296906762..d3932c1df0 100644 --- a/uitest/src/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java +++ b/uitest/src/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/formlayout/FormLayouts.java b/uitest/src/com/vaadin/tests/components/formlayout/FormLayouts.java index 46b2f0148c..6b17c557da 100644 --- a/uitest/src/com/vaadin/tests/components/formlayout/FormLayouts.java +++ b/uitest/src/com/vaadin/tests/components/formlayout/FormLayouts.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/formlayout/StylePrefix.java b/uitest/src/com/vaadin/tests/components/formlayout/StylePrefix.java new file mode 100644 index 0000000000..8ca88fbcd3 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/formlayout/StylePrefix.java @@ -0,0 +1,47 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.formlayout; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.FormLayout; + +/** + * Test UI for FormLayout: custom additional styles should be prefixed with + * "v-formlayout-", not "v-layout-". + * + * @author Vaadin Ltd + */ +public class StylePrefix extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + FormLayout layout = new FormLayout(); + layout.addStyleName("mystyle"); + addComponent(layout); + } + + @Override + protected String getTestDescription() { + return "Form layout should set v-formlayout style name instead of v-layout"; + } + + @Override + protected Integer getTicketNumber() { + return 13509; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/formlayout/StylePrefixTest.java b/uitest/src/com/vaadin/tests/components/formlayout/StylePrefixTest.java new file mode 100644 index 0000000000..c43dc0042e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/formlayout/StylePrefixTest.java @@ -0,0 +1,40 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.formlayout; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test for FormLayout style prefix: custom additional styles should be prefixed + * with "v-formlayout-", not "v-layout-". + * + * @author Vaadin Ltd + */ +public class StylePrefixTest extends MultiBrowserTest { + + @Test + public void testStylePrefix() { + openTestURL(); + + Assert.assertTrue("Custom style has unexpected prefix", + isElementPresent(By.className("v-formlayout-mystyle"))); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java b/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java index ce405a8eff..3978c49b09 100644 --- a/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java +++ b/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java @@ -42,4 +42,4 @@ public class TableInFormLayoutCausesScrolling extends AbstractTestCase { protected Integer getTicketNumber() { return 7309; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutScrollPosition.java b/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutScrollPosition.java new file mode 100644 index 0000000000..9bc29b5c82 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutScrollPosition.java @@ -0,0 +1,78 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.gridlayout; + +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.CheckBox; +import com.vaadin.ui.GridLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.Panel; + +public class GridLayoutScrollPosition extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + + Panel panel = new Panel(); + setContent(panel); + + GridLayout gridLayout = new GridLayout(); + gridLayout.setWidth("500px"); + panel.setContent(gridLayout); + gridLayout.setColumns(1); + gridLayout.setRows(1); + + Label dummyLabel = new Label("Dummy"); + dummyLabel.setHeight("500px"); + gridLayout.addComponent(dummyLabel); + + final CheckBox visibilityToggleCheckBox = new CheckBox( + "Hide / Show toggleable components"); + visibilityToggleCheckBox.setId("visibility-toggle"); + visibilityToggleCheckBox.setHeight("2000px"); + visibilityToggleCheckBox.setImmediate(true); + visibilityToggleCheckBox.setValue(false); // Initially unchecked + gridLayout.addComponent(visibilityToggleCheckBox); + + final Label toggleableLabel = new Label("Toggleable Label"); + toggleableLabel.setHeight("2000px"); + toggleableLabel.setVisible(false); // Initially hidden + gridLayout.addComponent(toggleableLabel); + + visibilityToggleCheckBox + .addValueChangeListener(new ValueChangeListener() { + @Override + public void valueChange(ValueChangeEvent event) { + toggleableLabel.setVisible(visibilityToggleCheckBox + .getValue()); + } + }); + + } + + @Override + protected String getTestDescription() { + return "The UI scroll position should not be reset when visibility of GridLayout children is toggled"; + } + + @Override + protected Integer getTicketNumber() { + return 13386; + } +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutScrollPositionTest.java b/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutScrollPositionTest.java new file mode 100644 index 0000000000..961b08002b --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutScrollPositionTest.java @@ -0,0 +1,48 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.gridlayout; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class GridLayoutScrollPositionTest extends MultiBrowserTest { + + @Test + public void testToggleChildComponents() throws Exception { + + final int SCROLLTOP = 100; + + openTestURL(); + + WebDriver driver = getDriver(); + + WebElement ui = driver.findElement(By.className("v-ui")); + + testBenchElement(ui).scroll(SCROLLTOP); + + driver.findElement(By.id("visibility-toggle")) + .findElement(By.tagName("input")).click(); + + assertEquals("UI scroll position", String.valueOf(SCROLLTOP), + ui.getAttribute("scrollTop")); + } +} diff --git a/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutWithNonIntegerWidth.java b/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutWithNonIntegerWidth.java index 8312b15ba7..6cc96332d5 100644 --- a/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutWithNonIntegerWidth.java +++ b/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutWithNonIntegerWidth.java @@ -50,4 +50,4 @@ public class GridLayoutWithNonIntegerWidth extends AbstractTestUI { protected Integer getTicketNumber() { return 11775; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/gridlayout/LayoutAfterHidingError.java b/uitest/src/com/vaadin/tests/components/gridlayout/LayoutAfterHidingError.java index dc04e23f02..0ec8cd5030 100644 --- a/uitest/src/com/vaadin/tests/components/gridlayout/LayoutAfterHidingError.java +++ b/uitest/src/com/vaadin/tests/components/gridlayout/LayoutAfterHidingError.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java b/uitest/src/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java index b99f67b82e..5a64cb6a00 100644 --- a/uitest/src/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java +++ b/uitest/src/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/javascriptcomponent/JavaScriptResizeListener.java b/uitest/src/com/vaadin/tests/components/javascriptcomponent/JavaScriptResizeListener.java index 9d0094b833..b9071ec44c 100644 --- a/uitest/src/com/vaadin/tests/components/javascriptcomponent/JavaScriptResizeListener.java +++ b/uitest/src/com/vaadin/tests/components/javascriptcomponent/JavaScriptResizeListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/label/LabelModesTest.java b/uitest/src/com/vaadin/tests/components/label/LabelModesTest.java index efad615510..7314ce4093 100644 --- a/uitest/src/com/vaadin/tests/components/label/LabelModesTest.java +++ b/uitest/src/com/vaadin/tests/components/label/LabelModesTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -27,4 +27,4 @@ public class LabelModesTest extends MultiBrowserTest { compareScreen("labelmodes"); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/label/LabelPropertySourceValue.java b/uitest/src/com/vaadin/tests/components/label/LabelPropertySourceValue.java index c1965ff92b..876d56208b 100644 --- a/uitest/src/com/vaadin/tests/components/label/LabelPropertySourceValue.java +++ b/uitest/src/com/vaadin/tests/components/label/LabelPropertySourceValue.java @@ -55,4 +55,4 @@ public class LabelPropertySourceValue extends AbstractTestUI { return 9618; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/label/LabelStyles.java b/uitest/src/com/vaadin/tests/components/label/LabelStyles.java index 7c26ec1a2e..6de50b0cba 100644 --- a/uitest/src/com/vaadin/tests/components/label/LabelStyles.java +++ b/uitest/src/com/vaadin/tests/components/label/LabelStyles.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/link/LinkTest.java b/uitest/src/com/vaadin/tests/components/link/LinkTest.java index b18e51ed4c..6deea0fd96 100644 --- a/uitest/src/com/vaadin/tests/components/link/LinkTest.java +++ b/uitest/src/com/vaadin/tests/components/link/LinkTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/media/AudioTest.java b/uitest/src/com/vaadin/tests/components/media/AudioTest.java index 28d1a7716f..c77583096d 100644 --- a/uitest/src/com/vaadin/tests/components/media/AudioTest.java +++ b/uitest/src/com/vaadin/tests/components/media/AudioTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/media/Media.java b/uitest/src/com/vaadin/tests/components/media/Media.java index bd038a5d42..5ccf9eb72b 100644 --- a/uitest/src/com/vaadin/tests/components/media/Media.java +++ b/uitest/src/com/vaadin/tests/components/media/Media.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/menubar/MenuBarFocus.java b/uitest/src/com/vaadin/tests/components/menubar/MenuBarFocus.java index 2ea7a23333..2613634576 100644 --- a/uitest/src/com/vaadin/tests/components/menubar/MenuBarFocus.java +++ b/uitest/src/com/vaadin/tests/components/menubar/MenuBarFocus.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigation.java b/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigation.java index 338219d848..764844751c 100644 --- a/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigation.java +++ b/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigation.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigationTest.java b/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigationTest.java index f10e1551df..3e0053d0d1 100644 --- a/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigationTest.java +++ b/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndText.java b/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndText.java index fdeed316ba..d1a889dcf4 100644 --- a/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndText.java +++ b/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndText.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndTextTest.java b/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndTextTest.java index 2cb294de77..37987171d2 100644 --- a/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndTextTest.java +++ b/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndTextTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/nativeselect/NativeSelectsAndChromeKeyboardNavigationTest.java b/uitest/src/com/vaadin/tests/components/nativeselect/NativeSelectsAndChromeKeyboardNavigationTest.java index e038c451d0..eb838c135e 100644 --- a/uitest/src/com/vaadin/tests/components/nativeselect/NativeSelectsAndChromeKeyboardNavigationTest.java +++ b/uitest/src/com/vaadin/tests/components/nativeselect/NativeSelectsAndChromeKeyboardNavigationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/notification/MiddleNotificationPosition.java b/uitest/src/com/vaadin/tests/components/notification/MiddleNotificationPosition.java index 4050e4505e..b770435161 100644 --- a/uitest/src/com/vaadin/tests/components/notification/MiddleNotificationPosition.java +++ b/uitest/src/com/vaadin/tests/components/notification/MiddleNotificationPosition.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/notification/MiddleNotificationPositionTest.java b/uitest/src/com/vaadin/tests/components/notification/MiddleNotificationPositionTest.java index 9f31719a10..dc43b9d19a 100644 --- a/uitest/src/com/vaadin/tests/components/notification/MiddleNotificationPositionTest.java +++ b/uitest/src/com/vaadin/tests/components/notification/MiddleNotificationPositionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.java b/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.java index 27af49a397..ecf704835f 100644 --- a/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.java +++ b/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.java @@ -2,7 +2,7 @@ package com.vaadin.tests.components.notification; import com.vaadin.data.Item; import com.vaadin.server.Page; -import com.vaadin.shared.ui.ui.NotificationConfigurationBean.Role; +import com.vaadin.shared.ui.ui.NotificationRole; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; @@ -11,8 +11,10 @@ import com.vaadin.ui.ComboBox; import com.vaadin.ui.NativeSelect; import com.vaadin.ui.Notification; import com.vaadin.ui.Notification.Type; +import com.vaadin.ui.NotificationConfiguration; import com.vaadin.ui.TextArea; import com.vaadin.ui.TextField; +import com.vaadin.ui.UI; public class NotificationsWaiAria extends TestBase { @@ -36,9 +38,9 @@ public class NotificationsWaiAria extends TestBase { " - closes automatically after 10 seconds"); addComponent(postfix); - role = new NativeSelect("Role"); - role.addItem(Role.ALERT); - role.addItem(Role.STATUS); + role = new NativeSelect("NotificationRole"); + role.addItem(NotificationRole.ALERT); + role.addItem(NotificationRole.STATUS); role.setValue(role.getItemIds().iterator().next()); addComponent(role); @@ -96,9 +98,12 @@ public class NotificationsWaiAria extends TestBase { Notification n = new Notification(tf.getValue(), typeValue); n.setHtmlContentAllowed(true); - n.setAssistivePrefixForType(typeValue, prefix.getValue()); - n.setAssistivePostfixForType(typeValue, postfix.getValue()); - n.setAssistiveRoleForType(typeValue, (Role) role.getValue()); + NotificationConfiguration notificationConf = UI.getCurrent() + .getNotificationConfiguration(); + notificationConf.setAssistivePrefix(typeValue, prefix.getValue()); + notificationConf.setAssistivePostfix(typeValue, postfix.getValue()); + notificationConf + .setAssistiveRole(typeValue, (NotificationRole) role.getValue()); n.show(Page.getCurrent()); } diff --git a/uitest/src/com/vaadin/tests/components/optiongroup/OptionGroupRetainFocusKeyboardValueChange.java b/uitest/src/com/vaadin/tests/components/optiongroup/OptionGroupRetainFocusKeyboardValueChange.java index 570a300cb3..bad9723539 100644 --- a/uitest/src/com/vaadin/tests/components/optiongroup/OptionGroupRetainFocusKeyboardValueChange.java +++ b/uitest/src/com/vaadin/tests/components/optiongroup/OptionGroupRetainFocusKeyboardValueChange.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java index ba5701e699..4f7a939ee5 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java @@ -480,4 +480,4 @@ public class BoxLayoutTest extends AbstractTestUI { return null; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/CaptionLeakTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/CaptionLeakTest.java index 142ca00ba7..0fbd0e5f69 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/CaptionLeakTest.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/CaptionLeakTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -26,6 +26,7 @@ public class CaptionLeakTest extends MultiBrowserTest { public void testCaptionLeak() throws Exception { setDebug(true); openTestURL(); + openDebugLogTab(); // this should be present // 3 general non-connector elements, none accumulated on click @@ -54,6 +55,7 @@ public class CaptionLeakTest extends MultiBrowserTest { public void testNoCaptionLeak() throws Exception { setDebug(true); openTestURL(); + openDebugLogTab(); getDriver().findElement(By.xpath("//button[@title = 'Clear log']")) .click(); diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.html b/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.html deleted file mode 100644 index 81da3b897e..0000000000 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.html +++ /dev/null @@ -1,82 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="" /> -<title>Required error tootlip</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">Required error tooltip</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.orderedlayout.ErrorIndicator?restartApplication</td> - <td></td> -</tr> -<tr> - <td>showTooltip</td> - <td>//div[@id='gwt-uid-4']/span</td> - <td>43,4</td> -</tr> - -<tr> - <td>screenCapture</td> - <td></td> - <td>tooltipVertivcalCaption</td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>showTooltip</td> - <td>//div[@id='gwt-uid-4']/span[2]</td> - <td>3,6</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>tooltipVertivcalRequiredIndicator</td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>showTooltip</td> - <td>//div[@id='gwt-uid-6']/span</td> - <td>38,11</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>tooltipHorizontalCaption</td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>showTooltip</td> - <td>//div[@id='gwt-uid-6']/span[2]</td> - <td>3,4</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>tooltipHorizontalRequiredIndicator</td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.java b/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.java index 9964e1ee78..def67c256a 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicatorTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicatorTest.java new file mode 100644 index 0000000000..0367a77c7e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicatorTest.java @@ -0,0 +1,41 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.orderedlayout; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openqa.selenium.By; + +import com.vaadin.testbench.elements.TextFieldElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class ErrorIndicatorTest extends MultiBrowserTest { + + @Test + public void verifyTooltips() { + String tooltipText; + openTestURL(); + + $(TextFieldElement.class).first().showTooltip(); + tooltipText = driver.findElement(By.className("v-tooltip")).getText(); + assertEquals(tooltipText, "Vertical layout tooltip"); + + $(TextFieldElement.class).get(1).showTooltip(); + tooltipText = driver.findElement(By.className("v-tooltip")).getText(); + assertEquals(tooltipText, "Horizontal layout tooltip"); + } +} diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/HorizontalLayoutFullsizeContentWithErrorMsgTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/HorizontalLayoutFullsizeContentWithErrorMsgTest.java index 24ebf24688..ea78d9f30c 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/HorizontalLayoutFullsizeContentWithErrorMsgTest.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/HorizontalLayoutFullsizeContentWithErrorMsgTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -46,4 +46,4 @@ public class HorizontalLayoutFullsizeContentWithErrorMsgTest extends } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/HorizontalLayoutTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/HorizontalLayoutTest.java index fd6ecf5422..d9ab760302 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/HorizontalLayoutTest.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/HorizontalLayoutTest.java @@ -11,4 +11,4 @@ public class HorizontalLayoutTest extends return HorizontalLayout.class; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/InsertComponentInHorizontalLayout.java b/uitest/src/com/vaadin/tests/components/orderedlayout/InsertComponentInHorizontalLayout.java index 99896fcd81..ae26706d35 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/InsertComponentInHorizontalLayout.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/InsertComponentInHorizontalLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHover.java b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHover.java index e9b022eac2..59e2b0936a 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHover.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHover.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHoverTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHoverTest.java index 24a27f343a..1cddbc28c3 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHoverTest.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHoverTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/RelativeChildrenWithoutExpand.java b/uitest/src/com/vaadin/tests/components/orderedlayout/RelativeChildrenWithoutExpand.java index a1ac1df307..59447919ef 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/RelativeChildrenWithoutExpand.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/RelativeChildrenWithoutExpand.java @@ -52,4 +52,4 @@ public class RelativeChildrenWithoutExpand extends AbstractTestUI { protected Integer getTicketNumber() { return Integer.valueOf(10222); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/SpacingLeakTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/SpacingLeakTest.java index 3a24cb7620..565c11c1f0 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/SpacingLeakTest.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/SpacingLeakTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -26,6 +26,7 @@ public class SpacingLeakTest extends MultiBrowserTest { public void testSpacingLeak() throws Exception { setDebug(true); openTestURL(); + openDebugLogTab(); getDriver().findElement(By.id("addbutton")).click(); getDriver().findElement(By.xpath("//button[@title = 'Clear log']")) .click(); diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/VaadinTunesLayout.java b/uitest/src/com/vaadin/tests/components/orderedlayout/VaadinTunesLayout.java index fcc9792a7d..15f964f110 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/VaadinTunesLayout.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/VaadinTunesLayout.java @@ -344,4 +344,4 @@ public class VaadinTunesLayout extends AbstractTestUI { return null; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutFocusWithDOMChanges.java b/uitest/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutFocusWithDOMChanges.java index 1e7d817094..d55765b5e4 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutFocusWithDOMChanges.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutFocusWithDOMChanges.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutFocusWithDOMChangesTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutFocusWithDOMChangesTest.java index 14c26a0e17..1afcabec1d 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutFocusWithDOMChangesTest.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutFocusWithDOMChangesTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/page/PageTitle.java b/uitest/src/com/vaadin/tests/components/page/PageTitle.java index 38dcd4673c..3979ede8c8 100644 --- a/uitest/src/com/vaadin/tests/components/page/PageTitle.java +++ b/uitest/src/com/vaadin/tests/components/page/PageTitle.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/page/PageTitleTest.java b/uitest/src/com/vaadin/tests/components/page/PageTitleTest.java index 039f52be73..bc2e6f7ca1 100644 --- a/uitest/src/com/vaadin/tests/components/page/PageTitleTest.java +++ b/uitest/src/com/vaadin/tests/components/page/PageTitleTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/panel/PanelChangeContents.java b/uitest/src/com/vaadin/tests/components/panel/PanelChangeContents.java index 1b621e3a4f..3f953bf73a 100644 --- a/uitest/src/com/vaadin/tests/components/panel/PanelChangeContents.java +++ b/uitest/src/com/vaadin/tests/components/panel/PanelChangeContents.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/panel/PanelChangeContentsTest.java b/uitest/src/com/vaadin/tests/components/panel/PanelChangeContentsTest.java index 5bc505dbc8..039b054040 100644 --- a/uitest/src/com/vaadin/tests/components/panel/PanelChangeContentsTest.java +++ b/uitest/src/com/vaadin/tests/components/panel/PanelChangeContentsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/panel/WebkitScrollbarTest.java b/uitest/src/com/vaadin/tests/components/panel/WebkitScrollbarTest.java index 8981f52f12..2c4bac03b0 100644 --- a/uitest/src/com/vaadin/tests/components/panel/WebkitScrollbarTest.java +++ b/uitest/src/com/vaadin/tests/components/panel/WebkitScrollbarTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragment.html b/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragment.html deleted file mode 100644 index 28af578bac..0000000000 --- a/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragment.html +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="http://localhost:8888/" /> -<title>PopupViewAndFragment</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">PopupViewAndFragment</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/PopupViewAndFragment?restartApplication#</td> - <td></td> -</tr> -<tr> - <td>click</td> - <td>vaadin=runPopupViewAndFragment::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td></td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragment.java b/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragment.java index 1606b78604..8178cfdbe2 100644 --- a/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragment.java +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragment.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragmentTest.java b/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragmentTest.java new file mode 100644 index 0000000000..510cc7c883 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragmentTest.java @@ -0,0 +1,33 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.popupview; + +import org.junit.Test; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class PopupViewAndFragmentTest extends MultiBrowserTest { + + @Test + public void changeFragmentAndOpenPopupView() throws Exception { + openTestURL(); + $(ButtonElement.class).first().click(); + // Wait for popup view to fully open + sleep(1000); + compareScreen("changedFragment"); + } +} diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewCaption.java b/uitest/src/com/vaadin/tests/components/popupview/PopupViewCaption.java index 8cb9f01d93..2bf587ba97 100644 --- a/uitest/src/com/vaadin/tests/components/popupview/PopupViewCaption.java +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewCaption.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewCaptionTest.java b/uitest/src/com/vaadin/tests/components/popupview/PopupViewCaptionTest.java index 9c59e2ca6e..f9b1692b85 100644 --- a/uitest/src/com/vaadin/tests/components/popupview/PopupViewCaptionTest.java +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewCaptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewResizeWhileOpen.java b/uitest/src/com/vaadin/tests/components/popupview/PopupViewResizeWhileOpen.java new file mode 100644 index 0000000000..cf3854ee69 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewResizeWhileOpen.java @@ -0,0 +1,73 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.popupview; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Component; +import com.vaadin.ui.PopupView; +import com.vaadin.ui.VerticalLayout; + +/** + * Resizing PopupView's popup component while it is visible should also resize + * the drop shadow of the overlay. + * + * @author Vaadin Ltd + */ +public class PopupViewResizeWhileOpen extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + PopupView pv = new PopupView(new PopupView.Content() { + @Override + public Component getPopupComponent() { + final VerticalLayout popupComponent = new VerticalLayout(); + popupComponent.setId("content-vl"); + popupComponent.setWidth("640px"); + popupComponent.setHeight("480px"); + + Button button = new Button("Change height!", + new Button.ClickListener() { + @Override + public void buttonClick(Button.ClickEvent event) { + popupComponent.setHeight("320px"); + } + }); + + popupComponent.addComponent(button); + return popupComponent; + } + + @Override + public String getMinimizedValueAsHTML() { + return "Click me!"; + } + }); + pv.setHideOnMouseOut(false); + addComponent(pv); + } + + @Override + protected String getTestDescription() { + return "Resize PopupView's content component while visible"; + } + + @Override + protected Integer getTicketNumber() { + return 13666; + } +} diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewResizeWhileOpenTest.java b/uitest/src/com/vaadin/tests/components/popupview/PopupViewResizeWhileOpenTest.java new file mode 100644 index 0000000000..52ffc6b729 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewResizeWhileOpenTest.java @@ -0,0 +1,70 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.popupview; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.lessThan; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.Dimension; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.PopupViewElement; +import com.vaadin.testbench.elements.VerticalLayoutElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Resizing PopupView's popup component while it is visible should also resize + * the drop shadow of the overlay. + * + * @author Vaadin Ltd + */ +public class PopupViewResizeWhileOpenTest extends MultiBrowserTest { + + @Test + public void testCustomPopupSizeAfterResize() { + openTestURL(); + + // Open PopupView + $(PopupViewElement.class).first().click(); + + // Shadow element + WebElement shadow = findElement(By.className("v-shadow")); + WebElement vl = $(VerticalLayoutElement.class).id("content-vl"); + + // Sanity check + assertShadowSize(vl, shadow); + + // Resize + $(ButtonElement.class).first().click(); + assertShadowSize(vl, shadow); + } + + private void assertShadowSize(WebElement layout, WebElement shadow) { + Dimension shadowSize = shadow.getSize(); + Dimension layoutSize = layout.getSize(); + + assertThat(shadowSize.height, is(greaterThan(layoutSize.height))); + assertThat(shadowSize.height, is(lessThan(layoutSize.height + 10))); + assertThat(shadowSize.width, is(greaterThan(layoutSize.width))); + assertThat(shadowSize.width, is(lessThan(layoutSize.width + 10))); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewWithExtension.java b/uitest/src/com/vaadin/tests/components/popupview/PopupViewWithExtension.java new file mode 100644 index 0000000000..04bbf6df0a --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewWithExtension.java @@ -0,0 +1,55 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.popupview; + +import com.vaadin.server.Responsive; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Label; +import com.vaadin.ui.PopupView; + +/** + * Test UI for popup view with extension: extension is a part of getChildren() + * collection but is not inside the getChildComponents() collection. Popup view + * should use getChildComponents() to avoid exception when extension is returned + * by getChildren(). + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class PopupViewWithExtension extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + Label label = new Label("label"); + PopupView view = new PopupView("small", label); + + Responsive.makeResponsive(view); + + addComponent(view); + } + + @Override + protected String getTestDescription() { + return "PopupView should use getChildComponents() in the connector, not getChildren()"; + } + + @Override + protected Integer getTicketNumber() { + return 13503; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewWithExtensionTest.java b/uitest/src/com/vaadin/tests/components/popupview/PopupViewWithExtensionTest.java new file mode 100644 index 0000000000..4d11190ea9 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewWithExtensionTest.java @@ -0,0 +1,47 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.popupview; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Popup view with extension should not throw an exception. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class PopupViewWithExtensionTest extends MultiBrowserTest { + + @Test + public void testPopupView() { + setDebug(true); + openTestURL(); + + WebElement view = driver.findElement(By.className("v-popupview")); + view.click(); + + Assert.assertFalse( + "Popup view with extension should not throw an exception. " + + "(Error notification window is shown).", + isElementPresent(By.className("v-Notification-error"))); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/popupview/ReopenPopupView.java b/uitest/src/com/vaadin/tests/components/popupview/ReopenPopupView.java index fd83fc797c..979bafc688 100644 --- a/uitest/src/com/vaadin/tests/components/popupview/ReopenPopupView.java +++ b/uitest/src/com/vaadin/tests/components/popupview/ReopenPopupView.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarTest.java b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarTest.java index 5afa874220..ce51184e7d 100644 --- a/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarTest.java +++ b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorTest.java b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorTest.java index 93e8c6d8f2..5b3a931e5b 100644 --- a/uitest/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorTest.java +++ b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/select/OptionGroupBaseSelects.java b/uitest/src/com/vaadin/tests/components/select/OptionGroupBaseSelects.java index 0df82688d1..2f58e35dc7 100644 --- a/uitest/src/com/vaadin/tests/components/select/OptionGroupBaseSelects.java +++ b/uitest/src/com/vaadin/tests/components/select/OptionGroupBaseSelects.java @@ -103,4 +103,4 @@ public class OptionGroupBaseSelects extends ComponentTestCase<HorizontalLayout> select.setImmediate(true); return select; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/select/SelectItemCaptionRefresh.java b/uitest/src/com/vaadin/tests/components/select/SelectItemCaptionRefresh.java index de068ed230..458bfda6fa 100644 --- a/uitest/src/com/vaadin/tests/components/select/SelectItemCaptionRefresh.java +++ b/uitest/src/com/vaadin/tests/components/select/SelectItemCaptionRefresh.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/slider/SliderDisable.java b/uitest/src/com/vaadin/tests/components/slider/SliderDisable.java index bd1d175119..a15e0d95ae 100644 --- a/uitest/src/com/vaadin/tests/components/slider/SliderDisable.java +++ b/uitest/src/com/vaadin/tests/components/slider/SliderDisable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/slider/SliderDisableTest.java b/uitest/src/com/vaadin/tests/components/slider/SliderDisableTest.java index 923d0f46ab..12d26b8f8f 100644 --- a/uitest/src/com/vaadin/tests/components/slider/SliderDisableTest.java +++ b/uitest/src/com/vaadin/tests/components/slider/SliderDisableTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -62,4 +62,4 @@ public class SliderDisableTest extends MultiBrowserTest { return handle.getCssValue("margin-left"); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/slider/SliderUpdateFromValueChange.java b/uitest/src/com/vaadin/tests/components/slider/SliderUpdateFromValueChange.java index 21b56b7972..89f834a42f 100644 --- a/uitest/src/com/vaadin/tests/components/slider/SliderUpdateFromValueChange.java +++ b/uitest/src/com/vaadin/tests/components/slider/SliderUpdateFromValueChange.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/splitpanel/SplitPanelInModalWindow.java b/uitest/src/com/vaadin/tests/components/splitpanel/SplitPanelInModalWindow.java index a1d0fcb42b..67ac15ce81 100644 --- a/uitest/src/com/vaadin/tests/components/splitpanel/SplitPanelInModalWindow.java +++ b/uitest/src/com/vaadin/tests/components/splitpanel/SplitPanelInModalWindow.java @@ -33,4 +33,4 @@ public class SplitPanelInModalWindow extends TestBase { return 4067; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/AddNonRenderedRow.java b/uitest/src/com/vaadin/tests/components/table/AddNonRenderedRow.java index 80b136d2ab..741c5f6cec 100644 --- a/uitest/src/com/vaadin/tests/components/table/AddNonRenderedRow.java +++ b/uitest/src/com/vaadin/tests/components/table/AddNonRenderedRow.java @@ -46,4 +46,4 @@ public class AddNonRenderedRow extends TestBase { protected Integer getTicketNumber() { return Integer.valueOf(8077); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/AddSelectionToRemovedRange.java b/uitest/src/com/vaadin/tests/components/table/AddSelectionToRemovedRange.java index 104380c96c..2d8a30cb12 100644 --- a/uitest/src/com/vaadin/tests/components/table/AddSelectionToRemovedRange.java +++ b/uitest/src/com/vaadin/tests/components/table/AddSelectionToRemovedRange.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/AddSelectionToRemovedRangeTest.java b/uitest/src/com/vaadin/tests/components/table/AddSelectionToRemovedRangeTest.java index f6a503db72..897511e41a 100644 --- a/uitest/src/com/vaadin/tests/components/table/AddSelectionToRemovedRangeTest.java +++ b/uitest/src/com/vaadin/tests/components/table/AddSelectionToRemovedRangeTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/AsyncPushUpdates.java b/uitest/src/com/vaadin/tests/components/table/AsyncPushUpdates.java new file mode 100644 index 0000000000..fcbfe1e0b0 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/AsyncPushUpdates.java @@ -0,0 +1,126 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import javax.servlet.annotation.WebServlet; + +import com.vaadin.annotations.Push; +import com.vaadin.annotations.VaadinServletConfiguration; +import com.vaadin.data.util.IndexedContainer; +import com.vaadin.server.VaadinRequest; +import com.vaadin.server.VaadinServlet; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Table; + +/** + * Test to see if VScrollTable handles Push updates correctly. + * + * @author Vaadin Ltd + */ +@Push +public class AsyncPushUpdates extends AbstractTestUI { + + public int clickCount = 0; + + @WebServlet(value = "/*", asyncSupported = true) + @VaadinServletConfiguration(productionMode = false, ui = AsyncPushUpdates.class) + public static class Servlet extends VaadinServlet { + } + + public static final String VALUE_PROPERTY_ID = "value"; + + private final IndexedContainer container = createContainer(); + private final Table table = new Table(); + + @Override + public void setup(VaadinRequest request) { + table.setWidth("100%"); + table.setContainerDataSource(container); + + Button button = new Button("START"); + button.addClickListener(new Button.ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + ++clickCount; + + container.removeAllItems(); + for (int i = 0; i < 100; i++) { + container.getContainerProperty(container.addItem(), + VALUE_PROPERTY_ID).setValue("A" + i); + } + + Runnable generateNewRows = new Runnable() { + public int id = 0; + + @Override + public void run() { + getSession().lock(); + try { + Thread.sleep(500); + ++id; + container.removeAllItems(); + for (int i = 0; i < 11; i++) { + container.getContainerProperty( + container.addItem(), VALUE_PROPERTY_ID) + .setValue( + clickCount + " - " + id + " - " + + i); + } + + } catch (InterruptedException e) { + // NOOP + } finally { + getSession().unlock(); + } + } + }; + new Thread(generateNewRows).start(); + } + }); + addComponent(table); + addComponent(button); + } + + private static IndexedContainer createContainer() { + IndexedContainer container = new IndexedContainer(); + container.addContainerProperty(VALUE_PROPERTY_ID, String.class, ""); + return container; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "Make sure there are no duplicates on the table."; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 13562; + } + +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/table/AsyncPushUpdatesTest.java b/uitest/src/com/vaadin/tests/components/table/AsyncPushUpdatesTest.java new file mode 100644 index 0000000000..b33204cc44 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/AsyncPushUpdatesTest.java @@ -0,0 +1,46 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.NoSuchElementException; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.TableElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test to see if VScrollTable handles Push updates correctly. + * + * @author Vaadin Ltd + */ +public class AsyncPushUpdatesTest extends MultiBrowserTest { + + @Test(expected = NoSuchElementException.class) + public void InsertedRowsAreNotDuplicated() { + openTestURL(); + + WebElement button = $(ButtonElement.class).first(); + + button.click(); + + $(TableElement.class).first().getCell(12, 0); + Assert.fail("Duplicates are present."); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/ContainerSizeChangeDuringTablePaint.java b/uitest/src/com/vaadin/tests/components/table/ContainerSizeChangeDuringTablePaint.java index 0f385176bf..12f28332f4 100644 --- a/uitest/src/com/vaadin/tests/components/table/ContainerSizeChangeDuringTablePaint.java +++ b/uitest/src/com/vaadin/tests/components/table/ContainerSizeChangeDuringTablePaint.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/CtrlShiftMultiselectTest.java b/uitest/src/com/vaadin/tests/components/table/CtrlShiftMultiselectTest.java new file mode 100644 index 0000000000..255a798594 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/CtrlShiftMultiselectTest.java @@ -0,0 +1,80 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import java.io.IOException; +import java.util.List; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; +import org.openqa.selenium.remote.DesiredCapabilities; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class CtrlShiftMultiselectTest extends MultiBrowserTest { + + @Override + public List<DesiredCapabilities> getBrowsersToTest() { + List<DesiredCapabilities> browsers = super.getBrowsersToTest(); + // Shift + click doesn't select all rows correctly on these browsers + browsers.remove(Browser.FIREFOX.getDesiredCapabilities()); + browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities()); + + return browsers; + } + + @Override + protected DesiredCapabilities getDesiredCapabilities() { + DesiredCapabilities cap = new DesiredCapabilities( + super.getDesiredCapabilities()); + cap.setCapability("requireWindowFocus", true); + return cap; + } + + @Test + public void testSelectionRangeDragging() throws IOException { + openTestURL(); + clickRow(3); + new Actions(driver).keyDown(Keys.SHIFT).perform(); + clickRow(8); + new Actions(driver).keyUp(Keys.SHIFT).perform(); + dragRows(5, 700, 0); + compareScreen("draggedMultipleRows"); + new Actions(driver).release().perform(); + } + + private void clickRow(int index) { + List<WebElement> rows = getAllRows(); + rows.get(index).click(); + } + + private void dragRows(int dragIdx, int xOffset, int yOffset) { + List<WebElement> rows = getAllRows(); + new Actions(driver).moveToElement(rows.get(dragIdx)).clickAndHold() + .moveByOffset(5, 0).perform(); + new Actions(driver).moveByOffset(xOffset - 5, yOffset).perform(); + + } + + private List<WebElement> getAllRows() { + WebElement table = vaadinElement("/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]"); + return table.findElements(By.cssSelector(".v-table-table tr")); + + } +} diff --git a/uitest/src/com/vaadin/tests/components/table/DndEmptyTable.java b/uitest/src/com/vaadin/tests/components/table/DndEmptyTable.java new file mode 100644 index 0000000000..baac7ce057 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/DndEmptyTable.java @@ -0,0 +1,71 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import com.vaadin.event.dd.DragAndDropEvent; +import com.vaadin.event.dd.DropHandler; +import com.vaadin.event.dd.acceptcriteria.AcceptAll; +import com.vaadin.event.dd.acceptcriteria.AcceptCriterion; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.DragAndDropWrapper; +import com.vaadin.ui.DragAndDropWrapper.DragStartMode; +import com.vaadin.ui.Label; +import com.vaadin.ui.Table; + +/** + * Test UI for empty table: empty table (without any data) throws client side + * exception if it's a target for DnD. + * + * @since + * @author Vaadin Ltd + */ +public class DndEmptyTable extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + Label source = new Label("label"); + DragAndDropWrapper wrapper = new DragAndDropWrapper(source); + wrapper.setDragStartMode(DragStartMode.WRAPPER); + addComponent(wrapper); + + Table target = new Table(); + target.setWidth(100, Unit.PERCENTAGE); + addComponent(target); + target.setDropHandler(new DropHandler() { + + @Override + public AcceptCriterion getAcceptCriterion() { + return AcceptAll.get(); + } + + @Override + public void drop(DragAndDropEvent event) { + } + }); + } + + @Override + protected String getTestDescription() { + return "Drag and drop into empty table should not throws client side exception."; + } + + @Override + protected Integer getTicketNumber() { + return 13655; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/DndEmptyTableTest.java b/uitest/src/com/vaadin/tests/components/table/DndEmptyTableTest.java new file mode 100644 index 0000000000..4c682637b1 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/DndEmptyTableTest.java @@ -0,0 +1,49 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.By; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test for empty table as a DnD target: it should not throws client side + * exception. + * + * @since + * @author Vaadin Ltd + */ +public class DndEmptyTableTest extends MultiBrowserTest { + + @Test + public void testDndEmptyTable() { + setDebug(true); + openTestURL(); + + WebElement source = driver.findElement(By.className("v-ddwrapper")); + WebElement target = driver.findElement(By.className("v-table-body")); + Actions actions = new Actions(driver); + actions.clickAndHold(source).moveToElement(target).release(); + + Assert.assertFalse(isElementPresent(By + .className("v-Notification-error"))); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/EditableModeChange.java b/uitest/src/com/vaadin/tests/components/table/EditableModeChange.java index 5db294088a..fa8ab8f0f5 100644 --- a/uitest/src/com/vaadin/tests/components/table/EditableModeChange.java +++ b/uitest/src/com/vaadin/tests/components/table/EditableModeChange.java @@ -97,4 +97,4 @@ public class EditableModeChange extends TestBase { protected Integer getTicketNumber() { return 5427; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/EditableTableFocus.java b/uitest/src/com/vaadin/tests/components/table/EditableTableFocus.java index b5c8aa0296..7686549709 100644 --- a/uitest/src/com/vaadin/tests/components/table/EditableTableFocus.java +++ b/uitest/src/com/vaadin/tests/components/table/EditableTableFocus.java @@ -32,4 +32,4 @@ public class EditableTableFocus extends TestBase { protected Integer getTicketNumber() { return 7965; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/EmptyTable.java b/uitest/src/com/vaadin/tests/components/table/EmptyTable.java index d6c30efa5a..ad9c70444d 100644 --- a/uitest/src/com/vaadin/tests/components/table/EmptyTable.java +++ b/uitest/src/com/vaadin/tests/components/table/EmptyTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/EmptyTableTest.java b/uitest/src/com/vaadin/tests/components/table/EmptyTableTest.java index 229dc23b9a..2332815ed6 100644 --- a/uitest/src/com/vaadin/tests/components/table/EmptyTableTest.java +++ b/uitest/src/com/vaadin/tests/components/table/EmptyTableTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -17,9 +17,8 @@ package com.vaadin.tests.components.table; import org.junit.Assert; import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.NoSuchElementException; +import com.vaadin.testbench.elements.NotificationElement; import com.vaadin.tests.tb3.MultiBrowserTest; public class EmptyTableTest extends MultiBrowserTest { @@ -33,12 +32,9 @@ public class EmptyTableTest extends MultiBrowserTest { } private void ensureNoErrors() { - try { - getDriver().findElement(By.className("v-Notification")); - } catch (NoSuchElementException e) { - return; + if (isElementPresent(NotificationElement.class)) { + Assert.fail("Error notification was shown!"); } - Assert.fail("Error notification was shown!"); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/ExpandingContainerVisibleRowRaceConditionTest.java b/uitest/src/com/vaadin/tests/components/table/ExpandingContainerVisibleRowRaceConditionTest.java index 73dd7b1f81..1602f1bae5 100644 --- a/uitest/src/com/vaadin/tests/components/table/ExpandingContainerVisibleRowRaceConditionTest.java +++ b/uitest/src/com/vaadin/tests/components/table/ExpandingContainerVisibleRowRaceConditionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/FixedHeightTable.java b/uitest/src/com/vaadin/tests/components/table/FixedHeightTable.java index 174c166320..22d6846dea 100644 --- a/uitest/src/com/vaadin/tests/components/table/FixedHeightTable.java +++ b/uitest/src/com/vaadin/tests/components/table/FixedHeightTable.java @@ -36,4 +36,4 @@ public class FixedHeightTable extends TestBase { protected Integer getTicketNumber() { return 3814; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/FocusOnSelectedItem.java b/uitest/src/com/vaadin/tests/components/table/FocusOnSelectedItem.java new file mode 100644 index 0000000000..4c0bea77ac --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/FocusOnSelectedItem.java @@ -0,0 +1,84 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Table; + +/** + * Test to see if the correct row gets the focus when the row is selected from + * the serverside and forces the table to scroll down + * + * @author Vaadin Ltd + */ +public class FocusOnSelectedItem extends AbstractTestUI { + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server. + * VaadinRequest) + */ + @Override + protected void setup(VaadinRequest request) { + + final Table table = new Table(); + table.setSelectable(true); + table.setImmediate(true); + + table.addContainerProperty("Property", String.class, null); + + for (int i = 0; i < 200; i++) { + table.addItem(new String[] { "Item " + i }, "Item " + i); + } + addComponent(table); + + Button button = new Button("Select"); + button.addClickListener(new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + table.setValue("Item 198"); + table.setCurrentPageFirstItemId("Item 198"); + table.focus(); + } + }); + addComponent(button); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "Test whether the selected row retains focus."; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 10522; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/FocusOnSelectedItemTest.java b/uitest/src/com/vaadin/tests/components/table/FocusOnSelectedItemTest.java new file mode 100644 index 0000000000..14a0718325 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/FocusOnSelectedItemTest.java @@ -0,0 +1,66 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.TableElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test to see if the correct row gets the focus when the row is selected from + * the serverside and forces the table to scroll down + * + * @author Vaadin Ltd + */ +public class FocusOnSelectedItemTest extends MultiBrowserTest { + + @Test + public void selectAndScrollFocusesSelectedRow() { + openTestURL(); + + WebElement selectButton = $(ButtonElement.class).caption("Select") + .first(); + selectButton.click(); + WebElement supposedlyFocusedRow = null; + WebElement selectedRow = null; + WebElement focusedStyleRow = null; + + Assert.assertTrue("No row was selected", + isElementPresent(By.className("v-selected"))); + + selectedRow = getDriver().findElement(By.className("v-selected")); + + supposedlyFocusedRow = $(TableElement.class).first().getCell(198, 0); + + Assert.assertTrue("Incorrect row was selected", selectedRow + .getLocation().getY() == supposedlyFocusedRow.getLocation() + .getY()); + + Assert.assertTrue("No row had the focused style.", + isElementPresent(By.className("v-table-focus"))); + + focusedStyleRow = getDriver() + .findElement(By.className("v-table-focus")); + Assert.assertTrue("Incorrect row has the focused style.", selectedRow + .getLocation().getY() == focusedStyleRow.getLocation().getY()); + + } +} diff --git a/uitest/src/com/vaadin/tests/components/table/HiddenComponentCells.java b/uitest/src/com/vaadin/tests/components/table/HiddenComponentCells.java index 32046932cc..fa88325429 100644 --- a/uitest/src/com/vaadin/tests/components/table/HiddenComponentCells.java +++ b/uitest/src/com/vaadin/tests/components/table/HiddenComponentCells.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/LastColumnNegative.java b/uitest/src/com/vaadin/tests/components/table/LastColumnNegative.java index b7379b4f2c..87ff6d9d7b 100644 --- a/uitest/src/com/vaadin/tests/components/table/LastColumnNegative.java +++ b/uitest/src/com/vaadin/tests/components/table/LastColumnNegative.java @@ -77,4 +77,4 @@ public class LastColumnNegative extends TestBase { return 8411; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/LeftColumnAlignment.java b/uitest/src/com/vaadin/tests/components/table/LeftColumnAlignment.java new file mode 100644 index 0000000000..e783951d86 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/LeftColumnAlignment.java @@ -0,0 +1,90 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import com.vaadin.annotations.Theme; +import com.vaadin.data.util.BeanItemContainer; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.Table; +import com.vaadin.ui.Table.Align; + +/** + * Test UI for issue #13399 : Left alignment should not be set explicitly + * instead of relying on default behavior + * + * @author Vaadin Ltd + */ +@Theme("tests-table") +public class LeftColumnAlignment extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + final Table table = new Table(); + + BeanItemContainer<Bean> container = new BeanItemContainer<Bean>( + Bean.class); + Bean bean = new Bean(); + bean.setName("property"); + container.addBean(bean); + table.setContainerDataSource(container); + + table.setFooterVisible(true); + + table.setWidth(100, Unit.PIXELS); + + table.setColumnAlignment("name", Align.RIGHT); + + addComponent(table); + + Button button = new Button("Align to Left"); + button.addClickListener(new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + table.setColumnAlignment("name", Align.LEFT); + } + }); + addComponent(button); + } + + @Override + protected String getTestDescription() { + return "Left alignment should not be set explicitly instead of relying on default behavior"; + } + + @Override + protected Integer getTicketNumber() { + return 13399; + } + + public static class Bean { + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/LeftColumnAlignmentTest.java b/uitest/src/com/vaadin/tests/components/table/LeftColumnAlignmentTest.java new file mode 100644 index 0000000000..3d613fd726 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/LeftColumnAlignmentTest.java @@ -0,0 +1,58 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test class for issue #13399 : Left alignment should not be set explicitly + * instead of relying on default behavior + * + * @author Vaadin Ltd + */ +public class LeftColumnAlignmentTest extends MultiBrowserTest { + + @Test + public void testLeftColumnAlignment() throws Exception { + openTestURL(); + + // Do align columns to the left + WebElement webElement = driver.findElement(By.className("v-button")); + webElement.click(); + + Assert.assertTrue("Table caption is not aligned to the left", + isElementPresent(By + .className("v-table-caption-container-align-left"))); + + WebElement footer = driver.findElement(By + .className("v-table-footer-container")); + + Assert.assertEquals("Table footer is not aligned to the left", "left", + footer.getCssValue("text-align")); + + WebElement cell = driver.findElement(By + .className("v-table-cell-wrapper")); + + Assert.assertEquals("Table cell is not aligned to the left", "left", + cell.getCssValue("text-align")); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/MultiSelectWithRemovedRow.java b/uitest/src/com/vaadin/tests/components/table/MultiSelectWithRemovedRow.java index 12ae4a3c4d..9c063fd42e 100644 --- a/uitest/src/com/vaadin/tests/components/table/MultiSelectWithRemovedRow.java +++ b/uitest/src/com/vaadin/tests/components/table/MultiSelectWithRemovedRow.java @@ -90,4 +90,4 @@ public class MultiSelectWithRemovedRow extends TestBase { protected Integer getTicketNumber() { return Integer.valueOf(8584); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/OddEvenRowStyling.java b/uitest/src/com/vaadin/tests/components/table/OddEvenRowStyling.java index 837af06d9e..808b05e233 100644 --- a/uitest/src/com/vaadin/tests/components/table/OddEvenRowStyling.java +++ b/uitest/src/com/vaadin/tests/components/table/OddEvenRowStyling.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/RefreshRenderedCellsOnlyIfAttached.java b/uitest/src/com/vaadin/tests/components/table/RefreshRenderedCellsOnlyIfAttached.java index 3e233c69c2..809cb67226 100644 --- a/uitest/src/com/vaadin/tests/components/table/RefreshRenderedCellsOnlyIfAttached.java +++ b/uitest/src/com/vaadin/tests/components/table/RefreshRenderedCellsOnlyIfAttached.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/RemoveItemOnClick.java b/uitest/src/com/vaadin/tests/components/table/RemoveItemOnClick.java index 8f56965ddb..cb9dc57d09 100644 --- a/uitest/src/com/vaadin/tests/components/table/RemoveItemOnClick.java +++ b/uitest/src/com/vaadin/tests/components/table/RemoveItemOnClick.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/SelectAllRows.java b/uitest/src/com/vaadin/tests/components/table/SelectAllRows.java index 6007ea2984..6cc6a68a7d 100644 --- a/uitest/src/com/vaadin/tests/components/table/SelectAllRows.java +++ b/uitest/src/com/vaadin/tests/components/table/SelectAllRows.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/SelectAllRowsTest.java b/uitest/src/com/vaadin/tests/components/table/SelectAllRowsTest.java index cf6a92c283..0fc09adf40 100644 --- a/uitest/src/com/vaadin/tests/components/table/SelectAllRowsTest.java +++ b/uitest/src/com/vaadin/tests/components/table/SelectAllRowsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -47,10 +47,11 @@ public class SelectAllRowsTest extends MultiBrowserTest { @Override public List<DesiredCapabilities> getBrowsersToTest() { - // Pressing Shift modifier key does not work with Firefox + // Pressing Shift modifier key does not work with Firefox and PhantomJS ArrayList<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>( super.getBrowsersToTest()); browsers.remove(Browser.FIREFOX.getDesiredCapabilities()); + browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities()); return browsers; } diff --git a/uitest/src/com/vaadin/tests/components/table/SelectionRangeDragging.html b/uitest/src/com/vaadin/tests/components/table/SelectionRangeDragging.html deleted file mode 100644 index 1e911699d1..0000000000 --- a/uitest/src/com/vaadin/tests/components/table/SelectionRangeDragging.html +++ /dev/null @@ -1,52 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="" /> -<title>New Test</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.table.CtrlShiftMultiselect?restartApplication</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[5]/domChild[1]/domChild[0]</td> - <td>112,12</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[10]/domChild[1]/domChild[0]</td> - <td>82,16:shift</td> -</tr> -<tr> - <td>drag</td> - <td>vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[8]/domChild[1]/domChild[0]</td> - <td>87,1</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[0]</td> - <td>700,210</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>multiple-rows-dragged</td> -</tr> -<tr> - <td>drop</td> - <td>vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[0]</td> - <td>700,210</td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java b/uitest/src/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java index aebb494247..22e60406a6 100644 --- a/uitest/src/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java +++ b/uitest/src/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java @@ -53,4 +53,4 @@ public class SetCurrentPageFirstItemId extends TestBase { protected Integer getTicketNumber() { return 7607; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/SetCurrentPageFirstItemIndex.java b/uitest/src/com/vaadin/tests/components/table/SetCurrentPageFirstItemIndex.java index 574f1d1862..5e1c4cca66 100644 --- a/uitest/src/com/vaadin/tests/components/table/SetCurrentPageFirstItemIndex.java +++ b/uitest/src/com/vaadin/tests/components/table/SetCurrentPageFirstItemIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/SortLabelsInTable.java b/uitest/src/com/vaadin/tests/components/table/SortLabelsInTable.java index ecd2e3e9df..0dc8584169 100644 --- a/uitest/src/com/vaadin/tests/components/table/SortLabelsInTable.java +++ b/uitest/src/com/vaadin/tests/components/table/SortLabelsInTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/TableAndBrowserContextMenu.java b/uitest/src/com/vaadin/tests/components/table/TableAndBrowserContextMenu.java index 039b02e801..eb5beec6bd 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableAndBrowserContextMenu.java +++ b/uitest/src/com/vaadin/tests/components/table/TableAndBrowserContextMenu.java @@ -154,4 +154,4 @@ public class TableAndBrowserContextMenu extends TestBase implements public void handleAction(Action action, Object sender, Object target) { getMainWindow().showNotification("Action: " + action.getCaption()); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java b/uitest/src/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java index a37cf48579..6fa86543cb 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java +++ b/uitest/src/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java @@ -85,4 +85,4 @@ public class TableClickValueChangeInteraction extends TestBase { result.addComponent(valueChangeLabel); return result; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableExtraScrollbars.java b/uitest/src/com/vaadin/tests/components/table/TableExtraScrollbars.java index fa10ab344c..ccf521c500 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableExtraScrollbars.java +++ b/uitest/src/com/vaadin/tests/components/table/TableExtraScrollbars.java @@ -58,4 +58,4 @@ public class TableExtraScrollbars extends AbstractTestCase { protected Integer getTicketNumber() { return 4489; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableFirstRowFlicker.java b/uitest/src/com/vaadin/tests/components/table/TableFirstRowFlicker.java index 95d5ea59d5..3f3255f525 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableFirstRowFlicker.java +++ b/uitest/src/com/vaadin/tests/components/table/TableFirstRowFlicker.java @@ -85,4 +85,4 @@ public class TableFirstRowFlicker extends LegacyApplication { return cont; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelection.java b/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelection.java index 20170efa13..8f6e6c685f 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelection.java +++ b/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelectionTest.java b/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelectionTest.java index 5075e22f1b..30bddc2666 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelectionTest.java +++ b/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/TablePageLengthCalculation.java b/uitest/src/com/vaadin/tests/components/table/TablePageLengthCalculation.java index 55089ff56b..e56f686218 100644 --- a/uitest/src/com/vaadin/tests/components/table/TablePageLengthCalculation.java +++ b/uitest/src/com/vaadin/tests/components/table/TablePageLengthCalculation.java @@ -47,4 +47,4 @@ public class TablePageLengthCalculation extends TestBase { protected Integer getTicketNumber() { return 4374; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java b/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java index ab0198f39c..c21a38a0ac 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java +++ b/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCallsTest.java b/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCallsTest.java index 68c8dc9884..968b742aa9 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCallsTest.java +++ b/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCallsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/TableScrollOnFocus.java b/uitest/src/com/vaadin/tests/components/table/TableScrollOnFocus.java index bfbc4f82c1..7e75e8a32d 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableScrollOnFocus.java +++ b/uitest/src/com/vaadin/tests/components/table/TableScrollOnFocus.java @@ -47,4 +47,4 @@ public class TableScrollOnFocus extends TestBase { protected Integer getTicketNumber() { return 6774; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableScrollUpOnSelect.java b/uitest/src/com/vaadin/tests/components/table/TableScrollUpOnSelect.java new file mode 100644 index 0000000000..0e2e1b76e1 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableScrollUpOnSelect.java @@ -0,0 +1,89 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Table; +import com.vaadin.ui.TextField; +import com.vaadin.ui.VerticalLayout; +import com.vaadin.ui.Window; + +/** + * Test to see if Table appears to scroll up under an obscure set of conditions + * (Scrolled down, set to expand, selecting updates a TextField that precedes + * the Table in a VerticalLayout.) (#10106) + * + * @author Vaadin Ltd + */ +public class TableScrollUpOnSelect extends AbstractTestUI { + public TextField text = null; + + @Override + protected void setup(VaadinRequest request) { + text = new TextField(); + text.setImmediate(true); + + final Table table = new Table(null); + table.addContainerProperty("value", Integer.class, 0); + for (int i = 0; i < 50; ++i) { + table.addItem(new Object[] { i }, i); + } + table.setSizeFull(); + table.setSelectable(true); + table.setImmediate(true); + table.setEditable(false); + + final VerticalLayout layout = new VerticalLayout(); + + table.addValueChangeListener(new ValueChangeListener() { + + @Override + public void valueChange(ValueChangeEvent event) { + if (table.getValue() != null) { + text.setValue(table.getValue().toString()); + } + } + + }); + + table.setCurrentPageFirstItemIndex(49); + + layout.setSizeFull(); + layout.addComponent(text); + layout.addComponent(table); + layout.setExpandRatio(table, 1.0f); + Window window = new Window(); + window.setHeight("600px"); + window.setWidth("400px"); + window.setModal(true); + window.setContent(layout); + getUI().addWindow(window); + } + + @Override + protected String getTestDescription() { + return "Table scrolls up when selecting a row"; + } + + @Override + protected Integer getTicketNumber() { + return 13358; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableScrollUpOnSelectTest.java b/uitest/src/com/vaadin/tests/components/table/TableScrollUpOnSelectTest.java new file mode 100644 index 0000000000..b2fde31b93 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableScrollUpOnSelectTest.java @@ -0,0 +1,59 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.ExpectedCondition; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.elements.TableElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test to see if Table appears to scroll up under an obscure set of conditions + * (Scrolled down, set to expand, selecting updates a TextField that precedes + * the Table in a VerticalLayout.) (#10106) + * + * @author Vaadin Ltd + */ +public class TableScrollUpOnSelectTest extends MultiBrowserTest { + + @Test + public void TestThatSelectingDoesntScroll() { + openTestURL(); + + // WebElement table = driver.findElement(By.vaadin("//Table")); + WebElement row = $(TableElement.class).first().getCell(49, 0); + final WebElement scrollPositionDisplay = getDriver().findElement( + By.className("v-table-scrollposition")); + waitUntilNot(new ExpectedCondition<Boolean>() { + + @Override + public Boolean apply(WebDriver input) { + return scrollPositionDisplay.isDisplayed(); + } + }, 10); + + int rowLocation = row.getLocation().getY(); + row.click(); + int newRowLocation = row.getLocation().getY(); + + Assert.assertTrue("Table has scrolled.", rowLocation == newRowLocation); + } +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableScrollingWithSQLContainer.java b/uitest/src/com/vaadin/tests/components/table/TableScrollingWithSQLContainer.java index 764207ff13..61f8952041 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableScrollingWithSQLContainer.java +++ b/uitest/src/com/vaadin/tests/components/table/TableScrollingWithSQLContainer.java @@ -96,4 +96,4 @@ public class TableScrollingWithSQLContainer extends UI { e.printStackTrace(); } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableScrollingWithSQLContainerTest.java b/uitest/src/com/vaadin/tests/components/table/TableScrollingWithSQLContainerTest.java index 97c780e0e8..01f75f7875 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableScrollingWithSQLContainerTest.java +++ b/uitest/src/com/vaadin/tests/components/table/TableScrollingWithSQLContainerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/TableSizeInTabsheet.java b/uitest/src/com/vaadin/tests/components/table/TableSizeInTabsheet.java index f84f83718d..da37d1f2d2 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableSizeInTabsheet.java +++ b/uitest/src/com/vaadin/tests/components/table/TableSizeInTabsheet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -66,4 +66,4 @@ public class TableSizeInTabsheet extends AbstractTestUI { return 12687; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableSizeInTabsheetTest.java b/uitest/src/com/vaadin/tests/components/table/TableSizeInTabsheetTest.java index 29fc5a2e52..a984ed81e5 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableSizeInTabsheetTest.java +++ b/uitest/src/com/vaadin/tests/components/table/TableSizeInTabsheetTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/TableSorting.java b/uitest/src/com/vaadin/tests/components/table/TableSorting.java index 6417e8e853..85819784c0 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableSorting.java +++ b/uitest/src/com/vaadin/tests/components/table/TableSorting.java @@ -65,4 +65,4 @@ public class TableSorting extends TestBase { protected Integer getTicketNumber() { return 4537; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableSortingIndicator.java b/uitest/src/com/vaadin/tests/components/table/TableSortingIndicator.java new file mode 100644 index 0000000000..93fe8d7d9e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableSortingIndicator.java @@ -0,0 +1,129 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import java.util.Random; + +import com.vaadin.data.Container; +import com.vaadin.data.util.BeanItemContainer; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.Table; + +/** + * Test if the table sorting indicators update correctly when the table is + * sorted serverside + * + * @author Vaadin Ltd + */ +public class TableSortingIndicator extends AbstractTestUI { + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server. + * VaadinRequest) + */ + @Override + protected void setup(VaadinRequest request) { + final Table table = new Table("Test table", buildContainer()); + table.setSizeFull(); + addComponent(table); + Button sortButton = new Button("Sort", new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + table.sort(new Object[] { "val1" }, new boolean[] { false }); + } + }); + addComponent(sortButton); + } + + private Container buildContainer() { + BeanItemContainer<TestBean> container = new BeanItemContainer<TestBean>( + TestBean.class); + for (int i = 0; i < 100; ++i) { + TestBean item = new TestBean(); + item.setVal1(i); + item.setVal2(randomWord()); + item.setVal3(randomWord()); + container.addBean(item); + } + return container; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "The table should have visible sorting indicators."; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 8978; + } + + public class TestBean { + private Integer val1; + private String val2; + private String val3; + + public Integer getVal1() { + return val1; + } + + public void setVal1(Integer val1) { + this.val1 = val1; + } + + public String getVal2() { + return val2; + } + + public void setVal2(String val2) { + this.val2 = val2; + } + + public String getVal3() { + return val3; + } + + public void setVal3(String val3) { + this.val3 = val3; + } + } + + private String randomWord() { + Random rng = new Random(); + char[] word = new char[3 + rng.nextInt(10)]; + for (int i = 0; i < word.length; ++i) { + word[i] = (char) ('a' + rng.nextInt(26)); + } + return new String(word); + } +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableSortingIndicatorTest.java b/uitest/src/com/vaadin/tests/components/table/TableSortingIndicatorTest.java new file mode 100644 index 0000000000..36a51b35e3 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableSortingIndicatorTest.java @@ -0,0 +1,65 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Tests if the sort indicator is visible after the table has been sorted from + * the serverside. + * + * @author Vaadin Ltd + */ +public class TableSortingIndicatorTest extends MultiBrowserTest { + private static final String TABLE_HEADER_DESC_INDICATOR = "v-table-header-cell-desc"; + private static final String TABLE_HEADER_ASC_INDICATOR = "v-table-header-cell-asc"; + + @Test + public void testTableSortingIndicatorIsVisibleAfterServersideSort() { + openTestURL(); + + Assert.assertFalse("Descending indicator was prematurely visible", + isElementPresent(By.className(TABLE_HEADER_DESC_INDICATOR))); + Assert.assertFalse("Ascending indicator was prematurely visible", + isElementPresent(By.className(TABLE_HEADER_ASC_INDICATOR))); + WebElement button = driver.findElement(By + .vaadin("//Button[caption=\"Sort\"]")); + button.click(); + Assert.assertTrue("Indicator did not become visible", + isElementPresent(By.className(TABLE_HEADER_DESC_INDICATOR))); + + Assert.assertFalse("Ascending sort indicator was wrongly visible", + isElementPresent(By.className(TABLE_HEADER_ASC_INDICATOR))); + WebElement manualSort = driver.findElement(By + .className(TABLE_HEADER_DESC_INDICATOR)); + manualSort.click(); + Assert.assertFalse("Table sort indicator didn't change", + isElementPresent(By.className(TABLE_HEADER_DESC_INDICATOR))); + Assert.assertTrue("Ascending sort indicator didn't become visible", + isElementPresent(By.className(TABLE_HEADER_ASC_INDICATOR))); + button.click(); + Assert.assertTrue( + "Descending sort indicator didn't appear on the second serverside sort.", + isElementPresent(By.className(TABLE_HEADER_DESC_INDICATOR))); + Assert.assertFalse("Ascending sort indicator didn't disappear", + isElementPresent(By.className(TABLE_HEADER_ASC_INDICATOR))); + } +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableSqlContainer.java b/uitest/src/com/vaadin/tests/components/table/TableSqlContainer.java index 5191b1b86e..0b40af94a2 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableSqlContainer.java +++ b/uitest/src/com/vaadin/tests/components/table/TableSqlContainer.java @@ -139,4 +139,4 @@ public class TableSqlContainer extends AbstractTestUI { return 11224; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableToggleVisibility.java b/uitest/src/com/vaadin/tests/components/table/TableToggleVisibility.java index 22cdf7f312..f89d2d2934 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableToggleVisibility.java +++ b/uitest/src/com/vaadin/tests/components/table/TableToggleVisibility.java @@ -168,4 +168,4 @@ public class TableToggleVisibility extends AbstractTestCase { return 6494; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableWidthItemRemove.java b/uitest/src/com/vaadin/tests/components/table/TableWidthItemRemove.java new file mode 100644 index 0000000000..79a85cd49b --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableWidthItemRemove.java @@ -0,0 +1,92 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.Table; + +/** + * Test whether adding the first item to a table calculates the table width + * correctly + * + * @author Vaadin Ltd + */ +public class TableWidthItemRemove extends AbstractTestUI { + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server. + * VaadinRequest) + */ + @Override + protected void setup(VaadinRequest request) { + final Table table = new Table("My table"); + table.addContainerProperty("firstName", String.class, null); + table.addContainerProperty("lastName", String.class, null); + table.addContainerProperty("year", Integer.class, null); + table.setColumnWidth("firstName", 200); + table.setColumnWidth("lastName", 100); + table.setColumnWidth("year", 50); + + Button cleanButton = new Button("Clean"); + cleanButton.addClickListener(new ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + table.removeAllItems(); + } + }); + addComponent(cleanButton); + + Button populateButton = new Button("Populate"); + populateButton.addClickListener(new ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + table.addItem( + new Object[] { "John", "Doe", new Integer(1980) }, + Math.random() * 1000); + } + }); + addComponent(populateButton); + + addComponent(table); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "The table should retain the correct width on item remove and add."; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 13592; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableWidthItemRemoveTest.java b/uitest/src/com/vaadin/tests/components/table/TableWidthItemRemoveTest.java new file mode 100644 index 0000000000..f96641be4c --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableWidthItemRemoveTest.java @@ -0,0 +1,46 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test whether adding the first item to a table calculates the table width + * correctly + * + * @author Vaadin Ltd + */ +public class TableWidthItemRemoveTest extends MultiBrowserTest { + @Test + public void testWidthResizeOnItemAdd() { + openTestURL(); + + WebElement populateButton = driver.findElement(By + .vaadin("//Button[caption=\"Populate\"]")); + WebElement table = driver.findElement(By + .vaadin("//Table[caption=\"My table\"]")); + int original_width = table.getSize().getWidth(); + populateButton.click(); + Assert.assertTrue("Width changed on item add.", original_width == table + .getSize().getWidth()); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.java b/uitest/src/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.java index efa1b1bdab..c571329d14 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.java +++ b/uitest/src/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/table/TableWithPolling.java b/uitest/src/com/vaadin/tests/components/table/TableWithPolling.java new file mode 100644 index 0000000000..fdd5c2901a --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableWithPolling.java @@ -0,0 +1,60 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Table; + +public class TableWithPolling extends AbstractTestUI { + + @Override + protected String getTestDescription() { + return "Polling shouldn't affect table column resizing in any way."; + } + + @Override + protected Integer getTicketNumber() { + return 13432; + } + + @Override + protected void setup(VaadinRequest request) { + + Table table = new Table("This is my Table"); + + table.addContainerProperty("First Name", String.class, null); + table.addContainerProperty("Last Name", String.class, null); + table.addContainerProperty("Year", Integer.class, null); + + table.addItem(new Object[] { "Nicolaus", "Copernicus", + new Integer(1473) }, new Integer(1)); + table.addItem(new Object[] { "Tycho", "Brahe", new Integer(1546) }, + new Integer(2)); + table.addItem(new Object[] { "Giordano", "Bruno", new Integer(1548) }, + new Integer(3)); + table.addItem(new Object[] { "Galileo", "Galilei", new Integer(1564) }, + new Integer(4)); + table.addItem(new Object[] { "Johannes", "Kepler", new Integer(1571) }, + new Integer(5)); + table.addItem(new Object[] { "Isaac", "Newton", new Integer(1643) }, + new Integer(6)); + + addComponent(table); + + setPollInterval(1000); + } +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableWithPollingTest.java b/uitest/src/com/vaadin/tests/components/table/TableWithPollingTest.java new file mode 100644 index 0000000000..6aae1e27fc --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableWithPollingTest.java @@ -0,0 +1,65 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import java.util.List; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; +import org.openqa.selenium.remote.DesiredCapabilities; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class TableWithPollingTest extends MultiBrowserTest { + + @Test + public void testColumnResizing() throws Exception { + openTestURL(); + + WebElement headerCell = driver.findElement(By + .xpath("(//td[contains(@class, 'v-table-header-cell')])[1]")); + WebElement bodyCell = driver.findElement(By + .xpath("(//td[contains(@class, 'v-table-cell-content')])[1]")); + WebElement resizer = driver.findElement(By + .xpath("(//div[contains(@class, 'v-table-resizer')])[1]")); + + final int offset = 50; + final int headerCellWidth = headerCell.getSize().width; + final int bodyCellWidth = bodyCell.getSize().width; + + new Actions(driver).clickAndHold(resizer).moveByOffset(offset, 0) + .perform(); + sleep(2000); + new Actions(driver).release().perform(); + + Assert.assertEquals(headerCellWidth + offset, + headerCell.getSize().width); + Assert.assertEquals(bodyCellWidth + offset, bodyCell.getSize().width); + } + + @Override + public List<DesiredCapabilities> getBrowsersToTest() { + // Selenium has issues with drag-and-drop on IE8 making it impossible to + // drag a target as small as the table resizer. So we'll just have to + // ignore IE8 completely. + List<DesiredCapabilities> browsers = super.getBrowsersToTest(); + browsers.remove(Browser.IE8.getDesiredCapabilities()); + return browsers; + } +} diff --git a/uitest/src/com/vaadin/tests/components/table/WideSelectableTable.java b/uitest/src/com/vaadin/tests/components/table/WideSelectableTable.java index c820dc08d5..60e7db5c0d 100644 --- a/uitest/src/com/vaadin/tests/components/table/WideSelectableTable.java +++ b/uitest/src/com/vaadin/tests/components/table/WideSelectableTable.java @@ -42,4 +42,4 @@ public class WideSelectableTable extends TestBase { protected Integer getTicketNumber() { return 6788; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/EmptyTabSheetTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/EmptyTabSheetTest.java index dabc9c8e0b..cebb00c11b 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/EmptyTabSheetTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/EmptyTabSheetTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -27,4 +27,4 @@ public class EmptyTabSheetTest extends MultiBrowserTest { compareScreen("empty"); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/PreventTabChangeTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/PreventTabChangeTest.java index 31a59aaed6..dd0d8fb44f 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/PreventTabChangeTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/PreventTabChangeTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -59,4 +59,4 @@ public class PreventTabChangeTest extends MultiBrowserTest { .vaadin("//TabSheet#tabpanel")); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/ScrollbarsInNestedTabsheets.java b/uitest/src/com/vaadin/tests/components/tabsheet/ScrollbarsInNestedTabsheets.java index de250539ff..12da99b7f4 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/ScrollbarsInNestedTabsheets.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/ScrollbarsInNestedTabsheets.java @@ -55,4 +55,4 @@ public class ScrollbarsInNestedTabsheets extends TestBase { return 8625; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabBarWidth.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabBarWidth.java index 01bce334db..accd77ae0e 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabBarWidth.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabBarWidth.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabBarWidthTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabBarWidthTest.java index f09a68d576..a30a155c01 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabBarWidthTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabBarWidthTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetErrorTooltip.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetErrorTooltip.java index 02482b7049..d9cc077f67 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetErrorTooltip.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetErrorTooltip.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetErrorTooltipTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetErrorTooltipTest.java index f6ce33121c..d639cd2ddc 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetErrorTooltipTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetErrorTooltipTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusedTabTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusedTabTest.java index 81648c1b52..12ae03080b 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusedTabTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusedTabTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -18,10 +18,13 @@ package com.vaadin.tests.components.tabsheet; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import java.util.List; + import org.junit.Test; import org.openqa.selenium.Keys; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; +import org.openqa.selenium.remote.DesiredCapabilities; import com.vaadin.testbench.By; import com.vaadin.tests.tb3.MultiBrowserTest; @@ -29,6 +32,15 @@ import com.vaadin.tests.tb3.MultiBrowserTest; public class TabSheetFocusedTabTest extends MultiBrowserTest { @Override + public List<DesiredCapabilities> getBrowsersToTest() { + List<DesiredCapabilities> browsers = super.getBrowsersToTest(); + // PhantomJS doesn't send Focus / Blur events when clicking or + // navigating with keyboard + browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities()); + return browsers; + } + + @Override protected Class<?> getUIClass() { return TabsheetScrolling.class; } @@ -41,7 +53,7 @@ public class TabSheetFocusedTabTest extends MultiBrowserTest { assertTrue(isFocused(getTab(1))); - new Actions(getDriver()).sendKeys(Keys.RIGHT).perform(); + new Actions(getDriver()).sendKeys(Keys.ARROW_RIGHT).perform(); assertFalse(isFocused(getTab(1))); assertTrue(isFocused(getTab(3))); @@ -65,6 +77,7 @@ public class TabSheetFocusedTabTest extends MultiBrowserTest { } private boolean isFocused(WebElement tab) { + return tab.getAttribute("class").contains("v-tabsheet-tabitem-focus"); } diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusing.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusing.java index b6b5431c1f..941073d617 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusing.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusing.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusingTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusingTest.java index 77ddc94567..62948bed06 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusingTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetHotKeysWithModifiers.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetHotKeysWithModifiers.java index c0b30ff68d..779ab6b614 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetHotKeysWithModifiers.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetHotKeysWithModifiers.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java index ccdc4ecb38..c5e01969a1 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java @@ -46,7 +46,7 @@ public class TabSheetIcons extends TestBase { for (Component c : tab) { tabsheet.addTab(c); - tabsheet.getTab(c).setIconAltText( + tabsheet.getTab(c).setIconAlternateText( "iconalt" + tabsheet.getComponentCount()); } diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTabStyleNames.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTabStyleNames.java index 54a5ed4857..c14203e765 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTabStyleNames.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTabStyleNames.java @@ -49,4 +49,4 @@ public class TabSheetTabStyleNames extends TestBase { protected Integer getTicketNumber() { return 5880; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTabTheming.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTabTheming.java index a2c75d6e79..5c76effefd 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTabTheming.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTabTheming.java @@ -25,4 +25,4 @@ public class TabSheetTabTheming extends TestBase { protected Integer getTicketNumber() { return 6781; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.java index ae5adea45e..42d65f66c9 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetScrollingTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetScrollingTest.java index b55f1057b5..1da42bb1ce 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetScrollingTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetScrollingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -22,6 +22,7 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; import com.vaadin.testbench.By; +import com.vaadin.testbench.elements.ButtonElement; import com.vaadin.tests.tb3.MultiBrowserTest; public class TabsheetScrollingTest extends MultiBrowserTest { @@ -38,19 +39,11 @@ public class TabsheetScrollingTest extends MultiBrowserTest { } private WebElement getTab(int index) { - return getDriver().findElement( - By.vaadin("/VVerticalLayout[0]/Slot[1]" - + "/VVerticalLayout[0]/Slot[0]/VTabsheet[0]" - + "/domChild[0]/domChild[0]/domChild[0]" - + "/domChild[0]/domChild[" + index + "]")); - + return getDriver().findElement(By.vaadin("//TabSheet#tab[1]")); } private String getHideButtonText() { - WebElement buttonCaption = getDriver().findElement( - By.vaadin("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]" - + "/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]" - + "/VButton[0]/domChild[0]/domChild[0]")); + ButtonElement buttonCaption = $(ButtonElement.class).first(); return buttonCaption.getText(); } diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java index 5271f467dc..bbbd4ca7e4 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java @@ -57,4 +57,4 @@ public class TabsheetShouldUpdateHeight extends TestBase { protected Integer getTicketNumber() { return 9275; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediate.java b/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediate.java index 26716846fc..ac51b5fc87 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediate.java +++ b/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediate.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediateTest.java b/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediateTest.java index 4b522a1f37..4d750d183f 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediateTest.java +++ b/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediateTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.java b/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.java index 18d8679c2f..c7e449c314 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.java +++ b/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/textfield/MultipleTextChangeEvents.java b/uitest/src/com/vaadin/tests/components/textfield/MultipleTextChangeEvents.java index 58bc4c5383..24feab5cab 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/MultipleTextChangeEvents.java +++ b/uitest/src/com/vaadin/tests/components/textfield/MultipleTextChangeEvents.java @@ -57,4 +57,4 @@ public class MultipleTextChangeEvents extends TestBase { protected Integer getTicketNumber() { return Integer.valueOf(8035); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/textfield/TextChangeEvents.java b/uitest/src/com/vaadin/tests/components/textfield/TextChangeEvents.java index b38dd36284..531392b84a 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/TextChangeEvents.java +++ b/uitest/src/com/vaadin/tests/components/textfield/TextChangeEvents.java @@ -126,4 +126,4 @@ public class TextChangeEvents extends TestBase { } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/textfield/TextChangeEvents2.java b/uitest/src/com/vaadin/tests/components/textfield/TextChangeEvents2.java index 538589808d..d64dbb42d6 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/TextChangeEvents2.java +++ b/uitest/src/com/vaadin/tests/components/textfield/TextChangeEvents2.java @@ -184,4 +184,4 @@ public class TextChangeEvents2 extends TestBase { return 2387; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/textfield/TextChangeEventsEternalLoop.java b/uitest/src/com/vaadin/tests/components/textfield/TextChangeEventsEternalLoop.java index 1a49729b6f..331c8d2efc 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/TextChangeEventsEternalLoop.java +++ b/uitest/src/com/vaadin/tests/components/textfield/TextChangeEventsEternalLoop.java @@ -30,4 +30,4 @@ public class TextChangeEventsEternalLoop extends TestBase { return 6376; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/textfield/TextFieldTruncatesUnderscoresInModalDialogs.java b/uitest/src/com/vaadin/tests/components/textfield/TextFieldTruncatesUnderscoresInModalDialogs.java index 2a9df42ba1..c125d8da86 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/TextFieldTruncatesUnderscoresInModalDialogs.java +++ b/uitest/src/com/vaadin/tests/components/textfield/TextFieldTruncatesUnderscoresInModalDialogs.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/tree/SimpleTree.java b/uitest/src/com/vaadin/tests/components/tree/SimpleTree.java index 06b8af1ec6..f3e47d0996 100644 --- a/uitest/src/com/vaadin/tests/components/tree/SimpleTree.java +++ b/uitest/src/com/vaadin/tests/components/tree/SimpleTree.java @@ -132,4 +132,4 @@ public class SimpleTree extends TestBase implements Action.Handler { public void handleAction(Action action, Object sender, Object target) { System.out.println("Action: " + action.getCaption()); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/tree/TreeFiltering.java b/uitest/src/com/vaadin/tests/components/tree/TreeFiltering.java index 13edf9e37f..6df69c850b 100644 --- a/uitest/src/com/vaadin/tests/components/tree/TreeFiltering.java +++ b/uitest/src/com/vaadin/tests/components/tree/TreeFiltering.java @@ -131,4 +131,4 @@ public class TreeFiltering extends TestBase { return 4192; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java b/uitest/src/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java index 7182e3b4d1..bb7c0350f2 100644 --- a/uitest/src/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java +++ b/uitest/src/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/tree/TreeScrollingOnRightClickTest.java b/uitest/src/com/vaadin/tests/components/tree/TreeScrollingOnRightClickTest.java index 76ab1b3fdb..b8715ed505 100644 --- a/uitest/src/com/vaadin/tests/components/tree/TreeScrollingOnRightClickTest.java +++ b/uitest/src/com/vaadin/tests/components/tree/TreeScrollingOnRightClickTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/tree/TreeWithIcons.java b/uitest/src/com/vaadin/tests/components/tree/TreeWithIcons.java index 99618c0e5d..a1576ffed1 100644 --- a/uitest/src/com/vaadin/tests/components/tree/TreeWithIcons.java +++ b/uitest/src/com/vaadin/tests/components/tree/TreeWithIcons.java @@ -66,4 +66,4 @@ public class TreeWithIcons extends TestBase { return 3529; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/treetable/AddNodesOnExpand.java b/uitest/src/com/vaadin/tests/components/treetable/AddNodesOnExpand.java index f6b32aa4a9..d048f0a4f4 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/AddNodesOnExpand.java +++ b/uitest/src/com/vaadin/tests/components/treetable/AddNodesOnExpand.java @@ -55,4 +55,4 @@ public class AddNodesOnExpand extends TestBase { protected Integer getTicketNumber() { return Integer.valueOf(8041); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java b/uitest/src/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java index 4cf17aef48..3d40bc47cf 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java +++ b/uitest/src/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java @@ -90,4 +90,4 @@ public class ChangeDataSourcePageLengthZero extends TestBase { protected Integer getTicketNumber() { return 7908; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/treetable/DynamicallyModified.java b/uitest/src/com/vaadin/tests/components/treetable/DynamicallyModified.java index 6dc5417d28..e089237b54 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/DynamicallyModified.java +++ b/uitest/src/com/vaadin/tests/components/treetable/DynamicallyModified.java @@ -124,4 +124,4 @@ public class DynamicallyModified extends TestBase implements } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/treetable/RemoveAllItemsRefresh.java b/uitest/src/com/vaadin/tests/components/treetable/RemoveAllItemsRefresh.java index d34522073d..4372341161 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/RemoveAllItemsRefresh.java +++ b/uitest/src/com/vaadin/tests/components/treetable/RemoveAllItemsRefresh.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java b/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java index 85a69702a4..de33d26051 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java +++ b/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java @@ -257,4 +257,4 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { // TODO Auto-generated method stub return null; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTableOutOfSync.java b/uitest/src/com/vaadin/tests/components/treetable/TreeTableOutOfSync.java index 3ed5da1833..7f4aa7f671 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/TreeTableOutOfSync.java +++ b/uitest/src/com/vaadin/tests/components/treetable/TreeTableOutOfSync.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/ui/ComboboxPageLengthZeroScroll.java b/uitest/src/com/vaadin/tests/components/ui/ComboboxPageLengthZeroScroll.java new file mode 100644 index 0000000000..82c04191d1 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/ComboboxPageLengthZeroScroll.java @@ -0,0 +1,56 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.ui; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.ComboBox; + +/** + * Test UI for issue #13488, where scrolling to the next page with pagelength 0 + * would break the rendering of any page except the first. + * + * @author Vaadin Ltd + */ +@SuppressWarnings("serial") +public class ComboboxPageLengthZeroScroll extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + ComboBox combobox = new ComboBox("New items enabled:"); + combobox.setPageLength(0); + + for (int i = 0; i++ < 10;) { + combobox.addItem("1 AMERICAN SAMOA " + i); + combobox.addItem("ANTIGUA AND BARBUDA " + i); + } + + getLayout().addComponent(combobox); + getLayout().addComponent(new Button("dummy")); + } + + @Override + protected String getTestDescription() { + return "Scrolling with pagelength == 0 previously resulted in broken style, should be fixed now"; + } + + @Override + protected Integer getTicketNumber() { + return 13488; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/ui/ComboboxPageLengthZeroScrollTest.java b/uitest/src/com/vaadin/tests/components/ui/ComboboxPageLengthZeroScrollTest.java new file mode 100644 index 0000000000..eecf83417e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/ComboboxPageLengthZeroScrollTest.java @@ -0,0 +1,63 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.ui; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test class for testing issue #13488 - changing pages with pagelength=0 breaks + * the style. + * + * @author Vaadin Ltd + */ + +public class ComboboxPageLengthZeroScrollTest extends MultiBrowserTest { + @Test + public void testComboboxPageLength() { + openTestURL(); + + WebElement comboBox = vaadinElement("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VFilterSelect[0]#textbox"); + + // navigate to the next page. keyboard navigation is the preferred + // method here since it's much easier to implement. + + Actions keyNavigation = new Actions(driver).moveToElement(comboBox) + .click(); + + for (int i = 0; i < 25; ++i) { + keyNavigation.sendKeys(Keys.ARROW_DOWN); + + } + keyNavigation.perform(); + + // The broken behavior always caused a v-shadow element to have + // height: 10px. Verify that this does no longer happen. + + String cssValue = driver.findElement(By.className("v-shadow")) + .getCssValue("height"); + + Assert.assertNotEquals("v-shadow height should not be 10px", "10px", + cssValue); + + } +} diff --git a/uitest/src/com/vaadin/tests/components/ui/ComboboxStyleChangeWidth.java b/uitest/src/com/vaadin/tests/components/ui/ComboboxStyleChangeWidth.java new file mode 100644 index 0000000000..6e5ca36f31 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/ComboboxStyleChangeWidth.java @@ -0,0 +1,65 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.ui; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.ComboBox; + +/** + * Test UI for adding a stylename to a combobox with an undefined width. + * + * @author Vaadin Ltd + */ +public class ComboboxStyleChangeWidth extends AbstractTestUIWithLog { + + @Override + protected void setup(VaadinRequest request) { + final ComboBox cbFoo = new ComboBox(); + cbFoo.setImmediate(true); + cbFoo.setSizeUndefined(); + cbFoo.addItem("A really long string that causes an inline width to be set"); + + Button btn = new Button("Click to break CB", + new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + cbFoo.addStyleName("foofoo"); + + } + }); + + addComponent(cbFoo); + addComponent(btn); + + } + + @Override + protected String getTestDescription() { + return "The computed inline width of an undefined-width ComboBox " + + "(with a sufficiently long option string) breaks when " + + "the component's stylename is changed after initial " + + "rendering."; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(13444); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/ui/ComboboxStyleChangeWidthTest.java b/uitest/src/com/vaadin/tests/components/ui/ComboboxStyleChangeWidthTest.java new file mode 100644 index 0000000000..c0845cabb0 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/ComboboxStyleChangeWidthTest.java @@ -0,0 +1,52 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.ui; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Tests that changing a stylename will not cause the width parameter to be + * removed from a combobox. + * + * @author Vaadin Ltd + */ + +public class ComboboxStyleChangeWidthTest extends MultiBrowserTest { + + @Test + public void testWidthRetained() { + openTestURL(); + + WebElement comboBox = driver + .findElement(By.className("v-filterselect")); + String oldStyle = comboBox.getAttribute("style"); + + WebElement button = driver.findElement(By.className("v-button")); + button.click(); + String newStyle = comboBox.getAttribute("style"); + + assertEquals("width has changed, should remain equal", oldStyle, + newStyle); + + } + +} diff --git a/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetsetTest.java b/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetsetTest.java index f27ef5d789..4bab0e5237 100644 --- a/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetsetTest.java +++ b/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetsetTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetsetTest.java b/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetsetTest.java index ec8add75e0..429bcc0afc 100644 --- a/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetsetTest.java +++ b/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetsetTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/ui/CurrentUiRetained.java b/uitest/src/com/vaadin/tests/components/ui/CurrentUiRetained.java index b0127e3a75..cba2adb5db 100644 --- a/uitest/src/com/vaadin/tests/components/ui/CurrentUiRetained.java +++ b/uitest/src/com/vaadin/tests/components/ui/CurrentUiRetained.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/ui/CustomUITest.java b/uitest/src/com/vaadin/tests/components/ui/CustomUITest.java index 3542806a92..a960e9cc46 100644 --- a/uitest/src/com/vaadin/tests/components/ui/CustomUITest.java +++ b/uitest/src/com/vaadin/tests/components/ui/CustomUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/ui/MultiFileUploadTest.java b/uitest/src/com/vaadin/tests/components/ui/MultiFileUploadTest.java index 8f3e08335f..007a49e0e2 100644 --- a/uitest/src/com/vaadin/tests/components/ui/MultiFileUploadTest.java +++ b/uitest/src/com/vaadin/tests/components/ui/MultiFileUploadTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/ui/PollListenerTest.java b/uitest/src/com/vaadin/tests/components/ui/PollListenerTest.java index 0e5ddaab87..c5861147a5 100644 --- a/uitest/src/com/vaadin/tests/components/ui/PollListenerTest.java +++ b/uitest/src/com/vaadin/tests/components/ui/PollListenerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/ui/RpcInvocationHandlerToString.java b/uitest/src/com/vaadin/tests/components/ui/RpcInvocationHandlerToString.java index 96c02a2460..40ec51cf1f 100644 --- a/uitest/src/com/vaadin/tests/components/ui/RpcInvocationHandlerToString.java +++ b/uitest/src/com/vaadin/tests/components/ui/RpcInvocationHandlerToString.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagation.java b/uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagation.java new file mode 100644 index 0000000000..4235f5a989 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagation.java @@ -0,0 +1,98 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.ui; + +import com.vaadin.event.ShortcutAction.KeyCode; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.FormLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.TextArea; +import com.vaadin.ui.TextField; + +/** + * UI test for TextArea behavior when ENTER has been assigned as a keyboard + * shortcut. + * + * @author Vaadin Ltd + */ +public class TextAreaEventPropagation extends AbstractTestUIWithLog { + + protected static final String BUTTON_PRESSED = "Button Pressed"; + + protected static final String NO_BUTTON_PRESSED = "No Button Pressed"; + + private Label enterButtonPressed; + + private Label escapeButtonPressed; + + @Override + protected void setup(VaadinRequest request) { + + FormLayout form = new FormLayout(); + TextArea textArea = new TextArea("Text input"); + TextField textField = new TextField("Text field input"); + enterButtonPressed = new Label(NO_BUTTON_PRESSED); + enterButtonPressed.setCaption("Enter Label"); + escapeButtonPressed = new Label(NO_BUTTON_PRESSED); + escapeButtonPressed.setCaption("Escape Label"); + + Button enterButton = new Button("Enter"); + enterButton.setClickShortcut(KeyCode.ENTER); + enterButton.addClickListener(new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + + enterButtonPressed.setValue(BUTTON_PRESSED); + } + }); + + Button escapeButton = new Button("Escape"); + escapeButton.setClickShortcut(KeyCode.ESCAPE); + escapeButton.addClickListener(new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + + escapeButtonPressed.setValue(BUTTON_PRESSED); + } + }); + + form.addComponent(textArea); + form.addComponent(textField); + form.addComponent(enterButton); + form.addComponent(escapeButton); + form.addComponent(enterButtonPressed); + form.addComponent(escapeButtonPressed); + addComponent(form); + + } + + @Override + protected String getTestDescription() { + return "Currently if enter key is set as a shortcut for some component, it won't be possible for the user to enter newline in a textarea."; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(12424); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagationTest.java b/uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagationTest.java new file mode 100644 index 0000000000..b1c38df460 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagationTest.java @@ -0,0 +1,120 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.ui; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.elements.LabelElement; +import com.vaadin.testbench.elements.TextAreaElement; +import com.vaadin.testbench.elements.TextFieldElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Tests that the TextArea widget correctly stops ENTER events from propagating. + * + * @author Vaadin Ltd + */ +public class TextAreaEventPropagationTest extends MultiBrowserTest { + + @Test + public void testTextAreaEnterEventPropagation() throws InterruptedException { + openTestURL(); + WebElement textArea = $(TextAreaElement.class).first(); + Actions builder = new Actions(driver); + builder.click(textArea); + builder.sendKeys(textArea, "first line asdf"); + builder.sendKeys(Keys.ENTER); + builder.sendKeys(textArea, "second line jkl;"); + builder.perform(); + + String text = $(LabelElement.class).caption("Enter Label").first() + .getText(); + assertEquals(TextAreaEventPropagation.NO_BUTTON_PRESSED, text); + + WebElement textField = $(TextFieldElement.class).first(); + Actions builder2 = new Actions(driver); + builder2.click(textField); + + builder2.sendKeys("third line"); + builder2.sendKeys(Keys.ENTER); + + builder2.perform(); + + text = $(LabelElement.class).caption("Enter Label").first().getText(); + + assertEquals(TextAreaEventPropagation.BUTTON_PRESSED, text); + + } + + @Test + public void testTextAreaEscapeEventPropagation() + throws InterruptedException { + openTestURL(); + WebElement textArea = $(TextAreaElement.class).first(); + Actions builder = new Actions(driver); + builder.click(textArea); + builder.sendKeys(textArea, "first line asdf"); + builder.sendKeys(Keys.ENTER); + builder.sendKeys(textArea, "second line jkl;"); + builder.sendKeys(Keys.ESCAPE); + builder.perform(); + + String text = $(LabelElement.class).caption("Enter Label").first() + .getText(); + assertEquals(TextAreaEventPropagation.NO_BUTTON_PRESSED, text); + text = $(LabelElement.class).caption("Escape Label").first().getText(); + assertEquals(TextAreaEventPropagation.BUTTON_PRESSED, text); + + } + + @Test + public void testTextFieldEscapeEventPropagation() + throws InterruptedException { + openTestURL(); + WebElement textArea = $(TextAreaElement.class).first(); + Actions builder = new Actions(driver); + builder.click(textArea); + builder.sendKeys(textArea, "first line asdf"); + builder.sendKeys(Keys.ENTER); + builder.sendKeys(textArea, "second line jkl;"); + builder.perform(); + + String text = $(LabelElement.class).caption("Enter Label").first() + .getText(); + assertEquals(TextAreaEventPropagation.NO_BUTTON_PRESSED, text); + + WebElement textField = $(TextFieldElement.class).first(); + Actions builder2 = new Actions(driver); + builder2.click(textField); + + builder2.sendKeys("third line"); + builder2.sendKeys(Keys.ENTER); + builder2.sendKeys(Keys.ESCAPE); + + builder2.perform(); + + text = $(LabelElement.class).caption("Enter Label").first().getText(); + assertEquals(TextAreaEventPropagation.BUTTON_PRESSED, text); + text = $(LabelElement.class).caption("Escape Label").first().getText(); + assertEquals(TextAreaEventPropagation.BUTTON_PRESSED, text); + + } +} diff --git a/uitest/src/com/vaadin/tests/components/ui/TimeoutRedirectResetsOnActivity.java b/uitest/src/com/vaadin/tests/components/ui/TimeoutRedirectResetsOnActivity.java index 2c649c9ca8..cb62ccdb19 100644 --- a/uitest/src/com/vaadin/tests/components/ui/TimeoutRedirectResetsOnActivity.java +++ b/uitest/src/com/vaadin/tests/components/ui/TimeoutRedirectResetsOnActivity.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -23,22 +23,50 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Label; public class TimeoutRedirectResetsOnActivity extends AbstractTestUI { + private int maxActiveInterval = 15; + private int timeoutOverhead = 15; + @Override protected void setup(VaadinRequest request) { - setupTimout(request); + setupTimeout(request); + + Label startedLabel = new Label(); + startedLabel.setValue(String.valueOf(System.currentTimeMillis())); + startedLabel.setId("startedTime"); + + Label originalLabel = new Label(); + originalLabel.setId("originalExpireTime"); + originalLabel.setValue(String.valueOf(getExpireTime())); - addComponent(new Button("clicky", new Button.ClickListener() { + final Label expiresLabel = new Label(); + expiresLabel.setId("actualExpireTime"); + + Button button = new Button("Reset", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { - // NOOP + expiresLabel.setValue(String.valueOf(getExpireTime())); } - })); + + }); + button.setId("reset"); + + addComponent(button); + + addComponent(startedLabel); + addComponent(originalLabel); + addComponent(expiresLabel); + } + + private long getExpireTime() { + return System.currentTimeMillis() + + (maxActiveInterval + timeoutOverhead) * 1000; } - private void setupTimout(VaadinRequest request) { + private void setupTimeout(VaadinRequest request) { request.getService().setSystemMessagesProvider( new SystemMessagesProvider() { @Override @@ -57,7 +85,7 @@ public class TimeoutRedirectResetsOnActivity extends AbstractTestUI { * implementation details in * com.vaadin.server.communication.MetadataWriter */ - getSession().getSession().setMaxInactiveInterval(10); + getSession().getSession().setMaxInactiveInterval(maxActiveInterval); } @Override diff --git a/uitest/src/com/vaadin/tests/components/ui/TimeoutRedirectResetsOnActivityTest.java b/uitest/src/com/vaadin/tests/components/ui/TimeoutRedirectResetsOnActivityTest.java index 272bacb8d5..b5440b8f76 100644 --- a/uitest/src/com/vaadin/tests/components/ui/TimeoutRedirectResetsOnActivityTest.java +++ b/uitest/src/com/vaadin/tests/components/ui/TimeoutRedirectResetsOnActivityTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -15,71 +15,64 @@ */ package com.vaadin.tests.components.ui; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.MatcherAssert.assertThat; +import org.junit.Ignore; +import org.junit.Rule; import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebElement; import com.vaadin.tests.tb3.MultiBrowserTest; +import com.vaadin.tests.tb3.RetryOnFail; public class TimeoutRedirectResetsOnActivityTest extends MultiBrowserTest { + + @Rule + // Timing issues are really hard to resolve in a way that this test would be + // 100% reliable on all browsers. Hence we shall allow one retry. + public RetryOnFail retry = new RetryOnFail(); + + private int waitBeforeActivity = 4000; + private int communicationOverhead = 2000; + + private static int i = 0; + @Test + @Ignore("The test modifies the system messages, which are global and the changes will affect other tests") public void verifyRedirectWorks() throws Exception { setDebug(true); openTestURL(); - long startTime = System.currentTimeMillis(); - while (System.currentTimeMillis() - startTime < 30000) { - clickTheButton(); - Thread.sleep(1000); - } + long startedTime = getTime("startedTime"); + long originalExpireTime = getTime("originalExpireTime"); - assertTrue("button disappeared before timeout", buttonIsStillThere()); + Thread.sleep(waitBeforeActivity); + hitButton("reset"); - Thread.sleep(30000); - assertTrue("no redirection occurred within 30 seconds", - !buttonIsStillThere()); - } + Thread.sleep(200); - private boolean buttonIsStillThere() { - try { - return getButton() != null; - } catch (NoSuchElementException e) { - return false; - } - } + long actualExpireTime = getTime("actualExpireTime"); + + Thread.sleep(originalExpireTime - startedTime - waitBeforeActivity); + + assertThat(driver.getCurrentUrl(), is(getTestUrl())); + + testBench().disableWaitForVaadin(); + Thread.sleep(actualExpireTime - originalExpireTime + + communicationOverhead); - private void clickTheButton() { - getButton().click(); + assertThat(driver.getCurrentUrl(), is(not(getTestUrl()))); } - private WebElement getButton() { - /* - * For some reason, the vaadinElement() method doesn't work when tests - * are run outside of "/run/" and "/run-push/" contexts. The given error - * message says that the generated Vaadin path doesn't match any - * elements, but when that selector is put into the recorder, the - * recorder finds it. - * - * XPath works fine. - */ - /*- - return vaadinElement("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VButton[0]"); - */ - return getDriver().findElement( - By.xpath("//div[contains(@class,'v-button')]")); + private long getTime(String id) { + WebElement element = vaadinElementById(id); + return Long.parseLong(element.getText()); } @Override - protected String getDeploymentPath() { - /* - * AbstractTB3Test assumes only /run/ and /run-push/ contexts, so this - * method needs some overriding. - */ - return "/12446/" - + TimeoutRedirectResetsOnActivity.class.getCanonicalName() - + "?restartApplication&debug"; + protected String getTestUrl() { + return super.getTestUrl() + "?restartApplication"; } } diff --git a/uitest/src/com/vaadin/tests/components/ui/UIAccess.java b/uitest/src/com/vaadin/tests/components/ui/UIAccess.java index d036827159..648e3aff8b 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UIAccess.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIAccess.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/ui/UIAccessExceptionHandling.java b/uitest/src/com/vaadin/tests/components/ui/UIAccessExceptionHandling.java index 1cd4be576b..7fb5f9cd9d 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UIAccessExceptionHandling.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIAccessExceptionHandling.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/ui/UIAccessTest.java b/uitest/src/com/vaadin/tests/components/ui/UIAccessTest.java index 9db2c2f0d3..39d6c12bfc 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UIAccessTest.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIAccessTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -201,4 +201,4 @@ public class UIAccessTest extends MultiBrowserTest { private WebElement getCurrentInstanceWhenPushingButton() { return vaadinElement("/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[7]/VButton[0]"); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/ui/UIInitTest.java b/uitest/src/com/vaadin/tests/components/ui/UIInitTest.java index dc88865621..7d5bbe156b 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UIInitTest.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIInitTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/ui/UIPolling.java b/uitest/src/com/vaadin/tests/components/ui/UIPolling.java index 48671191ca..7d9f09892c 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UIPolling.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIPolling.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/ui/UIReinit.java b/uitest/src/com/vaadin/tests/components/ui/UIRefresh.java index bef7a5a6d1..9fcc1eedde 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UIReinit.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIRefresh.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -22,7 +22,7 @@ import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Label; @PreserveOnRefresh -public class UIReinit extends AbstractTestUI { +public class UIRefresh extends AbstractTestUI { public static final String REINIT_ID = "reinit"; @@ -31,7 +31,7 @@ public class UIReinit extends AbstractTestUI { } @Override - protected void reinit(VaadinRequest request) { + protected void refresh(VaadinRequest request) { Label l = new Label("Reinit!"); l.setId(REINIT_ID); addComponent(l); diff --git a/uitest/src/com/vaadin/tests/components/ui/UIReinitTest.java b/uitest/src/com/vaadin/tests/components/ui/UIRefreshTest.java index 82132d3c65..7d701f4ae0 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UIReinitTest.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIRefreshTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -22,18 +22,18 @@ import org.junit.Test; import com.vaadin.testbench.By; import com.vaadin.tests.tb3.MultiBrowserTest; -public class UIReinitTest extends MultiBrowserTest { +public class UIRefreshTest extends MultiBrowserTest { @Test - public void testUIReinit() { + public void testUIRefresh() { openTestURL(); Assert.assertFalse(reinitLabelExists()); - // Reload the page; UI.reinit should be invoked + // Reload the page; UI.refresh should be invoked openTestURL(); Assert.assertTrue(reinitLabelExists()); } private boolean reinitLabelExists() { - return !getDriver().findElements(By.id(UIReinit.REINIT_ID)).isEmpty(); + return !getDriver().findElements(By.id(UIRefresh.REINIT_ID)).isEmpty(); } } diff --git a/uitest/src/com/vaadin/tests/components/ui/UISerialization.java b/uitest/src/com/vaadin/tests/components/ui/UISerialization.java index 90021a0bf4..cbd317b027 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UISerialization.java +++ b/uitest/src/com/vaadin/tests/components/ui/UISerialization.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/upload/UploadNoSelection.java b/uitest/src/com/vaadin/tests/components/upload/UploadNoSelection.java index c304293170..ecde5760c9 100644 --- a/uitest/src/com/vaadin/tests/components/upload/UploadNoSelection.java +++ b/uitest/src/com/vaadin/tests/components/upload/UploadNoSelection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/upload/UploadNoSelectionTest.java b/uitest/src/com/vaadin/tests/components/upload/UploadNoSelectionTest.java index 1b30c4080a..30dbefc06b 100644 --- a/uitest/src/com/vaadin/tests/components/upload/UploadNoSelectionTest.java +++ b/uitest/src/com/vaadin/tests/components/upload/UploadNoSelectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/window/BackspaceKeyWithModalOpened.java b/uitest/src/com/vaadin/tests/components/window/BackspaceKeyWithModalOpened.java index b568b4d46a..849d756ca9 100644 --- a/uitest/src/com/vaadin/tests/components/window/BackspaceKeyWithModalOpened.java +++ b/uitest/src/com/vaadin/tests/components/window/BackspaceKeyWithModalOpened.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/window/BackspaceKeyWithModalOpenedTest.java b/uitest/src/com/vaadin/tests/components/window/BackspaceKeyWithModalOpenedTest.java index 8104640987..f59c4bd762 100644 --- a/uitest/src/com/vaadin/tests/components/window/BackspaceKeyWithModalOpenedTest.java +++ b/uitest/src/com/vaadin/tests/components/window/BackspaceKeyWithModalOpenedTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/window/CloseModalSubWindow.java b/uitest/src/com/vaadin/tests/components/window/CloseModalSubWindow.java new file mode 100644 index 0000000000..4e07c591ae --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/window/CloseModalSubWindow.java @@ -0,0 +1,135 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.window; + +import com.vaadin.data.Item; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.TreeTable; +import com.vaadin.ui.UI; +import com.vaadin.ui.Window; + +@SuppressWarnings("serial") +public class CloseModalSubWindow extends AbstractTestUIWithLog { + + public static final String SUB_WINDOW = "sub-win"; + public static final String TREE_TABLE = "treetable"; + public static final String DELETE_BUTTON = "del-btn"; + public static final String CONFIRM_BUTTON = "confirm-btn"; + + private ConfirmWindow win; + + private TreeTable table; + + @Override + protected String getTestDescription() { + return "Lists a dozen items in a TreeTable with a Delete Button in each row. " + + "Delete button will open an sub-window allowing user to either confirm delete operation or cancel. " + + "Confirming should close the sub-window at the same time as the item is removed from the TreeTable."; + } + + @Override + protected Integer getTicketNumber() { + return 13188; + } + + @SuppressWarnings("unchecked") + @Override + protected void setup(VaadinRequest request) { + table = new TreeTable(); + table.setId(TREE_TABLE); + table.addContainerProperty("column", String.class, null); + table.addContainerProperty("delete", Button.class, null); + + for (int i = 0; i < 10; i++) { + Item item = table.addItem(i); + item.getItemProperty("column").setValue("" + i); + + Button b = new Button("Delete", deleteClickListener); + b.setId(DELETE_BUTTON + i); + b.setData(i); + item.getItemProperty("delete").setValue(b); + } + + table.setSortEnabled(false); + table.setColumnReorderingAllowed(false); + table.setEditable(true); + table.setPageLength(0); + + addComponent(table); + + } + + private void deleteItem(Object itemId) { + table.removeItem(itemId); + } + + private ClickListener deleteClickListener = new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + win = new ConfirmWindow(event.getButton().getData()); + log("Modal sub-window opened"); + } + }; + + private ClickListener confirmClickListener = new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + deleteItem(event.getButton().getData()); + win.close(); + log("Modal sub-window closed"); + } + }; + + private ClickListener cancelClickListener = new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + win.close(); + log("Modal sub-window closed"); + } + }; + + /** Modal confirmation sub-window. */ + class ConfirmWindow extends Window { + + public ConfirmWindow(Object itemId) { + setModal(true); + setWidth("300px"); + setHeight("200px"); + setId(SUB_WINDOW); + + Button ok = new Button("Confirm Delete", confirmClickListener); + ok.setId(CONFIRM_BUTTON); + ok.setData(itemId); + Button cancel = new Button("Cancel", cancelClickListener); + + HorizontalLayout l = new HorizontalLayout(); + l.addComponent(ok); + l.addComponent(cancel); + + setContent(l); + + UI.getCurrent().addWindow(this); + } + } +} diff --git a/uitest/src/com/vaadin/tests/components/window/CloseModalSubWindowTest.java b/uitest/src/com/vaadin/tests/components/window/CloseModalSubWindowTest.java new file mode 100644 index 0000000000..aec0a7c9df --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/window/CloseModalSubWindowTest.java @@ -0,0 +1,75 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.window; + +import java.util.List; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class CloseModalSubWindowTest extends MultiBrowserTest { + + @Test + public void testCloseModalSubWindow() throws Exception { + + openTestURL(); + + // assert that there's a button with a 'del-btn0' id + List<WebElement> buttons = getDriver().findElements( + By.id(CloseModalSubWindow.DELETE_BUTTON + "0")); + int deleteButtonCount = buttons.size(); + Assert.assertEquals(1, deleteButtonCount); + + // assert that there's no sub-windows open + List<WebElement> subWindows = getDriver().findElements( + By.id(CloseModalSubWindow.SUB_WINDOW)); + Assert.assertEquals(0, subWindows.size()); + + // click the first delete button + getFirstDeteleButton(0).click(); + + // assert that there's ONE sub-window open + subWindows = getDriver().findElements( + By.id(CloseModalSubWindow.SUB_WINDOW)); + Assert.assertEquals(1, subWindows.size()); + + WebElement confirm = getDriver().findElement( + By.id(CloseModalSubWindow.CONFIRM_BUTTON)); + + // click the confirm button in the sub-window + confirm.click(); + + // assert that there's no sub-windows open + subWindows = getDriver().findElements( + By.id(CloseModalSubWindow.SUB_WINDOW)); + Assert.assertEquals(0, subWindows.size()); + + // assert that there's no button with 'del-btn0' id anymore + buttons = getDriver().findElements( + By.id(CloseModalSubWindow.DELETE_BUTTON + "0")); + Assert.assertEquals(0, buttons.size()); + } + + private WebElement getFirstDeteleButton(int index) { + WebElement button = getDriver().findElement( + By.id(CloseModalSubWindow.DELETE_BUTTON + index)); + return button; + } +} diff --git a/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindow.java b/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindow.java index 6347ff9a76..b952df0ed9 100644 --- a/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindow.java +++ b/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindow.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java b/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java index 665e175f2c..e65a24e907 100644 --- a/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java +++ b/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.java b/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.java index 39989926e7..c7379f666b 100644 --- a/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.java +++ b/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.java @@ -2,7 +2,7 @@ package com.vaadin.tests.components.window; import com.vaadin.server.ThemeResource; import com.vaadin.server.VaadinRequest; -import com.vaadin.shared.ui.window.WindowState.WindowRole; +import com.vaadin.shared.ui.window.WindowRole; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/uitest/src/com/vaadin/tests/components/window/ModalWindowNativeSelect.java b/uitest/src/com/vaadin/tests/components/window/ModalWindowNativeSelect.java index 2c6d3c942f..3713facaf0 100644 --- a/uitest/src/com/vaadin/tests/components/window/ModalWindowNativeSelect.java +++ b/uitest/src/com/vaadin/tests/components/window/ModalWindowNativeSelect.java @@ -29,4 +29,4 @@ public class ModalWindowNativeSelect extends TestBase { return 4261; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/window/MoveToTop.java b/uitest/src/com/vaadin/tests/components/window/MoveToTop.java index 4fd748183a..a5a4eb6df3 100644 --- a/uitest/src/com/vaadin/tests/components/window/MoveToTop.java +++ b/uitest/src/com/vaadin/tests/components/window/MoveToTop.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/window/MoveToTopTest.java b/uitest/src/com/vaadin/tests/components/window/MoveToTopTest.java index 26d7a06531..1700100ae7 100644 --- a/uitest/src/com/vaadin/tests/components/window/MoveToTopTest.java +++ b/uitest/src/com/vaadin/tests/components/window/MoveToTopTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/window/RepaintWindowContents.java b/uitest/src/com/vaadin/tests/components/window/RepaintWindowContents.java index 5a0e4d1370..99aa15b47d 100644 --- a/uitest/src/com/vaadin/tests/components/window/RepaintWindowContents.java +++ b/uitest/src/com/vaadin/tests/components/window/RepaintWindowContents.java @@ -55,4 +55,4 @@ public class RepaintWindowContents extends AbstractTestUI { return 8832; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/window/ScrollingBodyElementWithModalOpened.java b/uitest/src/com/vaadin/tests/components/window/ScrollingBodyElementWithModalOpened.java index 2f1c0ff685..403795b676 100644 --- a/uitest/src/com/vaadin/tests/components/window/ScrollingBodyElementWithModalOpened.java +++ b/uitest/src/com/vaadin/tests/components/window/ScrollingBodyElementWithModalOpened.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/window/ScrollingBodyElementWithModalOpenedTest.java b/uitest/src/com/vaadin/tests/components/window/ScrollingBodyElementWithModalOpenedTest.java index b6474519b0..9a3ccb3b31 100644 --- a/uitest/src/com/vaadin/tests/components/window/ScrollingBodyElementWithModalOpenedTest.java +++ b/uitest/src/com/vaadin/tests/components/window/ScrollingBodyElementWithModalOpenedTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/window/SubWindowWithUndefinedHeight.html b/uitest/src/com/vaadin/tests/components/window/SubWindowWithUndefinedHeight.html deleted file mode 100644 index 2c3f651e41..0000000000 --- a/uitest/src/com/vaadin/tests/components/window/SubWindowWithUndefinedHeight.html +++ /dev/null @@ -1,52 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="" /> -<title>SubWindowWithUndefinedHeight</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">SubWindowWithUndefinedHeight</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.window.SubWindowWithUndefinedHeight?restartApplication</td> - <td></td> -</tr> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestscomponentswindowSubWindowWithUndefinedHeight::/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>initial-tab1</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowSubWindowWithUndefinedHeight::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]</td> - <td>17,13</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>select-tab2</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowSubWindowWithUndefinedHeight::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> - <td>8,9</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>select-tab1</td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/window/SubWindowWithUndefinedHeightTest.java b/uitest/src/com/vaadin/tests/components/window/SubWindowWithUndefinedHeightTest.java new file mode 100644 index 0000000000..ec86f62a7c --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/window/SubWindowWithUndefinedHeightTest.java @@ -0,0 +1,41 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.window; + +import java.io.IOException; + +import org.junit.Test; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.TabSheetElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class SubWindowWithUndefinedHeightTest extends MultiBrowserTest { + + @Test + public void testUndefinedWindowSizeUpdate() throws IOException { + openTestURL(); + + $(ButtonElement.class).caption("click me").first().click(); + compareScreen("initial-tab1"); + + $(TabSheetElement.class).first().openTab("tab 2"); + compareScreen("select-tab2"); + + $(TabSheetElement.class).first().openTab("Tab 1"); + compareScreen("select-tab1"); + } +} diff --git a/uitest/src/com/vaadin/tests/components/window/SubWindowsTextSelectionTest.java b/uitest/src/com/vaadin/tests/components/window/SubWindowsTextSelectionTest.java index 2e0873956c..335590437d 100644 --- a/uitest/src/com/vaadin/tests/components/window/SubWindowsTextSelectionTest.java +++ b/uitest/src/com/vaadin/tests/components/window/SubWindowsTextSelectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.java b/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.java index 02ec0c047b..9730d1d8a1 100644 --- a/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.java +++ b/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/window/TooltipInWindowTest.java b/uitest/src/com/vaadin/tests/components/window/TooltipInWindowTest.java index 0e11041e3b..6f144ef7a4 100644 --- a/uitest/src/com/vaadin/tests/components/window/TooltipInWindowTest.java +++ b/uitest/src/com/vaadin/tests/components/window/TooltipInWindowTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/window/WindowInUiWithNoContent.java b/uitest/src/com/vaadin/tests/components/window/WindowInUiWithNoContent.java index 720f751cef..0915b93c26 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowInUiWithNoContent.java +++ b/uitest/src/com/vaadin/tests/components/window/WindowInUiWithNoContent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/window/WindowInUiWithNoContentTest.java b/uitest/src/com/vaadin/tests/components/window/WindowInUiWithNoContentTest.java index 8378c8cf7b..ab247be25b 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowInUiWithNoContentTest.java +++ b/uitest/src/com/vaadin/tests/components/window/WindowInUiWithNoContentTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/window/WindowMoveListener.java b/uitest/src/com/vaadin/tests/components/window/WindowMoveListener.java index e0bc0d9471..63aebebdad 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowMoveListener.java +++ b/uitest/src/com/vaadin/tests/components/window/WindowMoveListener.java @@ -64,4 +64,4 @@ public class WindowMoveListener extends AbstractTestUI { return 12885; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/window/WindowMoveListenerTest.java b/uitest/src/com/vaadin/tests/components/window/WindowMoveListenerTest.java index 3ea3b719c0..5502bf0495 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowMoveListenerTest.java +++ b/uitest/src/com/vaadin/tests/components/window/WindowMoveListenerTest.java @@ -47,4 +47,4 @@ public class WindowMoveListenerTest extends MultiBrowserTest { window.getLocation().y); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/window/WindowThemes.java b/uitest/src/com/vaadin/tests/components/window/WindowThemes.java index 2b39916db8..788adc7902 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowThemes.java +++ b/uitest/src/com/vaadin/tests/components/window/WindowThemes.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/components/window/WindowZIndexTest.java b/uitest/src/com/vaadin/tests/components/window/WindowZIndexTest.java index 38254cf6f3..dc2dfca4f0 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowZIndexTest.java +++ b/uitest/src/com/vaadin/tests/components/window/WindowZIndexTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/containers/filesystemcontainer/FileSystemContainerInTreeTable.java b/uitest/src/com/vaadin/tests/containers/filesystemcontainer/FileSystemContainerInTreeTable.java index 0afaf2c15f..c9d4a07c22 100644 --- a/uitest/src/com/vaadin/tests/containers/filesystemcontainer/FileSystemContainerInTreeTable.java +++ b/uitest/src/com/vaadin/tests/containers/filesystemcontainer/FileSystemContainerInTreeTable.java @@ -143,4 +143,4 @@ public class FileSystemContainerInTreeTable extends TestBase { return 7837; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/containers/sqlcontainer/ComboBoxUpdateProblem.java b/uitest/src/com/vaadin/tests/containers/sqlcontainer/ComboBoxUpdateProblem.java index 2edf7df5f0..321f2ac98f 100644 --- a/uitest/src/com/vaadin/tests/containers/sqlcontainer/ComboBoxUpdateProblem.java +++ b/uitest/src/com/vaadin/tests/containers/sqlcontainer/ComboBoxUpdateProblem.java @@ -24,4 +24,4 @@ public class ComboBoxUpdateProblem extends LegacyApplication { getMainWindow().addComponent(combo); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/containers/sqlcontainer/DatabaseHelper.java b/uitest/src/com/vaadin/tests/containers/sqlcontainer/DatabaseHelper.java index 7e95a41742..93bd265eda 100644 --- a/uitest/src/com/vaadin/tests/containers/sqlcontainer/DatabaseHelper.java +++ b/uitest/src/com/vaadin/tests/containers/sqlcontainer/DatabaseHelper.java @@ -123,4 +123,4 @@ class DatabaseHelper { public SQLContainer getLargeContainer() { return largeContainer; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java b/uitest/src/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java index ebf68fce9a..d099b92fb3 100644 --- a/uitest/src/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java +++ b/uitest/src/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java @@ -143,4 +143,4 @@ public class MassInsertMemoryLeakTestApp extends LegacyApplication { return pool; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/containers/sqlcontainer/SqlcontainertableApplication.java b/uitest/src/com/vaadin/tests/containers/sqlcontainer/SqlcontainertableApplication.java index 8d4f1c5842..89893a453e 100644 --- a/uitest/src/com/vaadin/tests/containers/sqlcontainer/SqlcontainertableApplication.java +++ b/uitest/src/com/vaadin/tests/containers/sqlcontainer/SqlcontainertableApplication.java @@ -44,4 +44,4 @@ public class SqlcontainertableApplication extends LegacyApplication { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/dd/MyDragSourceConnector.java b/uitest/src/com/vaadin/tests/dd/MyDragSourceConnector.java index bc7268a53a..66179692b4 100644 --- a/uitest/src/com/vaadin/tests/dd/MyDragSourceConnector.java +++ b/uitest/src/com/vaadin/tests/dd/MyDragSourceConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/dd/MyDropTargetConnector.java b/uitest/src/com/vaadin/tests/dd/MyDropTargetConnector.java index a3f7f8757a..5bbb397502 100644 --- a/uitest/src/com/vaadin/tests/dd/MyDropTargetConnector.java +++ b/uitest/src/com/vaadin/tests/dd/MyDropTargetConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/debug/HierarchyAfterAnalyzeLayouts.java b/uitest/src/com/vaadin/tests/debug/HierarchyAfterAnalyzeLayouts.java index 6f55e050c0..88b0386c97 100644 --- a/uitest/src/com/vaadin/tests/debug/HierarchyAfterAnalyzeLayouts.java +++ b/uitest/src/com/vaadin/tests/debug/HierarchyAfterAnalyzeLayouts.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/debug/HierarchyAfterAnalyzeLayoutsTest.java b/uitest/src/com/vaadin/tests/debug/HierarchyAfterAnalyzeLayoutsTest.java index 43c9737963..d4f027a2c8 100644 --- a/uitest/src/com/vaadin/tests/debug/HierarchyAfterAnalyzeLayoutsTest.java +++ b/uitest/src/com/vaadin/tests/debug/HierarchyAfterAnalyzeLayoutsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/extensions/BasicExtension.java b/uitest/src/com/vaadin/tests/extensions/BasicExtension.java index 7c4485b23e..a9615ff5d7 100644 --- a/uitest/src/com/vaadin/tests/extensions/BasicExtension.java +++ b/uitest/src/com/vaadin/tests/extensions/BasicExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -24,4 +24,4 @@ public class BasicExtension extends AbstractExtension { public void extend(AbstractClientConnector target) { super.extend(target); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/extensions/BasicExtensionTest.java b/uitest/src/com/vaadin/tests/extensions/BasicExtensionTest.java index 226641ac51..c56cfb10ab 100644 --- a/uitest/src/com/vaadin/tests/extensions/BasicExtensionTest.java +++ b/uitest/src/com/vaadin/tests/extensions/BasicExtensionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/extensions/HelloWorldExtension.java b/uitest/src/com/vaadin/tests/extensions/HelloWorldExtension.java index 16e3df6b30..34711a4b92 100644 --- a/uitest/src/com/vaadin/tests/extensions/HelloWorldExtension.java +++ b/uitest/src/com/vaadin/tests/extensions/HelloWorldExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/extensions/HelloWorldExtensionTest.java b/uitest/src/com/vaadin/tests/extensions/HelloWorldExtensionTest.java index 05321fcf4b..021d2dfa30 100644 --- a/uitest/src/com/vaadin/tests/extensions/HelloWorldExtensionTest.java +++ b/uitest/src/com/vaadin/tests/extensions/HelloWorldExtensionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java b/uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java index 7b74a7c668..b89e16d755 100644 --- a/uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java +++ b/uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/extensions/LayoutMemoryUsageIE8Extension.java b/uitest/src/com/vaadin/tests/extensions/LayoutMemoryUsageIE8Extension.java index c69c2b4d30..f61d3b8bdd 100644 --- a/uitest/src/com/vaadin/tests/extensions/LayoutMemoryUsageIE8Extension.java +++ b/uitest/src/com/vaadin/tests/extensions/LayoutMemoryUsageIE8Extension.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/extensions/ResponsiveUI.java b/uitest/src/com/vaadin/tests/extensions/ResponsiveUI.java index 417821f1ea..f534215e18 100644 --- a/uitest/src/com/vaadin/tests/extensions/ResponsiveUI.java +++ b/uitest/src/com/vaadin/tests/extensions/ResponsiveUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/extensions/ResponsiveUITest.java b/uitest/src/com/vaadin/tests/extensions/ResponsiveUITest.java index 9b86350ebc..6827bd0a5d 100644 --- a/uitest/src/com/vaadin/tests/extensions/ResponsiveUITest.java +++ b/uitest/src/com/vaadin/tests/extensions/ResponsiveUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java b/uitest/src/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java index c6eaee7cc3..d3e0edf04c 100644 --- a/uitest/src/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java +++ b/uitest/src/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/fonticon/FontIcons.java b/uitest/src/com/vaadin/tests/fonticon/FontIcons.java index 5511acf3bf..e9d2b91e95 100644 --- a/uitest/src/com/vaadin/tests/fonticon/FontIcons.java +++ b/uitest/src/com/vaadin/tests/fonticon/FontIcons.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -57,11 +57,6 @@ import com.vaadin.ui.TwinColSelect; import com.vaadin.ui.Upload; import com.vaadin.ui.VerticalLayout; -/** - * - * @since - * @author Vaadin Ltd - */ public class FontIcons extends AbstractTestUI { @Override @@ -105,7 +100,7 @@ public class FontIcons extends AbstractTestUI { Notification n = new Notification("Hey there!"); n.setIcon(icon); n.setPosition(Position.BOTTOM_CENTER); - n.setDelayMsec(-1); + n.setDelayMsec(300000); n.show(Page.getCurrent()); // grid of compoents diff --git a/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java b/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java index af54b73ae3..61a38bf552 100644 --- a/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java +++ b/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -21,11 +21,6 @@ import org.junit.Test; import com.vaadin.tests.tb3.MultiBrowserTest; -/** - * - * @since - * @author Vaadin Ltd - */ public class FontIconsTest extends MultiBrowserTest { @Test diff --git a/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java b/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java index 0266a9d892..073975a509 100644 --- a/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java +++ b/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/integration/AbstractServletIntegrationTest.java b/uitest/src/com/vaadin/tests/integration/AbstractServletIntegrationTest.java index f736a126a5..941e988c5c 100644 --- a/uitest/src/com/vaadin/tests/integration/AbstractServletIntegrationTest.java +++ b/uitest/src/com/vaadin/tests/integration/AbstractServletIntegrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -18,7 +18,8 @@ package com.vaadin.tests.integration; import java.io.IOException; import org.junit.Test; -import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.elements.TableElement; /** * Base class for servlet integration tests. Automatically prepends "/demo" to @@ -33,28 +34,10 @@ public abstract class AbstractServletIntegrationTest extends public void runTest() throws IOException, AssertionError { openTestURL(); compareScreen("initial"); - - WebElement cell = vaadinElement(getTableCell(getTable(), 0, 1)); - testBenchElement(cell).click(51, 13); - + $(TableElement.class).first().getCell(0, 1).click(); compareScreen("finland"); } - private String getTableCell(String tableLocator, int row, int col) { - return tableLocator - + "/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[" - + row + "]/domChild[" + col + "]/domChild[0]"; - } - - protected String getTable() { - return "/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]"; - } - - /* - * (non-Javadoc) - * - * @see com.vaadin.tests.tb3.AbstractTB3Test#getDeploymentPath() - */ @Override protected String getDeploymentPath() { return "/demo" + super.getDeploymentPath(); diff --git a/uitest/src/com/vaadin/tests/integration/JSPIntegrationTest.java b/uitest/src/com/vaadin/tests/integration/JSPIntegrationTest.java index c5d6a65d87..13503966ec 100644 --- a/uitest/src/com/vaadin/tests/integration/JSPIntegrationTest.java +++ b/uitest/src/com/vaadin/tests/integration/JSPIntegrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/integration/ProxyTest.java b/uitest/src/com/vaadin/tests/integration/ProxyTest.java index 5b2eaa829c..887eae315d 100644 --- a/uitest/src/com/vaadin/tests/integration/ProxyTest.java +++ b/uitest/src/com/vaadin/tests/integration/ProxyTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java index d6def8d69c..4c3e1beaa5 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUITest.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUITest.java index 5f50cdb95d..2afc33cf82 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUITest.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -18,4 +18,4 @@ package com.vaadin.tests.integration; public class ServletIntegrationDefaultPushUITest extends AbstractServletIntegrationTest { // Uses the test method declared in the super class -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java index f96000f1ce..0bcac5575d 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUITest.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUITest.java index 70ca890b31..92307dbbaf 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUITest.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -18,4 +18,4 @@ package com.vaadin.tests.integration; public class ServletIntegrationLongPollingUITest extends AbstractServletIntegrationTest { // Uses the test method declared in the super class -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java index 0d92fb1bb8..5d5801f0db 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUITest.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUITest.java index 36a946bfa3..1f42b10e66 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUITest.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -18,4 +18,4 @@ package com.vaadin.tests.integration; public class ServletIntegrationStreamingUITest extends AbstractServletIntegrationTest { // Uses the test method declared in the super class -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationUITest.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationUITest.java index 25ffdac4a2..bebe01578a 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationUITest.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -17,4 +17,4 @@ package com.vaadin.tests.integration; public class ServletIntegrationUITest extends AbstractServletIntegrationTest { // Uses the test method declared in the super class -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java index d7c525f202..18e275618a 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUITest.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUITest.java index f2e7a6f2d0..d4fc3aef17 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUITest.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -18,4 +18,4 @@ package com.vaadin.tests.integration; public class ServletIntegrationWebsocketUITest extends AbstractServletIntegrationTest { // Uses the test method declared in the super class -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/integration/WebSpherePortalIntegrationTest.java b/uitest/src/com/vaadin/tests/integration/WebSpherePortalIntegrationTest.java new file mode 100644 index 0000000000..c8207efe9d --- /dev/null +++ b/uitest/src/com/vaadin/tests/integration/WebSpherePortalIntegrationTest.java @@ -0,0 +1,163 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.integration; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; + +import com.jcraft.jsch.ChannelExec; +import com.jcraft.jsch.ChannelSftp; +import com.jcraft.jsch.JSch; +import com.jcraft.jsch.JSchException; +import com.jcraft.jsch.Session; +import com.jcraft.jsch.SftpException; +import com.vaadin.tests.tb3.PrivateTB3Configuration; + +public class WebSpherePortalIntegrationTest extends PrivateTB3Configuration { + + @BeforeClass + public static void deployPortlet() throws JSchException, SftpException { + Session session = openSession(); + + uploadDemoApplication(session); + + sendCommand(session, "ant -f deploy.xml get-lock startup-and-deploy"); + + session.disconnect(); + } + + private static void uploadDemoApplication(Session session) + throws JSchException, SftpException { + ChannelSftp sftpChannel = (ChannelSftp) session.openChannel("sftp"); + sftpChannel.connect(); + + String applicationPath = System.getProperty("demo.war"); + if (new File(applicationPath).exists()) { + sftpChannel.put(applicationPath, "demo.war"); + sftpChannel.disconnect(); + } else { + sftpChannel.disconnect(); + throw new AssertionError("Demo application not found at " + + applicationPath); + } + } + + private static void sendCommand(Session session, String command) + throws JSchException { + ChannelExec channel = (ChannelExec) session.openChannel("exec"); + channel.setCommand(command); + BufferedReader in; + try { + in = new BufferedReader(new InputStreamReader( + channel.getInputStream())); + + channel.connect(); + + String msg = null; + + while ((msg = in.readLine()) != null) { + System.out.println(msg); + } + } catch (IOException e) { + e.printStackTrace(); + } + + channel.disconnect(); + } + + private static Session openSession() throws JSchException { + JSch jsch = new JSch(); + Session session = jsch.getSession("integration", + "websphereportal8.devnet.vaadin.com", 22); + jsch.addIdentity("~/.ssh/id_dsa"); + session.setConfig("StrictHostKeyChecking", "no"); + + session.connect(); + return session; + } + + @AfterClass + public static void teardown() throws JSchException { + Session session = openSession(); + + sendCommand(session, "ant -f deploy.xml release-lock"); + + session.disconnect(); + } + + @Override + protected java.lang.String getTestUrl() { + return "http://websphereportal8.devnet.vaadin.com:10039/wps/portal"; + } + + @Override + public void setup() throws Exception { + super.setup(); + + openTestURL(); + + if (!isLoggedIn()) { + login(); + } + + waitUntilPortletIsLoaded(); + } + + private void waitUntilPortletIsLoaded() { + WebDriverWait wait = new WebDriverWait(driver, 15); + wait.until(ExpectedConditions.visibilityOfElementLocated(By + .className("v-app"))); + } + + private boolean isLoggedIn() { + return driver.findElements(By.linkText("Log Out")).size() == 1; + } + + private void login() { + driver.findElement(By.linkText("Log In")).click(); + driver.findElement(By.id("userID")).sendKeys("test"); + driver.findElement(By.id("password")).sendKeys("testtest"); + + hitButton("login.button.login"); + } + + @Test + public void portletHasExpectedLayout() throws IOException { + compareScreen("initial"); + } + + @Test + public void viewModeIsSetToEdit() throws IOException { + driver.findElement(By.linkText("Edit")).click(); + + assertThat(driver.findElement(By.tagName("input")).isEnabled(), + is(true)); + + } + +} diff --git a/uitest/src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java b/uitest/src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java index 2b7fc273ad..739779a3e0 100644 --- a/uitest/src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java +++ b/uitest/src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java @@ -56,4 +56,4 @@ public class HiddenHorizontalLayout extends TestBase { vl.addComponent(b); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeak.java b/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeak.java index 7da9e46653..504ee8b41b 100644 --- a/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeak.java +++ b/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeak.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeakTest.java b/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeakTest.java index c9bd64c881..bfe38b8865 100644 --- a/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeakTest.java +++ b/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeakTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.java b/uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.java index f6ee26e86f..3697ab1c26 100644 --- a/uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.java +++ b/uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java b/uitest/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java index 9e0380a1f6..3d4b20d5d9 100644 --- a/uitest/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java +++ b/uitest/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java @@ -1207,4 +1207,4 @@ public class OrderedLayoutBasics extends TestBase { return ol; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.java b/uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.java index fe2dd6cea8..77f0d6cdda 100644 --- a/uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.java +++ b/uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.java @@ -41,4 +41,4 @@ public class VerticalLayoutSlotExpansionAndAlignment extends UI { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/LayoutTesterApplicationTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/LayoutTesterApplicationTest.java index 0544be326a..5d8a6e0e7a 100644 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/LayoutTesterApplicationTest.java +++ b/uitest/src/com/vaadin/tests/layouts/layouttester/LayoutTesterApplicationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/broadcastingmessages/Broadcaster.java b/uitest/src/com/vaadin/tests/minitutorials/broadcastingmessages/Broadcaster.java index 78d0af6283..e268aed7b6 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/broadcastingmessages/Broadcaster.java +++ b/uitest/src/com/vaadin/tests/minitutorials/broadcastingmessages/Broadcaster.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/broadcastingmessages/BroadcasterUI.java b/uitest/src/com/vaadin/tests/minitutorials/broadcastingmessages/BroadcasterUI.java index 68b5925f48..0d63df5e95 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/broadcastingmessages/BroadcasterUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/broadcastingmessages/BroadcasterUI.java @@ -56,4 +56,4 @@ public class BroadcasterUI extends UI implements BroadcastListener { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v70/CookieMonsterUI.java b/uitest/src/com/vaadin/tests/minitutorials/v70/CookieMonsterUI.java index 361567b088..dbe1cbb717 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v70/CookieMonsterUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v70/CookieMonsterUI.java @@ -89,4 +89,4 @@ public class CookieMonsterUI extends UI { return null; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java index a2723beab3..0cb4492929 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java index 0e5bf337d8..a0e4a5851b 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java index 48ccd217ca..952cf8c681 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -19,6 +19,7 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.annotations.PreserveOnRefresh; import com.vaadin.server.VaadinRequest; import com.vaadin.ui.CssLayout; +import com.vaadin.ui.Label; import com.vaadin.ui.TextField; import com.vaadin.ui.UI; @@ -34,10 +35,20 @@ import com.vaadin.ui.UI; public class CreatingPreserveState extends UI { private static int instanceCounter = 0; + private final CssLayout content = new CssLayout(); + @Override public void init(VaadinRequest request) { TextField tf = new TextField("Instance #" + (++instanceCounter)); tf.setImmediate(true); - setContent(new CssLayout(tf)); + + content.addComponent(tf); + setContent(content); + } + + @Override + protected void refresh(VaadinRequest request) { + content.addComponent(new Label("UI was refreshed @" + + System.currentTimeMillis())); } } diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DefineUITheme.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DefineUITheme.java index b25bee1b33..408995867c 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DefineUITheme.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DefineUITheme.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java index 724fa54f48..213e23982b 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java index 29bedb40fb..f4eed8ddd6 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java @@ -70,4 +70,4 @@ public class DynamicImageUI extends AbstractTestUI { protected Integer getTicketNumber() { return null; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java index 7ab7558b23..b744a8de5c 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java index 8fe12b81ad..4ef080afc2 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java index 9fc7a0cfa6..39aef56a1e 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java index 5653719395..fb84a4068b 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java index eddc22c66c..4d95d9cc48 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java index 7b01809648..18a27b85b2 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponent.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponent.java index e6025cf5b8..6512754683 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponent.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponentUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponentUI.java index 590a2d5d40..f291dfe1a9 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponentUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponentUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -44,4 +44,4 @@ public class MyComponentUI extends UI { setContent(component); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyPickerConnector.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyPickerConnector.java index 17d2fc3f93..8a73e90496 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyPickerConnector.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyPickerConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyPickerWidget.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyPickerWidget.java index 7818ac4f99..6a0aee9670 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyPickerWidget.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyPickerWidget.java @@ -49,4 +49,4 @@ public class MyPickerWidget extends ComplexPanel { getElement().getStyle().setPaddingRight(width, Unit.PX); button.getElement().getStyle().setMarginRight(-width, Unit.PX); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/ResourceInStateComponent.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/ResourceInStateComponent.java index 7f800023c0..b22d3dfc1a 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/ResourceInStateComponent.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/ResourceInStateComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/ResourceInStateUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/ResourceInStateUI.java index d17a2dd447..148e7f22ea 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/ResourceInStateUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/ResourceInStateUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/WidgetContainer.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/WidgetContainer.java index b414f40f43..8c14ba8bd7 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/WidgetContainer.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/WidgetContainer.java @@ -46,4 +46,4 @@ public class WidgetContainer extends AbstractComponentContainer { public Iterator<Component> iterator() { return children.iterator(); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerUI.java index d81e6b4c59..c534a4845f 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerUI.java @@ -47,4 +47,4 @@ public class WidgetcontainerUI extends UI { layout.addComponent(button); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/Analytics.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/Analytics.java index 1c050e1a7b..338fb20893 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/Analytics.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/Analytics.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -18,13 +18,13 @@ package com.vaadin.tests.minitutorials.v7a3; import com.vaadin.annotations.JavaScript; import com.vaadin.server.AbstractJavaScriptExtension; -import com.vaadin.server.ClientConnector; import com.vaadin.ui.UI; @JavaScript("analytics_connector.js") public class Analytics extends AbstractJavaScriptExtension { - public Analytics(String account) { + public Analytics(UI ui, String account) { + extend(ui); pushCommand("_setAccount", account); } @@ -37,13 +37,4 @@ public class Analytics extends AbstractJavaScriptExtension { // varargs argument instead of as the full varargs argument array. callFunction("pushCommand", (Object) commandAndArguments); } - - protected void extend(UI uI) { - super.extend(uI); - } - - @Override - protected Class<? extends ClientConnector> getSupportedParentType() { - return UI.class; - } } diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/AnalyticsUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/AnalyticsUI.java index d7f83460fb..b12f5829fc 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/AnalyticsUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/AnalyticsUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -25,8 +25,7 @@ public class AnalyticsUI extends UI { @Override protected void init(VaadinRequest request) { - final Analytics analytics = new Analytics("UA-33036133-12"); - analytics.extend(this); + final Analytics analytics = new Analytics(this, "UA-33036133-12"); setContent(new Button("Track pageview", new Button.ClickListener() { @Override diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/CapsLockWarning.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/CapsLockWarning.java index df549b6a4a..4165e63951 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/CapsLockWarning.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/CapsLockWarning.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -20,7 +20,12 @@ import com.vaadin.server.AbstractExtension; import com.vaadin.ui.PasswordField; public class CapsLockWarning extends AbstractExtension { - public void extend(PasswordField field) { - super.extend(field); + protected CapsLockWarning(PasswordField field) { + // Non-public constructor to discourage direct instantiation + extend(field); + } + + public static CapsLockWarning warnFor(PasswordField field) { + return new CapsLockWarning(field); } } diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/CapsLockWarningUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/CapsLockWarningUI.java index 6d2c344c60..19a7da7114 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/CapsLockWarningUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/CapsLockWarningUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -28,7 +28,7 @@ public class CapsLockWarningUI extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { PasswordField field = new PasswordField("Enter your password"); - new CapsLockWarning().extend(field); + CapsLockWarning.warnFor(field); addComponent(field); } diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesBean.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesBean.java index 8379ebd34f..002e3478bf 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesBean.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesComponent.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesComponent.java index c43c518cdf..7b37166eab 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesComponent.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRpc.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRpc.java index a672c76c8a..1bc282de19 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRpc.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesUI.java index 9942d8ef87..d233a54d86 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/Flot.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/Flot.java index dde6b48ce6..f4aca81ffa 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/Flot.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/Flot.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotHighlightRpc.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotHighlightRpc.java index 67d2ce5708..99c4fdd91b 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotHighlightRpc.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotHighlightRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptUI.java index d348a9e002..f6449b1997 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotState.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotState.java index a6aacf3d62..54cb65db05 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotState.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotState.java @@ -7,4 +7,4 @@ import com.vaadin.shared.ui.JavaScriptComponentState; public class FlotState extends JavaScriptComponentState { public List<List<List<Double>>> series = new ArrayList<List<List<Double>>>(); -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/JSAPIUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/JSAPIUI.java index f9d79a518e..8f1eda6816 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/JSAPIUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/JSAPIUI.java @@ -44,4 +44,4 @@ public class JSAPIUI extends UI { new ExternalResource( "javascript:(function(){com.example.api.notify(prompt('Message'),2);})();"))); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/RedButton.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/RedButton.java index c3ef7b5d39..5c5037d5ad 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/RedButton.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/RedButton.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/RedButtonUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/RedButtonUI.java index de92a2cd27..fb6a4dc83a 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/RedButtonUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/RedButtonUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -24,4 +24,4 @@ public class RedButtonUI extends UI { protected void init(VaadinRequest request) { setContent(new RedButton("My red button")); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/Refresher.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/Refresher.java index 62ce727531..6878fc1bc6 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/Refresher.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/Refresher.java @@ -29,13 +29,14 @@ public class Refresher extends AbstractExtension { } - public Refresher() { + public Refresher(UI ui) { registerRpc(new RefresherRpc() { @Override public void refresh() { fireEvent(new RefreshEvent(Refresher.this)); } }); + extend(ui); } @Override @@ -67,8 +68,4 @@ public class Refresher extends AbstractExtension { super.removeListener(RefreshEvent.class, listener, RefreshListener.METHOD); } - - public void extend(UI target) { - super.extend(target); - } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/RefresherTestUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/RefresherTestUI.java index 0b2fad21aa..e9243ac0cb 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/RefresherTestUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/RefresherTestUI.java @@ -30,8 +30,7 @@ public class RefresherTestUI extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - final Refresher refresher = new Refresher(); - refresher.extend(this); + final Refresher refresher = new Refresher(this); refresher.setInterval(1000); refresher.addRefreshListener(new RefreshListener() { @Override diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b1/Addition.java b/uitest/src/com/vaadin/tests/minitutorials/v7b1/Addition.java index 7b75001f13..696137c3b1 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b1/Addition.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b1/Addition.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b1/CapsLockWarningWithRpc.java b/uitest/src/com/vaadin/tests/minitutorials/v7b1/CapsLockWarningWithRpc.java index 3cf7ebb8c0..280be5982e 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b1/CapsLockWarningWithRpc.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b1/CapsLockWarningWithRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b1/ReducingRoundTrips.java b/uitest/src/com/vaadin/tests/minitutorials/v7b1/ReducingRoundTrips.java index 7f6984816f..03310ab9e8 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b1/ReducingRoundTrips.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b1/ReducingRoundTrips.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b9/CountView.java b/uitest/src/com/vaadin/tests/minitutorials/v7b9/CountView.java index 59708f2bc7..a2ff67f6d9 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b9/CountView.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b9/CountView.java @@ -19,4 +19,4 @@ public class CountView extends Panel implements View { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b9/MainView.java b/uitest/src/com/vaadin/tests/minitutorials/v7b9/MainView.java index d37a39345f..3764b7622e 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b9/MainView.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b9/MainView.java @@ -59,4 +59,4 @@ public class MainView extends Panel implements View { public void enter(ViewChangeEvent event) { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b9/MainViewEarlierExample.java b/uitest/src/com/vaadin/tests/minitutorials/v7b9/MainViewEarlierExample.java index 861fd9f8a4..e638770346 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b9/MainViewEarlierExample.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b9/MainViewEarlierExample.java @@ -58,4 +58,4 @@ public class MainViewEarlierExample extends Panel implements View { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b9/MessageView.java b/uitest/src/com/vaadin/tests/minitutorials/v7b9/MessageView.java index e8612888e9..30e86a2be7 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b9/MessageView.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b9/MessageView.java @@ -26,4 +26,4 @@ public class MessageView extends Panel implements View { } } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b9/SassyUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7b9/SassyUI.java index 0b7ad16657..fa212780f5 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b9/SassyUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b9/SassyUI.java @@ -25,4 +25,4 @@ public class SassyUI extends UI { setContent(layout); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b9/SecretView.java b/uitest/src/com/vaadin/tests/minitutorials/v7b9/SecretView.java index 68eb91fcc5..21fb479bc0 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b9/SecretView.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b9/SecretView.java @@ -13,4 +13,4 @@ public class SecretView extends MessageView implements View { ((Layout) getContent()).addComponent(new Label("Some private stuff.")); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b9/SettingsView.java b/uitest/src/com/vaadin/tests/minitutorials/v7b9/SettingsView.java index 74c4e68b93..be8ea9e533 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b9/SettingsView.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b9/SettingsView.java @@ -131,4 +131,4 @@ public class SettingsView extends Panel implements View { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/BarInUIDL.java b/uitest/src/com/vaadin/tests/push/BarInUIDL.java index bc05f7c306..b380edcb75 100644 --- a/uitest/src/com/vaadin/tests/push/BarInUIDL.java +++ b/uitest/src/com/vaadin/tests/push/BarInUIDL.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/BarInUIDLTest.java b/uitest/src/com/vaadin/tests/push/BarInUIDLTest.java index cd716dcaa3..4013494c49 100644 --- a/uitest/src/com/vaadin/tests/push/BarInUIDLTest.java +++ b/uitest/src/com/vaadin/tests/push/BarInUIDLTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -44,4 +44,4 @@ public class BarInUIDLTest extends MultiBrowserTest { private WebElement getButton() { return vaadinElement("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VButton[0]"); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/BasicPush.java b/uitest/src/com/vaadin/tests/push/BasicPush.java index 8e8f418c5f..ffc5395c2c 100644 --- a/uitest/src/com/vaadin/tests/push/BasicPush.java +++ b/uitest/src/com/vaadin/tests/push/BasicPush.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/BasicPushLongPolling.java b/uitest/src/com/vaadin/tests/push/BasicPushLongPolling.java index bbb7895f20..8b6f634aae 100644 --- a/uitest/src/com/vaadin/tests/push/BasicPushLongPolling.java +++ b/uitest/src/com/vaadin/tests/push/BasicPushLongPolling.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/BasicPushLongPollingTest.java b/uitest/src/com/vaadin/tests/push/BasicPushLongPollingTest.java index b526a11d38..b404747c80 100644 --- a/uitest/src/com/vaadin/tests/push/BasicPushLongPollingTest.java +++ b/uitest/src/com/vaadin/tests/push/BasicPushLongPollingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -16,4 +16,4 @@ package com.vaadin.tests.push; public class BasicPushLongPollingTest extends BasicPushTest { -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/BasicPushStreaming.java b/uitest/src/com/vaadin/tests/push/BasicPushStreaming.java index f9dc78dd43..c906c5f6e1 100644 --- a/uitest/src/com/vaadin/tests/push/BasicPushStreaming.java +++ b/uitest/src/com/vaadin/tests/push/BasicPushStreaming.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/BasicPushStreamingTest.java b/uitest/src/com/vaadin/tests/push/BasicPushStreamingTest.java index 67730f72c8..ceb0b28c76 100644 --- a/uitest/src/com/vaadin/tests/push/BasicPushStreamingTest.java +++ b/uitest/src/com/vaadin/tests/push/BasicPushStreamingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -16,4 +16,4 @@ package com.vaadin.tests.push; public class BasicPushStreamingTest extends BasicPushTest { -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/BasicPushTest.java b/uitest/src/com/vaadin/tests/push/BasicPushTest.java index 670876e0f4..fd34a1f192 100644 --- a/uitest/src/com/vaadin/tests/push/BasicPushTest.java +++ b/uitest/src/com/vaadin/tests/push/BasicPushTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -15,9 +15,10 @@ */ package com.vaadin.tests.push; -import org.junit.Assert; import org.junit.Test; +import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.ExpectedCondition; import com.vaadin.tests.annotations.TestCategory; import com.vaadin.tests.tb3.AbstractTB3Test; @@ -26,49 +27,28 @@ import com.vaadin.tests.tb3.MultiBrowserTest; @TestCategory("push") public abstract class BasicPushTest extends MultiBrowserTest { + @Override + public void setup() throws Exception { + super.setup(); + } + @Test public void testPush() throws InterruptedException { openTestURL(); - // Test client initiated push - Assert.assertEquals(0, getClientCounter()); getIncrementButton().click(); - Assert.assertEquals("Client counter not incremented by button click", - 1, getClientCounter()); + testBench().disableWaitForVaadin(); + + waitUntilClientCounterChanges(1); + getIncrementButton().click(); getIncrementButton().click(); getIncrementButton().click(); - Assert.assertEquals("Four clicks should have incremented counter to 4", - 4, getClientCounter()); + waitUntilClientCounterChanges(4); // Test server initiated push getServerCounterStartButton().click(); - try { - Assert.assertEquals(0, getServerCounter()); - sleep(3000); - int serverCounter = getServerCounter(); - if (serverCounter < 1) { - // No push has happened - Assert.fail("No push has occured within 3s"); - } - sleep(3000); - if (getServerCounter() <= serverCounter) { - // No push has happened - Assert.fail("Only one push took place within 6s"); - - } - } finally { - // Avoid triggering push assertions - getServerCounterStopButton().click(); - } - } - - private int getServerCounter() { - return getServerCounter(this); - } - - private int getClientCounter() { - return getClientCounter(this); + waitUntilServerCounterChanges(); } public static int getClientCounter(AbstractTB3Test t) { @@ -81,10 +61,6 @@ public abstract class BasicPushTest extends MultiBrowserTest { return getIncrementButton(this); } - private WebElement getServerCounterStopButton() { - return getServerCounterStopButton(this); - } - private WebElement getServerCounterStartButton() { return getServerCounterStartButton(this); } @@ -107,4 +83,25 @@ public abstract class BasicPushTest extends MultiBrowserTest { return t.vaadinElementById(BasicPush.INCREMENT_BUTTON_ID); } -}
\ No newline at end of file + private void waitUntilClientCounterChanges(final int expectedValue) { + waitUntil(new ExpectedCondition<Boolean>() { + + @Override + public Boolean apply(WebDriver input) { + return BasicPushTest.getClientCounter(BasicPushTest.this) == expectedValue; + } + }, 10); + } + + private void waitUntilServerCounterChanges() { + final int counter = BasicPushTest.getServerCounter(this); + waitUntil(new ExpectedCondition<Boolean>() { + + @Override + public Boolean apply(WebDriver input) { + return BasicPushTest.getServerCounter(BasicPushTest.this) > counter; + } + }, 10); + } + +} diff --git a/uitest/src/com/vaadin/tests/push/BasicPushWebsocket.java b/uitest/src/com/vaadin/tests/push/BasicPushWebsocket.java index 465caf0165..84c0b19ce8 100644 --- a/uitest/src/com/vaadin/tests/push/BasicPushWebsocket.java +++ b/uitest/src/com/vaadin/tests/push/BasicPushWebsocket.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/BasicPushWebsocketTest.java b/uitest/src/com/vaadin/tests/push/BasicPushWebsocketTest.java index dd0a147d99..093ee348b8 100644 --- a/uitest/src/com/vaadin/tests/push/BasicPushWebsocketTest.java +++ b/uitest/src/com/vaadin/tests/push/BasicPushWebsocketTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -26,4 +26,4 @@ public class BasicPushWebsocketTest extends BasicPushTest { public List<DesiredCapabilities> getBrowsersToTest() { return WebsocketTest.getWebsocketBrowsers(); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/EnableDisablePushTest.java b/uitest/src/com/vaadin/tests/push/EnableDisablePushTest.java index 2e14f9459b..03b34655a1 100644 --- a/uitest/src/com/vaadin/tests/push/EnableDisablePushTest.java +++ b/uitest/src/com/vaadin/tests/push/EnableDisablePushTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -71,4 +71,4 @@ public class EnableDisablePushTest extends MultiBrowserTest { return vaadinElement("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[4]/VButton[0]"); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTime.java b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTime.java index d90394d3b5..815b85ecc4 100644 --- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTime.java +++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTime.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPolling.java b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPolling.java index 7c0899c481..3080b96ec4 100644 --- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPolling.java +++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPolling.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPollingTest.java b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPollingTest.java index eb28634dfa..13f601da7a 100644 --- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPollingTest.java +++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPollingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeStreaming.java b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeStreaming.java index 3e9582740d..04a9c68e32 100644 --- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeStreaming.java +++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeStreaming.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeStreamingTest.java b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeStreamingTest.java index 17837cb2d3..4af6179e81 100644 --- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeStreamingTest.java +++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeStreamingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeTest.java b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeTest.java index a1ce4b9d8f..06ddc07abb 100644 --- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeTest.java +++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocket.java b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocket.java index 8346d49234..f73e7b728c 100644 --- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocket.java +++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocket.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocketTest.java b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocketTest.java index 23d773c7da..c0b188bbab 100644 --- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocketTest.java +++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocketTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/IdlePushChannelLongPollingTest.java b/uitest/src/com/vaadin/tests/push/IdlePushChannelLongPollingTest.java index 5a90c4333d..143960f1b2 100644 --- a/uitest/src/com/vaadin/tests/push/IdlePushChannelLongPollingTest.java +++ b/uitest/src/com/vaadin/tests/push/IdlePushChannelLongPollingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/IdlePushChannelStreamingTest.java b/uitest/src/com/vaadin/tests/push/IdlePushChannelStreamingTest.java index f9a0a722e5..c5a909385f 100644 --- a/uitest/src/com/vaadin/tests/push/IdlePushChannelStreamingTest.java +++ b/uitest/src/com/vaadin/tests/push/IdlePushChannelStreamingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/IdlePushChannelTest.java b/uitest/src/com/vaadin/tests/push/IdlePushChannelTest.java index 95a916f72d..4b142500f7 100644 --- a/uitest/src/com/vaadin/tests/push/IdlePushChannelTest.java +++ b/uitest/src/com/vaadin/tests/push/IdlePushChannelTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/IdlePushChannelWebsocketTest.java b/uitest/src/com/vaadin/tests/push/IdlePushChannelWebsocketTest.java index 3fd9c616fb..644dbd7580 100644 --- a/uitest/src/com/vaadin/tests/push/IdlePushChannelWebsocketTest.java +++ b/uitest/src/com/vaadin/tests/push/IdlePushChannelWebsocketTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/PushConfiguration.java b/uitest/src/com/vaadin/tests/push/PushConfiguration.java index a7ba4e43ba..5e56a5f361 100644 --- a/uitest/src/com/vaadin/tests/push/PushConfiguration.java +++ b/uitest/src/com/vaadin/tests/push/PushConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/PushConfigurationLongPollingTest.java b/uitest/src/com/vaadin/tests/push/PushConfigurationLongPollingTest.java index c0503d5240..ac58deea56 100644 --- a/uitest/src/com/vaadin/tests/push/PushConfigurationLongPollingTest.java +++ b/uitest/src/com/vaadin/tests/push/PushConfigurationLongPollingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -55,4 +55,4 @@ public class PushConfigurationLongPollingTest extends PushConfigurationTest { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/PushConfigurationStreamingTest.java b/uitest/src/com/vaadin/tests/push/PushConfigurationStreamingTest.java index 46fcc5f44b..8dc960c9ac 100644 --- a/uitest/src/com/vaadin/tests/push/PushConfigurationStreamingTest.java +++ b/uitest/src/com/vaadin/tests/push/PushConfigurationStreamingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -38,6 +38,8 @@ public class PushConfigurationStreamingTest extends PushConfigurationTest { @Test public void testStreaming() throws InterruptedException { + openDebugLogTab(); + new Select(getTransportSelect()).selectByVisibleText("STREAMING"); new Select(getPushModeSelect()).selectByVisibleText("AUTOMATIC"); @@ -54,4 +56,4 @@ public class PushConfigurationStreamingTest extends PushConfigurationTest { assertThat(driver.getPageSource(), containsString("Push connection established using streaming")); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/PushConfigurationTest.java b/uitest/src/com/vaadin/tests/push/PushConfigurationTest.java index 20399fc67e..bb5b420259 100644 --- a/uitest/src/com/vaadin/tests/push/PushConfigurationTest.java +++ b/uitest/src/com/vaadin/tests/push/PushConfigurationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -84,4 +84,4 @@ abstract class PushConfigurationTest extends MultiBrowserTest { } }); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/PushConfigurationWebSocketTest.java b/uitest/src/com/vaadin/tests/push/PushConfigurationWebSocketTest.java index c8308e72f1..c9a813fac0 100644 --- a/uitest/src/com/vaadin/tests/push/PushConfigurationWebSocketTest.java +++ b/uitest/src/com/vaadin/tests/push/PushConfigurationWebSocketTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -33,6 +33,7 @@ public class PushConfigurationWebSocketTest extends PushConfigurationTest { List<DesiredCapabilities> browsers = super.getBrowsersToTest(); browsers.remove(Browser.IE8.getDesiredCapabilities()); browsers.remove(Browser.IE9.getDesiredCapabilities()); + browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities()); return browsers; } diff --git a/uitest/src/com/vaadin/tests/push/PushConfigurator.java b/uitest/src/com/vaadin/tests/push/PushConfigurator.java index 6dbe130b73..5a45ab7206 100644 --- a/uitest/src/com/vaadin/tests/push/PushConfigurator.java +++ b/uitest/src/com/vaadin/tests/push/PushConfigurator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/PushErrorHandlingTest.java b/uitest/src/com/vaadin/tests/push/PushErrorHandlingTest.java index 8dbf91f9ee..1f6e181c89 100644 --- a/uitest/src/com/vaadin/tests/push/PushErrorHandlingTest.java +++ b/uitest/src/com/vaadin/tests/push/PushErrorHandlingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -20,6 +20,7 @@ import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; +import com.vaadin.testbench.elements.LabelElement; import com.vaadin.tests.annotations.TestCategory; import com.vaadin.tests.tb3.MultiBrowserTest; @@ -31,11 +32,15 @@ public class PushErrorHandlingTest extends MultiBrowserTest { setPush(true); openTestURL(); vaadinElementById("npeButton").click(); + int idx = 1; + if (BrowserUtil.isPhantomJS(getDesiredCapabilities())) { + // PhantomJS sends an extra event when page gets loaded. + // This results as an extra error label. + ++idx; + } Assert.assertEquals( "An error! Unable to invoke method click in com.vaadin.shared.ui.button.ButtonServerRpc", - vaadinElement( - "/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VLabel[0]") - .getText()); + $(LabelElement.class).get(idx).getText()); WebElement table = vaadinElementById("testtable"); WebElement row = table.findElement(By diff --git a/uitest/src/com/vaadin/tests/push/PushFromInit.java b/uitest/src/com/vaadin/tests/push/PushFromInit.java index 0afaa866f7..63af3d9ec7 100644 --- a/uitest/src/com/vaadin/tests/push/PushFromInit.java +++ b/uitest/src/com/vaadin/tests/push/PushFromInit.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/PushFromInitTest.java b/uitest/src/com/vaadin/tests/push/PushFromInitTest.java index 15453fc054..a285d91e92 100644 --- a/uitest/src/com/vaadin/tests/push/PushFromInitTest.java +++ b/uitest/src/com/vaadin/tests/push/PushFromInitTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -37,4 +37,4 @@ public class PushFromInitTest extends MultiBrowserTest { }); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/PushLargeData.java b/uitest/src/com/vaadin/tests/push/PushLargeData.java index f43348b5eb..f9625b80be 100644 --- a/uitest/src/com/vaadin/tests/push/PushLargeData.java +++ b/uitest/src/com/vaadin/tests/push/PushLargeData.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/PushLargeDataLongPolling.java b/uitest/src/com/vaadin/tests/push/PushLargeDataLongPolling.java index 52a647115a..c2fdb5ae95 100644 --- a/uitest/src/com/vaadin/tests/push/PushLargeDataLongPolling.java +++ b/uitest/src/com/vaadin/tests/push/PushLargeDataLongPolling.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/PushLargeDataLongPollingTest.java b/uitest/src/com/vaadin/tests/push/PushLargeDataLongPollingTest.java index 34150ea5af..00ee6bae25 100644 --- a/uitest/src/com/vaadin/tests/push/PushLargeDataLongPollingTest.java +++ b/uitest/src/com/vaadin/tests/push/PushLargeDataLongPollingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/PushLargeDataStreaming.java b/uitest/src/com/vaadin/tests/push/PushLargeDataStreaming.java index 7706aa90c6..ef300ab222 100644 --- a/uitest/src/com/vaadin/tests/push/PushLargeDataStreaming.java +++ b/uitest/src/com/vaadin/tests/push/PushLargeDataStreaming.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/PushLargeDataStreamingTest.java b/uitest/src/com/vaadin/tests/push/PushLargeDataStreamingTest.java index 14dc5208ef..26fa512ab2 100644 --- a/uitest/src/com/vaadin/tests/push/PushLargeDataStreamingTest.java +++ b/uitest/src/com/vaadin/tests/push/PushLargeDataStreamingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocket.java b/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocket.java index 4115a825d1..a893d7f1ef 100644 --- a/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocket.java +++ b/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocket.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java b/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java index cc8668a729..57fb8c33b0 100644 --- a/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java +++ b/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/PushWithPreserveOnRefresh.java b/uitest/src/com/vaadin/tests/push/PushWithPreserveOnRefresh.java new file mode 100644 index 0000000000..8834a05069 --- /dev/null +++ b/uitest/src/com/vaadin/tests/push/PushWithPreserveOnRefresh.java @@ -0,0 +1,48 @@ +package com.vaadin.tests.push; + +import com.vaadin.annotations.PreserveOnRefresh; +import com.vaadin.annotations.Push; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.tests.util.Log; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.Label; + +@PreserveOnRefresh +@Push +public class PushWithPreserveOnRefresh extends AbstractTestUI { + + private Log log = new Log(5); + private int times = 0; + + @Override + protected void setup(VaadinRequest request) { + // Internal parameter sent by vaadinBootstrap.js, + addComponent(new Label("window.name: " + request.getParameter("v-wn"))); + addComponent(new Label("UI id: " + getUIId())); + addComponent(log); + + Button b = new Button("click me"); + b.addClickListener(new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + log.log("Button has been clicked " + (++times) + " times"); + } + }); + + addComponent(b); + } + + @Override + protected String getTestDescription() { + return "Refreshing the browser window should preserve the state and push should continue to work"; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(13620); + } +} diff --git a/uitest/src/com/vaadin/tests/push/PushWithPreserveOnRefreshTest.java b/uitest/src/com/vaadin/tests/push/PushWithPreserveOnRefreshTest.java new file mode 100644 index 0000000000..3c532b2e55 --- /dev/null +++ b/uitest/src/com/vaadin/tests/push/PushWithPreserveOnRefreshTest.java @@ -0,0 +1,38 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.push; + +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class PushWithPreserveOnRefreshTest extends MultiBrowserTest { + + @Test + public void ensurePushWorksAfterRefresh() { + openTestURL(); + $(ButtonElement.class).first().click(); + $(ButtonElement.class).first().click(); + Assert.assertEquals("2. Button has been clicked 2 times", getLogRow(0)); + openTestURL(); + Assert.assertEquals("2. Button has been clicked 2 times", getLogRow(0)); + $(ButtonElement.class).first().click(); + Assert.assertEquals("3. Button has been clicked 3 times", getLogRow(0)); + + } +} diff --git a/uitest/src/com/vaadin/tests/push/ReconnectLongPollingTest.java b/uitest/src/com/vaadin/tests/push/ReconnectLongPollingTest.java index 6d0c0c53b0..8a4593d70d 100644 --- a/uitest/src/com/vaadin/tests/push/ReconnectLongPollingTest.java +++ b/uitest/src/com/vaadin/tests/push/ReconnectLongPollingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -15,6 +15,7 @@ */ package com.vaadin.tests.push; + public class ReconnectLongPollingTest extends ReconnectTest { @Override diff --git a/uitest/src/com/vaadin/tests/push/ReconnectStreamingTest.java b/uitest/src/com/vaadin/tests/push/ReconnectStreamingTest.java index ebacf5be37..fe63764e78 100755 --- a/uitest/src/com/vaadin/tests/push/ReconnectStreamingTest.java +++ b/uitest/src/com/vaadin/tests/push/ReconnectStreamingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -15,6 +15,7 @@ */ package com.vaadin.tests.push; + public class ReconnectStreamingTest extends ReconnectTest { @Override diff --git a/uitest/src/com/vaadin/tests/push/ReconnectTest.java b/uitest/src/com/vaadin/tests/push/ReconnectTest.java index 5938ab1ff5..5ad2e7a127 100644 --- a/uitest/src/com/vaadin/tests/push/ReconnectTest.java +++ b/uitest/src/com/vaadin/tests/push/ReconnectTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -15,115 +15,103 @@ */ package com.vaadin.tests.push; -import org.junit.Assert; import org.junit.Test; +import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedCondition; +import com.jcraft.jsch.JSchException; import com.vaadin.tests.tb3.MultiBrowserTestWithProxy; public abstract class ReconnectTest extends MultiBrowserTestWithProxy { - @Test - public void testShortDisconnect() throws Exception { + @Override + public void setup() throws Exception { + super.setup(); + setDebug(true); openTestURL(); + openDebugLogTab(); + startTimer(); waitUntilServerCounterChanges(); - disconnectProxy(); - Thread.sleep(1000); - connectProxy(); - waitUntilServerCounterChanges(); + + testBench().disableWaitForVaadin(); } @Test - public void testUserActionWhileDisconnectedWithDelay() throws Exception { - setDebug(true); - openTestURL(); - startTimer(); - waitUntilServerCounterChanges(); + public void messageIsQueuedOnDisconnect() throws JSchException { disconnectProxy(); - Assert.assertEquals(0, getClientCounter()); - getIncrementClientCounterButton().click(); - // No change while disconnected - Assert.assertEquals(0, getClientCounter()); - // Firefox sends extra onopen calls after a while, which breaks - // everything - Thread.sleep(10000); - connectProxy(); - waitUntilServerCounterChanges(); - // The change should have appeared when reconnected - Assert.assertEquals(1, getClientCounter()); + + clickButtonAndWaitForTwoReconnectAttempts(); + + connectAndVerifyConnectionEstablished(); + waitUntilClientCounterChanges(1); } @Test - public void testUserActionWhileDisconnected() throws Exception { - setDebug(true); - openTestURL(); - startTimer(); - waitUntilServerCounterChanges(); + public void messageIsNotSentBeforeConnectionIsEstablished() + throws JSchException, InterruptedException { disconnectProxy(); - Assert.assertEquals(0, getClientCounter()); - getIncrementClientCounterButton().click(); - // No change while disconnected - Assert.assertEquals(0, getClientCounter()); - Thread.sleep(1000); - connectProxy(); - waitUntilServerCounterChanges(); - // The change should have appeared when reconnected - Assert.assertEquals(1, getClientCounter()); - // IE has problems with another reconnect - disconnectProxy(); + waitForNextReconnectionAttempt(); + clickButtonAndWaitForTwoReconnectAttempts(); + + connectAndVerifyConnectionEstablished(); + waitUntilClientCounterChanges(1); + } + + private void clickButtonAndWaitForTwoReconnectAttempts() { + clickClientButton(); + + // Reconnection attempt is where pending messages can + // falsely be sent to server. + waitForNextReconnectionAttempt(); + + // Waiting for the second reconnection attempt makes sure that the + // first attempt has been completed or aborted. + waitForNextReconnectionAttempt(); + } + + private void clickClientButton() { getIncrementClientCounterButton().click(); - Assert.assertEquals(1, getClientCounter()); - Thread.sleep(1000); - connectProxy(); - waitUntilServerCounterChanges(); - Assert.assertEquals(2, getClientCounter()); } - @Test - public void testLongDisconnect() throws Exception { - setDebug(true); - openTestURL(); - startTimer(); - waitUntilServerCounterChanges(); - disconnectProxy(); - Thread.sleep(12000); - connectProxy(); - waitUntilServerCounterChanges(); + private void waitForNextReconnectionAttempt() { + clearDebugMessages(); + waitForDebugMessage("Reopening push connection"); } - @Test - public void testReallyLongDisconnect() throws Exception { - setDebug(true); - openTestURL(); - startTimer(); - waitUntilServerCounterChanges(); - disconnectProxy(); - Thread.sleep(120000); - connectProxy(); - waitUntilServerCounterChanges(); + private void clearDebugMessages() { + driver.findElement( + By.xpath("//button[@class='v-debugwindow-button' and @title='Clear log']")) + .click(); } - @Test - public void testMultipleDisconnects() throws Exception { - setDebug(true); - openTestURL(); - startTimer(); - waitUntilServerCounterChanges(); - for (int i = 0; i < 5; i++) { - disconnectProxy(); - Thread.sleep(1000); - connectProxy(); - waitUntilServerCounterChanges(); - } + private boolean hasDebugMessage(String message) { + return getDebugMessage(message) != null; + } + + private WebElement getDebugMessage(String message) { + return driver.findElement(By.xpath(String.format( + "//span[@class='v-debugwindow-message' and text()='%s']", + message))); + } + + private void waitForDebugMessage(final String expectedMessage) { + waitUntil(new ExpectedCondition<Boolean>() { + + @Override + public Boolean apply(WebDriver input) { + return hasDebugMessage(expectedMessage); + } + }, 30); } - private int getClientCounter() { - return BasicPushTest.getClientCounter(this); + private void connectAndVerifyConnectionEstablished() throws JSchException { + connectProxy(); + waitUntilServerCounterChanges(); } private WebElement getIncrementClientCounterButton() { @@ -141,6 +129,16 @@ public abstract class ReconnectTest extends MultiBrowserTestWithProxy { }, 30); } + private void waitUntilClientCounterChanges(final int expectedValue) { + waitUntil(new ExpectedCondition<Boolean>() { + + @Override + public Boolean apply(WebDriver input) { + return BasicPushTest.getClientCounter(ReconnectTest.this) == expectedValue; + } + }, 5); + } + private void startTimer() { BasicPushTest.getServerCounterStartButton(this).click(); } diff --git a/uitest/src/com/vaadin/tests/push/ReconnectWebsocketTest.java b/uitest/src/com/vaadin/tests/push/ReconnectWebsocketTest.java index 57fe0a040d..efaf5d493e 100644 --- a/uitest/src/com/vaadin/tests/push/ReconnectWebsocketTest.java +++ b/uitest/src/com/vaadin/tests/push/ReconnectWebsocketTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/RoundTripTest.java b/uitest/src/com/vaadin/tests/push/RoundTripTest.java index ee0bf6dcb1..4e192db7f8 100644 --- a/uitest/src/com/vaadin/tests/push/RoundTripTest.java +++ b/uitest/src/com/vaadin/tests/push/RoundTripTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/StreamingReconnectWhilePushing.java b/uitest/src/com/vaadin/tests/push/StreamingReconnectWhilePushing.java index 5a3460a290..74d089374c 100644 --- a/uitest/src/com/vaadin/tests/push/StreamingReconnectWhilePushing.java +++ b/uitest/src/com/vaadin/tests/push/StreamingReconnectWhilePushing.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/TablePushStreaming.java b/uitest/src/com/vaadin/tests/push/TablePushStreaming.java index de824eef3a..04aad63813 100644 --- a/uitest/src/com/vaadin/tests/push/TablePushStreaming.java +++ b/uitest/src/com/vaadin/tests/push/TablePushStreaming.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/TogglePush.java b/uitest/src/com/vaadin/tests/push/TogglePush.java index 6ec8903d65..e662545134 100644 --- a/uitest/src/com/vaadin/tests/push/TogglePush.java +++ b/uitest/src/com/vaadin/tests/push/TogglePush.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/TogglePushTest.java b/uitest/src/com/vaadin/tests/push/TogglePushTest.java index 49110c79dc..3ca12fdd84 100644 --- a/uitest/src/com/vaadin/tests/push/TogglePushTest.java +++ b/uitest/src/com/vaadin/tests/push/TogglePushTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -111,4 +111,4 @@ public class TogglePushTest extends MultiBrowserTest { .getText(); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/TrackMessageSizeUI.java b/uitest/src/com/vaadin/tests/push/TrackMessageSizeUI.java index 23702564f9..6e2784f21d 100644 --- a/uitest/src/com/vaadin/tests/push/TrackMessageSizeUI.java +++ b/uitest/src/com/vaadin/tests/push/TrackMessageSizeUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/push/TrackMessageSizeUITest.java b/uitest/src/com/vaadin/tests/push/TrackMessageSizeUITest.java index 4aab0f867a..b4af11b864 100644 --- a/uitest/src/com/vaadin/tests/push/TrackMessageSizeUITest.java +++ b/uitest/src/com/vaadin/tests/push/TrackMessageSizeUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -29,4 +29,4 @@ public class TrackMessageSizeUITest extends MultiBrowserTest { Assert.assertEquals("1. All tests run", vaadinElementById("Log_row_0") .getText()); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/requesthandlers/UnsupportedBrowserHandlerUserAgents.java b/uitest/src/com/vaadin/tests/requesthandlers/UnsupportedBrowserHandlerUserAgents.java new file mode 100644 index 0000000000..1f2c4d37f2 --- /dev/null +++ b/uitest/src/com/vaadin/tests/requesthandlers/UnsupportedBrowserHandlerUserAgents.java @@ -0,0 +1,76 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.requesthandlers; + +import java.net.HttpURLConnection; +import java.net.URL; + +import org.apache.commons.io.IOUtils; +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.tests.tb3.PrivateTB3Configuration; + +public class UnsupportedBrowserHandlerUserAgents { + /* + * This test doesn't use testbench, but it's still in the uitest source + * folder since it should be run with the testing server deployed. + */ + + @Test + public void ie7NotSupported() { + String response = requestWithUserAgent("Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 5.2; WOW64; .NET CLR 2.0.50727)"); + Assert.assertTrue("IE7 should not be supported", + response.contains("your browser is not supported")); + } + + @Test + public void ie9Supported() { + String response = requestWithUserAgent("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 7.1; Trident/5.0)"); + Assert.assertFalse("IE9 should be supported", + response.contains("your browser is not supported")); + } + + @Test + public void unknownSupported() { + String response = requestWithUserAgent("Very strange user agent, like wat"); + Assert.assertFalse("Unkonwn user agent should be supported", + response.contains("your browser is not supported")); + } + + private String requestWithUserAgent(String userAgent) { + try { + String url = "http://" + + PrivateTB3Configuration.getConfiguredDeploymentHostname() + + ":" + + PrivateTB3Configuration.getConfiguredDeploymentPort() + + "/run/" + + com.vaadin.tests.components.ui.UIInitTest.class.getName() + + "/"; + + HttpURLConnection connection = (HttpURLConnection) new URL(url) + .openConnection(); + connection.setRequestProperty("User-Agent", userAgent); + + String response = IOUtils.toString(connection.getInputStream()); + connection.disconnect(); + + return response; + } catch (Exception e) { + throw new RuntimeException(e); + } + } +} diff --git a/uitest/src/com/vaadin/tests/resources/CachingJavaScriptComponent.java b/uitest/src/com/vaadin/tests/resources/CachingJavaScriptComponent.java new file mode 100644 index 0000000000..b6e409d4ba --- /dev/null +++ b/uitest/src/com/vaadin/tests/resources/CachingJavaScriptComponent.java @@ -0,0 +1,26 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.resources; + +import com.vaadin.annotations.JavaScript; +import com.vaadin.ui.AbstractJavaScriptComponent; + +@JavaScript({ "cachingtest.js" }) +public class CachingJavaScriptComponent extends AbstractJavaScriptComponent { + public CachingJavaScriptComponent() { + + } +} diff --git a/uitest/src/com/vaadin/tests/resources/PublishedFileHandlerCaching.java b/uitest/src/com/vaadin/tests/resources/PublishedFileHandlerCaching.java new file mode 100644 index 0000000000..a2828032c7 --- /dev/null +++ b/uitest/src/com/vaadin/tests/resources/PublishedFileHandlerCaching.java @@ -0,0 +1,77 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.resources; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; + +/** + * This class tests the caching behavior of PublishedFileHandler. + * + * Previously PublishedFileHandler did not include cache headers in it's + * responses. Unfortunately there isn't a good way to automate this test, so + * manual testing is required at this time. To test the caching behavior run + * this file as a java application on the development server debug + * configuration, and access it through the url + * http://localhost:8888/run/com.vaadin + * .tests.resources.PublishedFileHandlerCaching?restartApplication + * + * On loading the page you'll need to examine the network traffic (e.g. with + * FireBug), keeping an eye on the GET requests for cachingtest.js and it's + * cache headers. + * + * @since + * @author Vaadin Ltd + */ +public class PublishedFileHandlerCaching extends AbstractTestUI { + + /** + * generated serialVersionUID + */ + private static final long serialVersionUID = 2275457343547688505L; + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server. + * VaadinRequest) + */ + @Override + protected void setup(VaadinRequest request) { + addComponent(new CachingJavaScriptComponent()); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "Test that PublishedFileHandler includes appropriate cache headers."; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return new Integer(13574); + } + +} diff --git a/uitest/src/com/vaadin/tests/resources/cachingtest.js b/uitest/src/com/vaadin/tests/resources/cachingtest.js new file mode 100644 index 0000000000..f948e680ad --- /dev/null +++ b/uitest/src/com/vaadin/tests/resources/cachingtest.js @@ -0,0 +1,6 @@ +/** + * Used for testing cache header behavior. + */ + +function com_vaadin_tests_resources_CachingJavaScriptComponent() { +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/serialization/DelegateToWidgetTest.java b/uitest/src/com/vaadin/tests/serialization/DelegateToWidgetTest.java index 860b5501cc..96f003d6c5 100644 --- a/uitest/src/com/vaadin/tests/serialization/DelegateToWidgetTest.java +++ b/uitest/src/com/vaadin/tests/serialization/DelegateToWidgetTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/serialization/DelegateWithoutStateClassTest.java b/uitest/src/com/vaadin/tests/serialization/DelegateWithoutStateClassTest.java index e1cb287226..b01a6b243a 100644 --- a/uitest/src/com/vaadin/tests/serialization/DelegateWithoutStateClassTest.java +++ b/uitest/src/com/vaadin/tests/serialization/DelegateWithoutStateClassTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/serialization/GenericWidgetHandling.java b/uitest/src/com/vaadin/tests/serialization/GenericWidgetHandling.java index dca96a46ea..7f599f2c0a 100644 --- a/uitest/src/com/vaadin/tests/serialization/GenericWidgetHandling.java +++ b/uitest/src/com/vaadin/tests/serialization/GenericWidgetHandling.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/serialization/GenericWidgetHandlingTest.java b/uitest/src/com/vaadin/tests/serialization/GenericWidgetHandlingTest.java index a6ff0c4459..9c21ec1de4 100644 --- a/uitest/src/com/vaadin/tests/serialization/GenericWidgetHandlingTest.java +++ b/uitest/src/com/vaadin/tests/serialization/GenericWidgetHandlingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/serialization/SerializerNamespaceTest.java b/uitest/src/com/vaadin/tests/serialization/SerializerNamespaceTest.java index f46fb0d5d9..fa3578c41d 100644 --- a/uitest/src/com/vaadin/tests/serialization/SerializerNamespaceTest.java +++ b/uitest/src/com/vaadin/tests/serialization/SerializerNamespaceTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/serialization/SerializerTest.java b/uitest/src/com/vaadin/tests/serialization/SerializerTest.java index d4849ce667..1c18fb1912 100644 --- a/uitest/src/com/vaadin/tests/serialization/SerializerTest.java +++ b/uitest/src/com/vaadin/tests/serialization/SerializerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -38,6 +38,7 @@ import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.util.Log; import com.vaadin.tests.widgetset.client.ComplexTestBean; import com.vaadin.tests.widgetset.client.SerializerTestRpc; +import com.vaadin.tests.widgetset.client.SerializerTestState; import com.vaadin.tests.widgetset.client.SimpleTestBean; import com.vaadin.tests.widgetset.server.SerializerTestExtension; @@ -58,44 +59,110 @@ public class SerializerTest extends AbstractTestUI { SerializerTestRpc rpc = testExtension .getRpcProxy(SerializerTestRpc.class); + SerializerTestState state = testExtension.getState(); + rpc.sendBeanSubclass(new SimpleTestBean() { @Override public int getValue() { return 42; } }); + state.simpleTestBean = new SimpleTestBean() { + @Override + public int getValue() { + return 42; + } + }; + rpc.sendBoolean(true, Boolean.FALSE, new boolean[] { true, true, false, true, false, false }); + state.booleanValue = true; + state.booleanObjectValue = Boolean.FALSE; + state.booleanArray = new boolean[] { true, true, false, true, false, + false }; + rpc.sendByte((byte) 5, Byte.valueOf((byte) -12), new byte[] { 3, 1, 2 }); + state.byteValue = (byte) 5; + state.byteObjectValue = Byte.valueOf((byte) -12); + state.byteArray = new byte[] { 3, 1, 2 }; + rpc.sendChar('\u222b', Character.valueOf('å'), "aBcD".toCharArray()); + state.charValue = '\u222b'; + state.charObjectValue = Character.valueOf('å'); + state.charArray = "aBcD".toCharArray(); + rpc.sendInt(Integer.MAX_VALUE, Integer.valueOf(0), new int[] { 5, 7 }); + state.intValue = Integer.MAX_VALUE; + state.intObjectValue = Integer.valueOf(0); + state.intArray = new int[] { 5, 7 }; + rpc.sendLong(577431841358l, Long.valueOf(0), new long[] { -57841235865l, 57 }); + state.longValue = 577431841358l; + state.longObjectValue = Long.valueOf(0); + state.longArray = new long[] { -57841235865l, 57 }; + rpc.sendFloat(3.14159f, Float.valueOf(Math.nextUp(1)), new float[] { 57, 0, -12 }); + state.floatValue = 3.14159f; + state.floatObjectValue = Float.valueOf(Math.nextUp(1)); + state.floatArray = new float[] { 57, 0, -12 }; + rpc.sendDouble(Math.PI, Double.valueOf(-Math.E), new double[] { Double.MAX_VALUE, Double.MIN_VALUE }); + state.doubleValue = Math.PI; + state.doubleValue = Double.valueOf(-Math.E); + state.doubleArray = new double[] { Double.MAX_VALUE, Double.MIN_VALUE }; + rpc.sendString("This is a tesing string ‡"); + state.string = "This is a tesing string ‡"; + rpc.sendConnector(this); + state.connector = this; + rpc.sendBean( new ComplexTestBean(new SimpleTestBean(0), new SimpleTestBean(1), Arrays.asList( new SimpleTestBean(3), new SimpleTestBean(4)), 5), new SimpleTestBean(6), new SimpleTestBean[] { new SimpleTestBean(7) }); + state.complexTestBean = new ComplexTestBean(new SimpleTestBean(0), + new SimpleTestBean(1), Arrays.asList(new SimpleTestBean(3), + new SimpleTestBean(4)), 5); + state.simpleTestBean = new SimpleTestBean(6); + state.simpleTestBeanArray = new SimpleTestBean[] { new SimpleTestBean(7) }; + rpc.sendNull("Not null", null); + state.nullString = null; + rpc.sendNestedArray(new int[][] { { 5 }, { 7 } }, new SimpleTestBean[][] { { new SimpleTestBean(4), new SimpleTestBean(2) } }); + state.nestedIntArray = new int[][] { { 5 }, { 7 } }; + state.nestedBeanArray = new SimpleTestBean[][] { { + new SimpleTestBean(4), new SimpleTestBean(2) } }; + rpc.sendList(Arrays.asList(5, 8, -234), Arrays.<Connector> asList(this, testExtension), Arrays.asList(new SimpleTestBean(234), new SimpleTestBean(-568))); + state.intList = Arrays.asList(5, 8, -234); + state.connectorList = Arrays.<Connector> asList(this, testExtension); + state.simpleTestBeanList = Arrays.asList(new SimpleTestBean(234), + new SimpleTestBean(-568)); + rpc.sendArrayList( Arrays.asList(new int[] { 1, 2 }, new int[] { 3, 4 }), Arrays.asList(new Integer[] { 5, 6 }, new Integer[] { 7, 8 }), Collections .singletonList(new SimpleTestBean[] { new SimpleTestBean( 7) })); + state.primitiveArrayList = Arrays.asList(new int[] { 1, 2 }, new int[] { + 3, 4 }); + state.objectArrayList = Arrays.asList(new Integer[] { 5, 6 }, + new Integer[] { 7, 8 }); + state.beanArrayList = Collections + .singletonList(new SimpleTestBean[] { new SimpleTestBean(7) }); + // Disabled because of #8861 // rpc.sendListArray( // new List[] { Arrays.asList(1, 2), Arrays.asList(3, 4) }, @@ -103,6 +170,11 @@ public class SerializerTest extends AbstractTestUI { rpc.sendSet(new HashSet<Integer>(Arrays.asList(4, 7, 12)), Collections .singleton((Connector) this), new HashSet<SimpleTestBean>( Arrays.asList(new SimpleTestBean(1), new SimpleTestBean(2)))); + state.intSet = new HashSet<Integer>(Arrays.asList(4, 7, 12)); + state.connectorSet = Collections.singleton((Connector) this); + + state.beanSet = new HashSet<SimpleTestBean>(Arrays.asList( + new SimpleTestBean(1), new SimpleTestBean(2))); rpc.sendMap(new HashMap<String, SimpleTestBean>() { { @@ -125,6 +197,31 @@ public class SerializerTest extends AbstractTestUI { put(new SimpleTestBean(-4), new SimpleTestBean(4)); } }); + state.stringMap = new HashMap<String, SimpleTestBean>() { + { + put("1", new SimpleTestBean(1)); + put("2", new SimpleTestBean(2)); + } + }; + state.connectorMap = new HashMap<Connector, SimpleTestBean>() { + { + put(testExtension, new SimpleTestBean(3)); + put(getUI(), new SimpleTestBean(4)); + } + }; + state.intMap = new HashMap<Integer, Connector>() { + { + put(5, testExtension); + put(10, getUI()); + } + }; + state.beanMap = new HashMap<SimpleTestBean, SimpleTestBean>() { + { + put(new SimpleTestBean(5), new SimpleTestBean(-5)); + put(new SimpleTestBean(-4), new SimpleTestBean(4)); + } + }; + rpc.sendWrappedGenerics(new HashMap<Set<SimpleTestBean>, Map<Integer, List<SimpleTestBean>>>() { { put(Collections.singleton(new SimpleTestBean(42)), @@ -136,13 +233,32 @@ public class SerializerTest extends AbstractTestUI { }); } }); + state.generics = new HashMap<Set<SimpleTestBean>, Map<Integer, List<SimpleTestBean>>>() { + { + put(Collections.singleton(new SimpleTestBean(42)), + new HashMap<Integer, List<SimpleTestBean>>() { + { + put(1, Arrays.asList(new SimpleTestBean(1), + new SimpleTestBean(3))); + } + }); + } + }; rpc.sendEnum(ContentMode.TEXT, new ContentMode[] { ContentMode.PREFORMATTED, ContentMode.XML }, Arrays.asList(ContentMode.HTML, ContentMode.RAW)); + state.contentMode = ContentMode.TEXT; + state.array = new ContentMode[] { ContentMode.PREFORMATTED, + ContentMode.XML }; + state.list = Arrays.asList(ContentMode.HTML, ContentMode.RAW); + rpc.sendDate(new Date(1)); rpc.sendDate(new Date(2013 - 1900, 5 - 1, 31, 11, 12, 13)); + state.date1 = new Date(1); + state.date2 = new Date(2013 - 1900, 5 - 1, 31, 11, 12, 13); + testExtension.registerRpc(new SerializerTestRpc() { @Override public void sendBoolean(boolean value, Boolean boxedValue, @@ -331,6 +447,12 @@ public class SerializerTest extends AbstractTestUI { log.log("sendDate: " + format.format(date)); } + @Override + public void log(String string) { + log.log(string); + + } + }); } diff --git a/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java b/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java index d093a30ea7..5ca1e9ce6a 100644 --- a/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java +++ b/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java index ba5c81e846..7be55ff298 100644 --- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java +++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -765,6 +765,21 @@ public abstract class AbstractTB3Test extends TestBenchTestCase { } /** + * Gets the capabilities for PhantomJS of the given version + * + * @param version + * the major version + * @return an object describing the capabilities required for running a + * test on the given PhantomJS version + */ + public static DesiredCapabilities phantomJS(int version) { + DesiredCapabilities c = DesiredCapabilities.phantomjs(); + c.setPlatform(Platform.XP); + c.setVersion("" + version); + return c; + } + + /** * Checks if the given capabilities refer to Internet Explorer 8 * * @param capabilities @@ -821,6 +836,15 @@ public abstract class AbstractTB3Test extends TestBenchTestCase { } /** + * @param capabilities + * The capabilities to check + * @return true if the capabilities refer to PhantomJS, false otherwise + */ + public static boolean isPhantomJS(DesiredCapabilities capabilities) { + return BrowserType.PHANTOMJS.equals(capabilities.getBrowserName()); + } + + /** * Returns a human readable identifier of the given browser. Used for * test naming and screenshots * @@ -839,6 +863,8 @@ public abstract class AbstractTB3Test extends TestBenchTestCase { return "Safari"; } else if (isOpera(capabilities)) { return "Opera"; + } else if (isPhantomJS(capabilities)) { + return "PhantomJS"; } return capabilities.getBrowserName(); @@ -930,10 +956,18 @@ public abstract class AbstractTB3Test extends TestBenchTestCase { } public void hitButton(String id) { - WebDriverBackedSelenium selenium = new WebDriverBackedSelenium(driver, - driver.getCurrentUrl()); + if (BrowserUtil.isPhantomJS(getDesiredCapabilities())) { + driver.findElement(By.id(id)).click(); + } else { + WebDriverBackedSelenium selenium = new WebDriverBackedSelenium( + driver, driver.getCurrentUrl()); + + selenium.keyPress("id=" + id, "\\13"); + } + } - selenium.keyPress("id=" + id, "\\13"); + protected void openDebugLogTab() { + findElement(By.xpath("//button[@title='Debug message log']")).click(); } } diff --git a/uitest/src/com/vaadin/tests/tb3/AllTB3Tests.java b/uitest/src/com/vaadin/tests/tb3/AllTB3Tests.java index bd9027bec2..b7cc8284d1 100644 --- a/uitest/src/com/vaadin/tests/tb3/AllTB3Tests.java +++ b/uitest/src/com/vaadin/tests/tb3/AllTB3Tests.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/tb3/ExcludeFromSuite.java b/uitest/src/com/vaadin/tests/tb3/ExcludeFromSuite.java index 5208838028..dd061646be 100644 --- a/uitest/src/com/vaadin/tests/tb3/ExcludeFromSuite.java +++ b/uitest/src/com/vaadin/tests/tb3/ExcludeFromSuite.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java index fa55b82390..74073af217 100644 --- a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java +++ b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -44,7 +44,7 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration { FIREFOX(BrowserUtil.firefox(24)), CHROME(BrowserUtil.chrome(33)), SAFARI( BrowserUtil.safari(7)), IE8(BrowserUtil.ie(8)), IE9(BrowserUtil .ie(9)), IE10(BrowserUtil.ie(10)), IE11(BrowserUtil.ie(11)), OPERA( - BrowserUtil.opera(17)); + BrowserUtil.opera(17)), PHANTOMJS(BrowserUtil.phantomJS(1)); private DesiredCapabilities desiredCapabilities; private Browser(DesiredCapabilities desiredCapabilities) { @@ -66,6 +66,7 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration { // Uncomment once we have the capability to run on Safari 6 // allBrowsers.add(SAFARI); allBrowsers.add(Browser.CHROME.getDesiredCapabilities()); + allBrowsers.add(Browser.PHANTOMJS.getDesiredCapabilities()); // Re-enable this when it is possible to run on a modern Opera version // allBrowsers.add(Browser.OPERA.getDesiredCapabilities()); } diff --git a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java index d600b5fef2..921fa080cd 100755 --- a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java +++ b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -19,7 +19,6 @@ import java.io.File; import java.util.concurrent.atomic.AtomicInteger; import org.junit.After; -import org.junit.Before; import com.jcraft.jsch.JSch; import com.jcraft.jsch.JSchException; @@ -38,8 +37,9 @@ public abstract class MultiBrowserTestWithProxy extends MultiBrowserTest { System.getProperty("sshkey.file"), sshDir + "id_rsa", sshDir + "id_dsa", sshDir + "id_rsa2" }; - @Before - public void setupInitialProxy() throws JSchException { + @Override + public void setup() throws Exception { + super.setup(); connectProxy(); } diff --git a/uitest/src/com/vaadin/tests/tb3/ParallelScheduler.java b/uitest/src/com/vaadin/tests/tb3/ParallelScheduler.java index 912d7d010e..ef9ee382d0 100644 --- a/uitest/src/com/vaadin/tests/tb3/ParallelScheduler.java +++ b/uitest/src/com/vaadin/tests/tb3/ParallelScheduler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java index a00ff7ab4d..97150f96ab 100644 --- a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java +++ b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java @@ -25,6 +25,7 @@ import java.net.SocketException; import java.util.Enumeration; import java.util.Properties; +import org.apache.commons.io.IOUtils; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxBinary; @@ -44,9 +45,8 @@ import com.vaadin.testbench.TestBench; public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { private static final String HOSTNAME_PROPERTY = "com.vaadin.testbench.deployment.hostname"; private static final String PORT_PROPERTY = "com.vaadin.testbench.deployment.port"; - private final Properties properties = new Properties(); - - public PrivateTB3Configuration() { + private static final Properties properties = new Properties(); + static { File file = new File("work", "eclipse-run-selected-test.properties"); if (file.exists()) { try { @@ -57,7 +57,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { } } - private String getProperty(String name) { + private static String getProperty(String name) { String property = properties.getProperty(name); if (property == null) { property = System.getProperty(name); @@ -86,6 +86,15 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { if (getClass().getAnnotation(RunLocally.class) != null) { return "localhost"; } + return getConfiguredDeploymentHostname(); + } + + /** + * Gets the hostname that tests are configured to use. + * + * @return the host name configuration value + */ + public static String getConfiguredDeploymentHostname() { String hostName = getProperty(HOSTNAME_PROPERTY); if (hostName == null || "".equals(hostName)) { @@ -97,6 +106,15 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { @Override protected int getDeploymentPort() { + return getConfiguredDeploymentPort(); + } + + /** + * Gets the port that tests are configured to use. + * + * @return the port configuration value + */ + public static int getConfiguredDeploymentPort() { String portString = getProperty(PORT_PROPERTY); int port = 8888; @@ -115,7 +133,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { * @throws RuntimeException * if there was an error or no IP was found */ - private String findAutoHostname() { + private static String findAutoHostname() { try { Enumeration<NetworkInterface> interfaces = NetworkInterface .getNetworkInterfaces(); diff --git a/uitest/src/com/vaadin/tests/tb3/RetryOnFail.java b/uitest/src/com/vaadin/tests/tb3/RetryOnFail.java new file mode 100644 index 0000000000..9c12147314 --- /dev/null +++ b/uitest/src/com/vaadin/tests/tb3/RetryOnFail.java @@ -0,0 +1,65 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.tb3; + +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; + +/** + * <strong>ALWAYS</strong> declare the reason for using this test rule in a + * test. + * + * <p> + * Violators and abusers of this rule will be punished. + * </p> + * + * @since 7.1.14 + * @author Vaadin Ltd + */ +public class RetryOnFail implements TestRule { + private int retryCount = 1; + + @Override + public Statement apply(Statement base, Description description) { + return statement(base, description); + } + + private Statement statement(final Statement base, + final Description description) { + return new Statement() { + @Override + public void evaluate() throws Throwable { + Throwable caughtThrowable = null; + + for (int i = 0; i <= retryCount; i++) { + try { + base.evaluate(); + return; + } catch (Throwable t) { + caughtThrowable = t; + System.err.println(String.format( + "%s: run %s/%s failed.", + description.getDisplayName(), i + 1, + retryCount + 1)); + System.err.println(t.getMessage()); + } + } + throw caughtThrowable; + } + }; + } +} diff --git a/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java b/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java index 9e2aa4cb78..1782e0042e 100644 --- a/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java +++ b/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -107,7 +107,7 @@ public abstract class ScreenshotTB3Test extends AbstractTB3Test { for (File referenceFile : referenceFiles) { if (testBench(driver).compareScreen(referenceFile)) { // There might be failure files because of retries in TestBench. - deleteFailureFiles(referenceFile); + deleteFailureFiles(getErrorFileFromReference(referenceFile)); break; } else { failedReferenceFiles.add(referenceFile); diff --git a/uitest/src/com/vaadin/tests/tb3/ServletIntegrationTests.java b/uitest/src/com/vaadin/tests/tb3/ServletIntegrationTests.java index c511b99e6e..294d012be5 100644 --- a/uitest/src/com/vaadin/tests/tb3/ServletIntegrationTests.java +++ b/uitest/src/com/vaadin/tests/tb3/ServletIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/tb3/TB3Runner.java b/uitest/src/com/vaadin/tests/tb3/TB3Runner.java index 8b536858e5..053f8e2c30 100644 --- a/uitest/src/com/vaadin/tests/tb3/TB3Runner.java +++ b/uitest/src/com/vaadin/tests/tb3/TB3Runner.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/tb3/TB3TestSuite.java b/uitest/src/com/vaadin/tests/tb3/TB3TestSuite.java index 60bdb53083..703d01c122 100644 --- a/uitest/src/com/vaadin/tests/tb3/TB3TestSuite.java +++ b/uitest/src/com/vaadin/tests/tb3/TB3TestSuite.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -249,4 +249,4 @@ public class TB3TestSuite extends Suite { return true; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tb3/TestNameSuffix.java b/uitest/src/com/vaadin/tests/tb3/TestNameSuffix.java index 9f9bb07a13..615cd8d5b7 100644 --- a/uitest/src/com/vaadin/tests/tb3/TestNameSuffix.java +++ b/uitest/src/com/vaadin/tests/tb3/TestNameSuffix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java b/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java index 69a06a561a..778c8b9113 100644 --- a/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java +++ b/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -41,6 +41,7 @@ public abstract class WebsocketTest extends PrivateTB3Configuration { websocketBrowsers.addAll(MultiBrowserTest.getAllBrowsers()); websocketBrowsers.remove(Browser.IE8.getDesiredCapabilities()); websocketBrowsers.remove(Browser.IE9.getDesiredCapabilities()); + websocketBrowsers.remove(Browser.PHANTOMJS.getDesiredCapabilities()); } /** diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1225.java b/uitest/src/com/vaadin/tests/tickets/Ticket1225.java index 229ad8ee1f..019e84daf3 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1225.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1225.java @@ -66,4 +66,4 @@ public class Ticket1225 extends LegacyApplication { mainWin.setContent(sp); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1365.java b/uitest/src/com/vaadin/tests/tickets/Ticket1365.java index 3fc900bf3e..04c1645d98 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1365.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1365.java @@ -45,4 +45,4 @@ public class Ticket1365 extends com.vaadin.server.LegacyApplication implements f.focus(); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1368.java b/uitest/src/com/vaadin/tests/tickets/Ticket1368.java index 75441d9ae9..b2816480fc 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1368.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1368.java @@ -34,4 +34,4 @@ public class Ticket1368 extends LegacyApplication { mainWin.addComponent(addColumn); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1435.java b/uitest/src/com/vaadin/tests/tickets/Ticket1435.java index c530db7aec..9c8f400e1d 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1435.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1435.java @@ -233,4 +233,4 @@ public class Ticket1435 extends LegacyApplication { return panel; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1444.java b/uitest/src/com/vaadin/tests/tickets/Ticket1444.java index 2fd9de1752..c786d8aab8 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1444.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1444.java @@ -28,4 +28,4 @@ public class Ticket1444 extends LegacyApplication { mainWin.addComponent(ol); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java b/uitest/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java index 522fbe7670..005beab7c4 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java @@ -85,4 +85,4 @@ public class Ticket1465ModalNotification extends LegacyApplication { mainWin.addComponent(b); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java b/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java index 7ac34dcd2e..288a9ef7d2 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java @@ -128,4 +128,4 @@ public class Ticket1506_TestContainer2 implements Container { public boolean removeAllItems() throws UnsupportedOperationException { throw new UnsupportedOperationException("Not implemented"); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1519.java b/uitest/src/com/vaadin/tests/tickets/Ticket1519.java index 776a4aefff..c603e996ca 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1519.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1519.java @@ -22,4 +22,4 @@ public class Ticket1519 extends LegacyApplication { mainWin.addComponent(ts); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1589.java b/uitest/src/com/vaadin/tests/tickets/Ticket1589.java index 05e336f4a1..45ff15e456 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1589.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1589.java @@ -97,4 +97,4 @@ class MyDynamicResource implements RequestHandler { return false; } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1598.java b/uitest/src/com/vaadin/tests/tickets/Ticket1598.java index 7c574afcc9..a890c08ddb 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1598.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1598.java @@ -130,4 +130,4 @@ public class Ticket1598 extends LegacyApplication { main.addComponent(menuBar); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket161.java b/uitest/src/com/vaadin/tests/tickets/Ticket161.java index dda769d2d4..988128f4af 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket161.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket161.java @@ -45,4 +45,4 @@ public class Ticket161 extends LegacyApplication { mainWin.addComponent(b); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1632.java b/uitest/src/com/vaadin/tests/tickets/Ticket1632.java index b111bab2ee..c227bcc3d8 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1632.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1632.java @@ -62,4 +62,4 @@ public class Ticket1632 extends LegacyApplication { mainWin.addComponent(b); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1737.java b/uitest/src/com/vaadin/tests/tickets/Ticket1737.java index c893bc1e34..33515bad87 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1737.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1737.java @@ -50,4 +50,4 @@ public class Ticket1737 extends LegacyApplication { el.addComponent(em); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1806.java b/uitest/src/com/vaadin/tests/tickets/Ticket1806.java index 2c6018eb1c..60ea9528d3 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1806.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1806.java @@ -44,4 +44,4 @@ public class Ticket1806 extends com.vaadin.server.LegacyApplication { } })); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java b/uitest/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java index ce08350977..60078daacd 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java @@ -94,4 +94,4 @@ public class Ticket1834PanelScrolling extends main.addComponent(p); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1857.java b/uitest/src/com/vaadin/tests/tickets/Ticket1857.java index 3e4a7e2267..5c6f45de87 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1857.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1857.java @@ -112,4 +112,4 @@ public class Ticket1857 extends LegacyApplication implements Handler { getMainWindow().showNotification("Removing row number:" + target); ((Table) sender).removeItem(target); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1868.java b/uitest/src/com/vaadin/tests/tickets/Ticket1868.java index 4cce9188b7..8bbd8a8350 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1868.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1868.java @@ -21,4 +21,4 @@ public class Ticket1868 extends com.vaadin.server.LegacyApplication { getMainWindow().addComponent(p); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1923.java b/uitest/src/com/vaadin/tests/tickets/Ticket1923.java index d9c8a34592..939fe05e58 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1923.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1923.java @@ -85,4 +85,4 @@ public class Ticket1923 extends com.vaadin.server.LegacyApplication { main.addComponent(ol); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1953.java b/uitest/src/com/vaadin/tests/tickets/Ticket1953.java index 2a510cb7d1..98c55329da 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1953.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1953.java @@ -111,4 +111,4 @@ public class Ticket1953 extends LegacyApplication { main.addComponent(grid); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1969.java b/uitest/src/com/vaadin/tests/tickets/Ticket1969.java index 0548feafe0..73746fb07d 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1969.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1969.java @@ -107,4 +107,4 @@ public class Ticket1969 extends com.vaadin.server.LegacyApplication { main.addComponent(ts); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1973.java b/uitest/src/com/vaadin/tests/tickets/Ticket1973.java index 427d635547..c4e7dbfcd7 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1973.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1973.java @@ -49,4 +49,4 @@ public class Ticket1973 extends com.vaadin.server.LegacyApplication { item.getItemProperty("layout").setValue(layout); } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1991.java b/uitest/src/com/vaadin/tests/tickets/Ticket1991.java index e1a9a47948..02175ea5d1 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1991.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1991.java @@ -25,4 +25,4 @@ public class Ticket1991 extends com.vaadin.server.LegacyApplication { main.addComponent(t); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2009.java b/uitest/src/com/vaadin/tests/tickets/Ticket2009.java index 4dc69ec470..64881c046a 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2009.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2009.java @@ -134,4 +134,4 @@ public class Ticket2009 extends com.vaadin.server.LegacyApplication { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2037.java b/uitest/src/com/vaadin/tests/tickets/Ticket2037.java index c7c705df12..e7af6a7c55 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2037.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2037.java @@ -46,4 +46,4 @@ public class Ticket2037 extends com.vaadin.server.LegacyApplication { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2040.java b/uitest/src/com/vaadin/tests/tickets/Ticket2040.java index 45268e8947..5113c2e9c3 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2040.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2040.java @@ -84,4 +84,4 @@ public class Ticket2040 extends com.vaadin.server.LegacyApplication { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2062.java b/uitest/src/com/vaadin/tests/tickets/Ticket2062.java index 1c20d945d3..0402b4cbd5 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2062.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2062.java @@ -38,4 +38,4 @@ public class Ticket2062 extends LegacyApplication { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2126.java b/uitest/src/com/vaadin/tests/tickets/Ticket2126.java index 272470d5b6..bc182181e4 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2126.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2126.java @@ -60,4 +60,4 @@ public class Ticket2126 extends com.vaadin.server.LegacyApplication { main.addComponent(table); main.addComponent(refreshTable); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2287.java b/uitest/src/com/vaadin/tests/tickets/Ticket2287.java index ef32f70de4..717ced35cb 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2287.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2287.java @@ -30,4 +30,4 @@ public class Ticket2287 extends Ticket2292 { main.addComponent(l); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2289.java b/uitest/src/com/vaadin/tests/tickets/Ticket2289.java index 90bf5b1ae8..259c9597b1 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2289.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2289.java @@ -98,4 +98,4 @@ class MyTab extends CustomComponent { setCompositionRoot(ol); ol.addComponent(new Label(text)); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2297.java b/uitest/src/com/vaadin/tests/tickets/Ticket2297.java index eb8f47fde3..b4a3d02efa 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2297.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2297.java @@ -38,4 +38,4 @@ public class Ticket2297 extends Ticket2292 { e.printStackTrace(); } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2901.java b/uitest/src/com/vaadin/tests/tickets/Ticket2901.java index d93194aee9..352b4f9a35 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2901.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2901.java @@ -31,4 +31,4 @@ public class Ticket2901 extends LegacyApplication { mainWin.setContent(sp); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/util/LargeContainer.java b/uitest/src/com/vaadin/tests/util/LargeContainer.java index 3c18899493..a6430ec0c2 100644 --- a/uitest/src/com/vaadin/tests/util/LargeContainer.java +++ b/uitest/src/com/vaadin/tests/util/LargeContainer.java @@ -245,4 +245,4 @@ public class LargeContainer extends AbstractContainer implements throw new UnsupportedOperationException("Not supported"); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/util/LogPrintWriter.java b/uitest/src/com/vaadin/tests/util/LogPrintWriter.java index 1f07a9c7ae..1ec6f02ac9 100644 --- a/uitest/src/com/vaadin/tests/util/LogPrintWriter.java +++ b/uitest/src/com/vaadin/tests/util/LogPrintWriter.java @@ -31,4 +31,4 @@ public class LogPrintWriter extends PrintWriter { return result.toString(); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/util/LoremIpsum.java b/uitest/src/com/vaadin/tests/util/LoremIpsum.java index c3eec32fd5..38938fddee 100644 --- a/uitest/src/com/vaadin/tests/util/LoremIpsum.java +++ b/uitest/src/com/vaadin/tests/util/LoremIpsum.java @@ -19,4 +19,4 @@ public class LoremIpsum { public static String get() { return LOREM; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/util/Person.java b/uitest/src/com/vaadin/tests/util/Person.java index 72f6b7d20d..eca7b0bed8 100644 --- a/uitest/src/com/vaadin/tests/util/Person.java +++ b/uitest/src/com/vaadin/tests/util/Person.java @@ -93,4 +93,4 @@ public class Person implements Serializable { return address; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/util/PortableRandom.java b/uitest/src/com/vaadin/tests/util/PortableRandom.java index b66bdfdcaf..44c3201cf4 100644 --- a/uitest/src/com/vaadin/tests/util/PortableRandom.java +++ b/uitest/src/com/vaadin/tests/util/PortableRandom.java @@ -49,4 +49,4 @@ public class PortableRandom { return next(1) != 0; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/util/RangeCollection.java b/uitest/src/com/vaadin/tests/util/RangeCollection.java index 302619c5b9..cfc4c61fd2 100644 --- a/uitest/src/com/vaadin/tests/util/RangeCollection.java +++ b/uitest/src/com/vaadin/tests/util/RangeCollection.java @@ -48,4 +48,4 @@ public class RangeCollection extends AbstractCollection<Integer> { return size; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/util/SampleDirectory.java b/uitest/src/com/vaadin/tests/util/SampleDirectory.java index 791f53cc2c..a4829334a5 100644 --- a/uitest/src/com/vaadin/tests/util/SampleDirectory.java +++ b/uitest/src/com/vaadin/tests/util/SampleDirectory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/util/TestUtils.java b/uitest/src/com/vaadin/tests/util/TestUtils.java index dcd28c3413..5c6315a23a 100644 --- a/uitest/src/com/vaadin/tests/util/TestUtils.java +++ b/uitest/src/com/vaadin/tests/util/TestUtils.java @@ -99,13 +99,22 @@ public class TestUtils { "YE", "ZAMBIA", "ZM", "ZIMBABWE", "ZW" }; /** - * Injects css into the current window. Can be used to keep tests css in - * source files. + * Crossbrowser hack to dynamically add css current window. Can be used to + * keep tests css in source files. * * @param cssString */ public static void injectCSS(UI w, String cssString) { - w.getPage().getStyles().add(cssString); + String script = "if ('\\v'=='v') /* ie only */ {\n" + + " document.createStyleSheet().cssText = '" + + cssString + + "';\n" + + " } else {var tag = document.createElement('style'); tag.type = 'text/css';" + + " document.getElementsByTagName('head')[0].appendChild(tag);tag[ (typeof " + + "document.body.style.WebkitAppearance=='string') /* webkit only */ ? 'innerText' " + + ": 'innerHTML'] = '" + cssString + "';}"; + + w.getPage().getJavaScript().execute(script); } public static void installPerformanceReporting(TextArea targetTextArea) { diff --git a/uitest/src/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java b/uitest/src/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java index 42130ee306..3849268bf7 100644 --- a/uitest/src/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java +++ b/uitest/src/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/TestingWidgetSet.java b/uitest/src/com/vaadin/tests/widgetset/TestingWidgetSet.java index 3904ef2272..1c04c57526 100644 --- a/uitest/src/com/vaadin/tests/widgetset/TestingWidgetSet.java +++ b/uitest/src/com/vaadin/tests/widgetset/TestingWidgetSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/BasicExtensionTestConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/BasicExtensionTestConnector.java index 999ebc3d3f..6bd2abec60 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/BasicExtensionTestConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/BasicExtensionTestConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/ClientRpcClassConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/ClientRpcClassConnector.java index fb28e94bfa..f4d226bb03 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/ClientRpcClassConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/ClientRpcClassConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/ClientRpcClassWidget.java b/uitest/src/com/vaadin/tests/widgetset/client/ClientRpcClassWidget.java index 91b4f19d92..c922259fae 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/ClientRpcClassWidget.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/ClientRpcClassWidget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/ComplexTestBean.java b/uitest/src/com/vaadin/tests/widgetset/client/ComplexTestBean.java index e1fed18a22..0d6a1292e2 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/ComplexTestBean.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/ComplexTestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/CustomUIConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/CustomUIConnector.java index ddf6763f1b..b43da8e27e 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/CustomUIConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/CustomUIConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/CustomUIConnectorRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/CustomUIConnectorRpc.java index 217d906137..d905daeea6 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/CustomUIConnectorRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/CustomUIConnectorRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/DelegateConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/DelegateConnector.java index 32fb847ee3..f25a33225c 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/DelegateConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/DelegateConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/DelegateState.java b/uitest/src/com/vaadin/tests/widgetset/client/DelegateState.java index 79505df1f4..c188e655ba 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/DelegateState.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/DelegateState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/DelegateWidget.java b/uitest/src/com/vaadin/tests/widgetset/client/DelegateWidget.java index 8b71e2bdec..498180cb96 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/DelegateWidget.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/DelegateWidget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/DelegateWithoutStateClassConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/DelegateWithoutStateClassConnector.java index f3594967a9..0808abf09a 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/DelegateWithoutStateClassConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/DelegateWithoutStateClassConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/DummyLabelConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/DummyLabelConnector.java index d059426ac0..43400ada60 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/DummyLabelConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/DummyLabelConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/GenericWidget.java b/uitest/src/com/vaadin/tests/widgetset/client/GenericWidget.java index bf191d1e87..142fdd2e52 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/GenericWidget.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/GenericWidget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetConnector.java index a05bedfa27..35d071a6df 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetState.java b/uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetState.java index 79dce8de9f..4b1f6c4c7a 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetState.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/LabelState.java b/uitest/src/com/vaadin/tests/widgetset/client/LabelState.java index 96eff3e795..7f8468b215 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/LabelState.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/LabelState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/LayoutMemoryUsageIE8ExtensionConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/LayoutMemoryUsageIE8ExtensionConnector.java index c92e688520..718706da97 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/LayoutMemoryUsageIE8ExtensionConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/LayoutMemoryUsageIE8ExtensionConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/MissingFromDefaultWidgetsetConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/MissingFromDefaultWidgetsetConnector.java index cff6848e6f..5fdec05970 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/MissingFromDefaultWidgetsetConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/MissingFromDefaultWidgetsetConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/RoundTripTesterConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/RoundTripTesterConnector.java index 94972d92f4..b22b3fc4b8 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/RoundTripTesterConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/RoundTripTesterConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/RoundTripTesterRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/RoundTripTesterRpc.java index 24c981e0c2..60a3fb1448 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/RoundTripTesterRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/RoundTripTesterRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java index 01ec6cc4bb..0ef4b664ac 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -257,6 +257,11 @@ public class SerializerTestConnector extends AbstractExtensionConnector { public void sendDate(Date date) { rpc.sendDate(date); } + + @Override + public void log(String message) { + // Do nothing, used only in the other direction + } }); } @@ -271,13 +276,80 @@ public class SerializerTestConnector extends AbstractExtensionConnector { } @Override - public ComplexTestBean getState() { - return (ComplexTestBean) super.getState(); + public SerializerTestState getState() { + return (SerializerTestState) super.getState(); } @Override public void onStateChanged(StateChangeEvent stateChangeEvent) { - // TODO do something clever + rpc.log("state.booleanValue: " + getState().booleanValue); + rpc.log("state.booleanObjectValue: " + getState().booleanObjectValue); + rpc.log("state.booleanArray: " + getState().booleanArray); + + rpc.log("state.byteValue: " + getState().byteValue); + rpc.log("state.byteObjectValue: " + getState().byteObjectValue); + rpc.log("state.byteArray: " + getState().byteArray); + + rpc.log("state.charValue: " + getState().charValue); + rpc.log("state.charObjectValue: " + getState().charObjectValue); + rpc.log("state.charArray: " + String.valueOf(getState().charArray)); + + rpc.log("state.intValue: " + getState().intValue); + rpc.log("state.intObjectValue: " + getState().intObjectValue); + rpc.log("state.intArray: " + getState().intArray); + + rpc.log("state.longValue: " + getState().longValue); + rpc.log("state.longObjectValue: " + getState().longObjectValue); + rpc.log("state.longArray: " + getState().longArray); + + rpc.log("state.floatValue: " + getState().floatValue); + rpc.log("state.floatObjectValue: " + getState().floatObjectValue); + rpc.log("state.floatArray: " + getState().floatArray); + + rpc.log("state.doubleValue: " + getState().doubleValue); + rpc.log("state.doubleObjectValue: " + getState().doubleObjectValue); + rpc.log("state.doubleArray: " + getState().doubleArray); + + /* + * TODO public double doubleValue; public Double DoubleValue; public + * double[] doubleArray; ; + * + * public String string; + * + * public String nullString; + * + * public Connector connector; + * + * public ComplexTestBean complexTestBean; public SimpleTestBean + * simpleTestBean; public SimpleTestBean[] simpleTestBeanArray; public + * int[][] nestedIntArray; public SimpleTestBean[][] nestedBeanArray; + * + * public List<Integer> intList; public List<Connector> connectorList; + * public List<SimpleTestBean> simpleTestBeanList; + * + * public List<int[]> primitiveArrayList; public List<Integer[]> + * objectArrayList; public List<SimpleTestBean[]> beanArrayList; + * + * public List<Integer>[] objectListArray; public List<SimpleTestBean>[] + * beanListArray; + * + * public Set<Integer> intSet; public Set<Connector> connectorSet; + * public Set<SimpleTestBean> beanSet; + * + * public Map<String, SimpleTestBean> stringMap; public Map<Connector, + * SimpleTestBean> connectorMap; public Map<Integer, Connector> intMap; + * public Map<SimpleTestBean, SimpleTestBean> beanMap; + * + * public Map<Set<SimpleTestBean>, Map<Integer, List<SimpleTestBean>>> + * generics; + * + * public ContentMode contentMode; public ContentMode[] array; public + * List<ContentMode> list; + * + * public SimpleTestBean bean; + * + * public Date date1; public Date date2; + */ } @Override diff --git a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestRpc.java index fb5b6a1980..6b4c4e7ac1 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -81,4 +81,6 @@ public interface SerializerTestRpc extends ServerRpc, ClientRpc { public void sendBeanSubclass(SimpleTestBean bean); public void sendDate(Date date); + + public void log(String string); } diff --git a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestState.java b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestState.java new file mode 100644 index 0000000000..d22165b2bb --- /dev/null +++ b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestState.java @@ -0,0 +1,100 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License; Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing; software + * distributed under the License is distributed on an "AS IS" BASIS; WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND; either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.widgetset.client; + +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.vaadin.shared.AbstractComponentState; +import com.vaadin.shared.Connector; +import com.vaadin.shared.ui.label.ContentMode; + +public class SerializerTestState extends AbstractComponentState { + + public boolean booleanValue; + public Boolean booleanObjectValue; + public boolean[] booleanArray; + + public byte byteValue; + public Byte byteObjectValue; + public byte[] byteArray; + + public char charValue; + public Character charObjectValue; + public char[] charArray; + + public int intValue; + public Integer intObjectValue; + public int[] intArray; + + public long longValue; + public Long longObjectValue; + public long[] longArray; + + public float floatValue; + public Float floatObjectValue; + public float[] floatArray; + + public double doubleValue; + public Double doubleObjectValue; + public double[] doubleArray; + + public String string; + + public String nullString; + + public Connector connector; + + public ComplexTestBean complexTestBean; + public SimpleTestBean simpleTestBean; + public SimpleTestBean[] simpleTestBeanArray; + public int[][] nestedIntArray; + public SimpleTestBean[][] nestedBeanArray; + + public List<Integer> intList; + public List<Connector> connectorList; + public List<SimpleTestBean> simpleTestBeanList; + + public List<int[]> primitiveArrayList; + public List<Integer[]> objectArrayList; + public List<SimpleTestBean[]> beanArrayList; + + public List<Integer>[] objectListArray; + public List<SimpleTestBean>[] beanListArray; + + public Set<Integer> intSet; + public Set<Connector> connectorSet; + public Set<SimpleTestBean> beanSet; + + public Map<String, SimpleTestBean> stringMap; + public Map<Connector, SimpleTestBean> connectorMap; + public Map<Integer, Connector> intMap; + public Map<SimpleTestBean, SimpleTestBean> beanMap; + + public Map<Set<SimpleTestBean>, Map<Integer, List<SimpleTestBean>>> generics; + + public ContentMode contentMode; + public ContentMode[] array; + public List<ContentMode> list; + + public SimpleTestBean bean; + + public Date date1; + public Date date2; + +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/SimpleTestBean.java b/uitest/src/com/vaadin/tests/widgetset/client/SimpleTestBean.java index 00761a2fed..51d172ee21 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/SimpleTestBean.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/SimpleTestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -47,4 +47,4 @@ public class SimpleTestBean implements Serializable { // Implement hash code to get consistent HashSet.toString return value; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/VExtendedTextArea.java b/uitest/src/com/vaadin/tests/widgetset/client/VExtendedTextArea.java index c0f7443b2e..dce7fc04cf 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/VExtendedTextArea.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/VExtendedTextArea.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java index 203a137f1b..95e286e4de 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java index 89d906f050..f825115ec8 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java index 55e11fea4c..eb869dedbc 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java b/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java index eddca38198..dca007c2ee 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateState.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateState.java index cf02f50a78..c1b6aef830 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateState.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateStateConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateStateConnector.java index 2cc7400b1a..6b12e7d3c6 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateStateConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateStateConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentClientRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentClientRpc.java index f85d67da4b..fc7eadced1 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentClientRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentClientRpc.java @@ -6,4 +6,4 @@ public interface MyComponentClientRpc extends ClientRpc { public void alert(String message); -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentConnector.java index 4745457c1f..3b599bc668 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentConnector.java @@ -55,4 +55,4 @@ public class MyComponentConnector extends AbstractComponentConnector { return (MyComponentWidget) super.getWidget(); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentServerRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentServerRpc.java index 5571ffb701..d8d8ec8827 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentServerRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentServerRpc.java @@ -7,4 +7,4 @@ public interface MyComponentServerRpc extends ServerRpc { public void clicked(MouseEventDetails mouseDetails); -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentState.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentState.java index a7a6b987fb..df7e8c08ee 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentState.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentState.java @@ -6,4 +6,4 @@ public class MyComponentState extends AbstractComponentState { public String text; -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentWidget.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentWidget.java index ebc4cdbdb3..ba27fee6a3 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentWidget.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentWidget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ResourceInStateConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ResourceInStateConnector.java index 6841617be5..df3dd5b753 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ResourceInStateConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ResourceInStateConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/VWidgetContainer.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/VWidgetContainer.java index 6ec0a6da7c..2a305a8469 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/VWidgetContainer.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/VWidgetContainer.java @@ -9,4 +9,4 @@ public class VWidgetContainer extends VerticalPanel { public VWidgetContainer() { setStyleName(CLASSNAME); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/WidgetContainerConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/WidgetContainerConnector.java index 62686dfded..88911e245d 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/WidgetContainerConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/WidgetContainerConnector.java @@ -30,4 +30,4 @@ public class WidgetContainerConnector extends @Override public void updateCaption(ComponentConnector connector) { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/CapsLockWarningConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/CapsLockWarningConnector.java index 044c5a18f6..3ac0db54fa 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/CapsLockWarningConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/CapsLockWarningConnector.java @@ -37,4 +37,4 @@ public class CapsLockWarningConnector extends AbstractExtensionConnector { private boolean isCapsLockOn(KeyPressEvent e) { return e.isShiftKeyDown() ^ Character.isUpperCase(e.getCharCode()); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherConnector.java index b077d5b42d..bee8eaed41 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherConnector.java @@ -41,4 +41,4 @@ public class RefresherConnector extends AbstractExtensionConnector { public RefresherState getState() { return (RefresherState) super.getState(); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherRpc.java index df9c9733f7..77fe7f78b5 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherRpc.java @@ -4,4 +4,4 @@ import com.vaadin.shared.communication.ServerRpc; public interface RefresherRpc extends ServerRpc { public void refresh(); -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherState.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherState.java index 13e8d8bc1d..8ba705559d 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherState.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherState.java @@ -4,4 +4,4 @@ import com.vaadin.shared.communication.SharedState; public class RefresherState extends SharedState { public int interval; -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningRpc.java index 2949feed07..cf73f2a00d 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningWithRpcConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningWithRpcConnector.java index c587f53968..2f1d31a9d7 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningWithRpcConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningWithRpcConnector.java @@ -43,4 +43,4 @@ public class CapsLockWarningWithRpcConnector extends AbstractExtensionConnector private boolean isCapsLockOn(KeyPressEvent e) { return e.isShiftKeyDown() ^ Character.isUpperCase(e.getCharCode()); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClass.java b/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClass.java index cbc46b26f5..b5136b926e 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClass.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClass.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClassComponent.java b/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClassComponent.java index 135f112fe4..5b03634755 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClassComponent.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClassComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClassTest.java b/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClassTest.java index 16c5ba4b61..7ff8291494 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClassTest.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClassTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/server/DelegateToWidgetComponent.java b/uitest/src/com/vaadin/tests/widgetset/server/DelegateToWidgetComponent.java index 2f7f0e737f..808b3bb9b7 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/DelegateToWidgetComponent.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/DelegateToWidgetComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/server/DelegateWithoutStateClassComponent.java b/uitest/src/com/vaadin/tests/widgetset/server/DelegateWithoutStateClassComponent.java index 13839dcc64..2af7efa8a4 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/DelegateWithoutStateClassComponent.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/DelegateWithoutStateClassComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/server/DummyLabel.java b/uitest/src/com/vaadin/tests/widgetset/server/DummyLabel.java index fd22725cef..881cbcc7c5 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/DummyLabel.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/DummyLabel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/server/GenericWidgetComponent.java b/uitest/src/com/vaadin/tests/widgetset/server/GenericWidgetComponent.java index 2be59ee96b..32320f0158 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/GenericWidgetComponent.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/GenericWidgetComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/server/MissingFromDefaultWidgetsetComponent.java b/uitest/src/com/vaadin/tests/widgetset/server/MissingFromDefaultWidgetsetComponent.java index 1a4e409653..37a33cc693 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/MissingFromDefaultWidgetsetComponent.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/MissingFromDefaultWidgetsetComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/server/RoundTripTester.java b/uitest/src/com/vaadin/tests/widgetset/server/RoundTripTester.java index c8e561e665..ab123be70d 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/RoundTripTester.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/RoundTripTester.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of diff --git a/uitest/src/com/vaadin/tests/widgetset/server/SerializerTestExtension.java b/uitest/src/com/vaadin/tests/widgetset/server/SerializerTestExtension.java index 577cdde5a1..5fc5c19497 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/SerializerTestExtension.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/SerializerTestExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -18,8 +18,8 @@ package com.vaadin.tests.widgetset.server; import com.vaadin.server.AbstractExtension; import com.vaadin.shared.communication.ClientRpc; -import com.vaadin.tests.widgetset.client.ComplexTestBean; import com.vaadin.tests.widgetset.client.SerializerTestRpc; +import com.vaadin.tests.widgetset.client.SerializerTestState; public class SerializerTestExtension extends AbstractExtension { @@ -29,8 +29,8 @@ public class SerializerTestExtension extends AbstractExtension { } @Override - public ComplexTestBean getState() { - return (ComplexTestBean) super.getState(); + public SerializerTestState getState() { + return (SerializerTestState) super.getState(); } public void registerRpc(SerializerTestRpc rpc) { |