diff options
Diffstat (limited to 'uitest/src/com')
36 files changed, 710 insertions, 56 deletions
diff --git a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java index 0634943d09..c356465fcc 100644 --- a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java +++ b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java @@ -37,7 +37,7 @@ import com.vaadin.server.SessionInitListener; import com.vaadin.server.UIClassSelectionEvent; import com.vaadin.server.UIProvider; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.server.VaadinServletRequest; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.UI; @@ -135,7 +135,7 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet { } protected void onVaadinSessionStarted(VaadinRequest request, - VaadinServiceSession session) throws ServiceException { + VaadinSession session) throws ServiceException { try { final Class<?> classToRun = getClassToRun(); if (UI.class.isAssignableFrom(classToRun)) { diff --git a/uitest/src/com/vaadin/tests/ModalWindow.java b/uitest/src/com/vaadin/tests/ModalWindow.java index 4793797941..156f42adf3 100644 --- a/uitest/src/com/vaadin/tests/ModalWindow.java +++ b/uitest/src/com/vaadin/tests/ModalWindow.java @@ -31,7 +31,7 @@ import com.vaadin.ui.Window; * * @author Vaadin Ltd. * @since 4.0.1 - * @see com.vaadin.server.VaadinServiceSession + * @see com.vaadin.server.VaadinSession * @see com.vaadin.ui.Window * @see com.vaadin.ui.Label */ diff --git a/uitest/src/com/vaadin/tests/Parameters.java b/uitest/src/com/vaadin/tests/Parameters.java index 1ea02699ce..934a98e910 100644 --- a/uitest/src/com/vaadin/tests/Parameters.java +++ b/uitest/src/com/vaadin/tests/Parameters.java @@ -25,7 +25,7 @@ import com.vaadin.server.ExternalResource; import com.vaadin.server.RequestHandler; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinResponse; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.Label; import com.vaadin.ui.LegacyWindow; import com.vaadin.ui.Link; @@ -55,7 +55,7 @@ public class Parameters extends com.vaadin.server.LegacyApplication implements setMainWindow(main); // This class acts both as URI handler and parameter handler - VaadinServiceSession.getCurrent().addRequestHandler(this); + VaadinSession.getCurrent().addRequestHandler(this); final VerticalLayout layout = new VerticalLayout(); final Label info = new Label("To test URI and Parameter Handlers, " @@ -107,10 +107,10 @@ public class Parameters extends com.vaadin.server.LegacyApplication implements } @Override - public boolean handleRequest(VaadinServiceSession session, + public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { context.setValue("Context not available"); - relative.setValue(request.getRequestPathInfo()); + relative.setValue(request.getPathInfo()); params.removeAllItems(); Map<String, String[]> parameters = request.getParameterMap(); diff --git a/uitest/src/com/vaadin/tests/TestBench.java b/uitest/src/com/vaadin/tests/TestBench.java index d18ce04f64..6d5e162301 100644 --- a/uitest/src/com/vaadin/tests/TestBench.java +++ b/uitest/src/com/vaadin/tests/TestBench.java @@ -311,7 +311,7 @@ public class TestBench extends com.vaadin.server.LegacyApplication implements final Class<?> c = Class.forName(p); if (c.getSuperclass() != null) { if ((c.getSuperclass() - .equals(com.vaadin.server.VaadinServiceSession.class))) { + .equals(com.vaadin.server.VaadinSession.class))) { classes.add(c); } else if ((c.getSuperclass() .equals(com.vaadin.ui.CustomComponent.class))) { diff --git a/uitest/src/com/vaadin/tests/TreeFilesystem.java b/uitest/src/com/vaadin/tests/TreeFilesystem.java index d127095c6f..67da6c273a 100644 --- a/uitest/src/com/vaadin/tests/TreeFilesystem.java +++ b/uitest/src/com/vaadin/tests/TreeFilesystem.java @@ -19,7 +19,7 @@ package com.vaadin.tests; import java.io.File; import com.vaadin.data.Item; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.tests.util.SampleDirectory; import com.vaadin.ui.Label; @@ -67,7 +67,7 @@ public class TreeFilesystem extends com.vaadin.server.LegacyApplication // Get sample directory final File sampleDir = SampleDirectory.getDirectory( - VaadinServiceSession.getCurrent(), main); + VaadinSession.getCurrent(), main); // populate tree's root node with example directory if (sampleDir != null) { populateNode(sampleDir.getAbsolutePath(), null); diff --git a/uitest/src/com/vaadin/tests/TreeFilesystemContainer.java b/uitest/src/com/vaadin/tests/TreeFilesystemContainer.java index 00f3b15fd0..92c53524e2 100644 --- a/uitest/src/com/vaadin/tests/TreeFilesystemContainer.java +++ b/uitest/src/com/vaadin/tests/TreeFilesystemContainer.java @@ -20,7 +20,7 @@ import java.io.File; import com.vaadin.data.util.FilesystemContainer; import com.vaadin.data.util.FilesystemContainer.FileItem; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.tests.util.SampleDirectory; import com.vaadin.ui.Component.Event; import com.vaadin.ui.Component.Listener; @@ -85,7 +85,7 @@ public class TreeFilesystemContainer extends // Get sample directory final File sampleDir = SampleDirectory.getDirectory( - VaadinServiceSession.getCurrent(), w); + VaadinSession.getCurrent(), w); // Populate tree with FilesystemContainer final FilesystemContainer fsc = new FilesystemContainer(sampleDir, true); filesystem.setContainerDataSource(fsc); diff --git a/uitest/src/com/vaadin/tests/application/DeploymentConfigurationTest.html b/uitest/src/com/vaadin/tests/application/DeploymentConfigurationTest.html index f5ad0987aa..2bdb7c79a5 100644 --- a/uitest/src/com/vaadin/tests/application/DeploymentConfigurationTest.html +++ b/uitest/src/com/vaadin/tests/application/DeploymentConfigurationTest.html @@ -18,7 +18,7 @@ </tr> <tr> <td>assertTextPresent</td> - <td>exact:closeIdleUIs: true</td> + <td>exact:closeIdleSessions: true</td> <td></td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/application/NavigateWithOngoingXHR.java b/uitest/src/com/vaadin/tests/application/NavigateWithOngoingXHR.java new file mode 100644 index 0000000000..d32ecb583d --- /dev/null +++ b/uitest/src/com/vaadin/tests/application/NavigateWithOngoingXHR.java @@ -0,0 +1,116 @@ +/* + * Copyright 2012 Vaadin Ltd. + * + * Licensed under the Apache 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.application; + +import java.io.IOException; +import java.io.PrintWriter; + +import com.vaadin.server.ExternalResource; +import com.vaadin.server.RequestHandler; +import com.vaadin.server.VaadinRequest; +import com.vaadin.server.VaadinResponse; +import com.vaadin.server.VaadinSession; +import com.vaadin.shared.ui.progressindicator.ProgressIndicatorServerRpc; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Link; +import com.vaadin.ui.ProgressIndicator; + +public class NavigateWithOngoingXHR extends AbstractTestUI { + private final RequestHandler slowRequestHandler = new RequestHandler() { + @Override + public boolean handleRequest(VaadinSession session, + VaadinRequest request, VaadinResponse response) + throws IOException { + if ("/slowRequestHandler".equals(request.getPathInfo())) { + // Make the navigation request last longer to keep the + // communication error visible + // System.out.println("Got slow content request"); + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + if (request.getParameter("download") != null) { + response.setHeader("Content-Disposition", "attachment"); + } + + response.setContentType("text/plain"); + PrintWriter writer = response.getWriter(); + writer.println("Loaded slowly"); + writer.close(); + + // System.out.println("Finished slow content request"); + + return true; + } + return false; + } + }; + + @Override + protected void setup(VaadinRequest request) { + addComponent(new ProgressIndicator() { + { + registerRpc(new ProgressIndicatorServerRpc() { + @Override + public void poll() { + // System.out.println("Pausing poll request"); + try { + // Make the XHR request last longer to make it + // easier to click the link at the right moment. + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + // System.out.println("Continuing poll request"); + } + }); + setPollingInterval(3000); + } + }); + + // Hacky URLs that are might not work in all deployment scenarios + addComponent(new Link("Navigate away", new ExternalResource( + "slowRequestHandler"))); + addComponent(new Link("Start download", new ExternalResource( + "slowRequestHandler?download"))); + } + + @Override + public void attach() { + super.attach(); + getSession().addRequestHandler(slowRequestHandler); + } + + @Override + public void detach() { + getSession().removeRequestHandler(slowRequestHandler); + super.detach(); + } + + @Override + protected String getTestDescription() { + return "Navigating away from a Vaadin page while there's an ongoing XHR request should not cause a communication error to be displayed"; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(8891); + } + +} diff --git a/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java b/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java index ac4e421fdc..57c4e3c7b9 100644 --- a/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java +++ b/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java @@ -3,7 +3,7 @@ package com.vaadin.tests.application; import com.vaadin.server.DownloadStream; import com.vaadin.server.PaintException; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.tests.integration.FlagSeResource; import com.vaadin.tests.util.Log; @@ -14,7 +14,7 @@ import com.vaadin.ui.LegacyWindow; import com.vaadin.ui.UI; public class ThreadLocalInstances extends AbstractTestCase { - private static final VaadinServiceSession staticInitApplication = VaadinServiceSession + private static final VaadinSession staticInitApplication = VaadinSession .getCurrent(); private static final UI staticInitRoot = UI.getCurrent(); @@ -90,10 +90,10 @@ public class ThreadLocalInstances extends AbstractTestCase { } private void reportCurrentStatus(String phase) { - reportStatus(phase, VaadinServiceSession.getCurrent(), UI.getCurrent()); + reportStatus(phase, VaadinSession.getCurrent(), UI.getCurrent()); } - private void reportStatus(String phase, VaadinServiceSession application, + private void reportStatus(String phase, VaadinSession application, UI uI) { log.log(getState(application, this) + " app in " + phase); log.log(getState(uI, mainWindow) + " root in " + phase); diff --git a/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java b/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java index b4f29dda06..e62cd9a4f9 100644 --- a/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java +++ b/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java @@ -27,7 +27,7 @@ public class InitParamUIProvider extends UIProvider { @Override public Class<? extends UI> getUIClass(UIClassSelectionEvent event) { VaadinRequest request = event.getRequest(); - String pathInfo = request.getRequestPathInfo(); + String pathInfo = request.getPathInfo(); if ("/test".equals(pathInfo)) { return BasicJavaScriptComponent.class; } else { diff --git a/uitest/src/com/vaadin/tests/applicationservlet/SystemMessagesTest.html b/uitest/src/com/vaadin/tests/applicationservlet/SystemMessagesTest.html new file mode 100644 index 0000000000..a764255b5b --- /dev/null +++ b/uitest/src/com/vaadin/tests/applicationservlet/SystemMessagesTest.html @@ -0,0 +1,52 @@ +<?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>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.applicationservlet.SystemMessagesTest?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsapplicationservletSystemMessagesTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationservletSystemMessagesTest::Root/VNotification[0]/domChild[0]</td>
+ <td>Internal error*MessagesInfo locale: fi_FI</td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.applicationservlet.SystemMessagesTest?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>select</td>
+ <td>vaadin=runcomvaadintestsapplicationservletSystemMessagesTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VNativeSelect[0]/domChild[0]</td>
+ <td>label=de_DE</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsapplicationservletSystemMessagesTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationservletSystemMessagesTest::Root/VNotification[0]/domChild[0]</td>
+ <td>Internal error*MessagesInfo locale: de_DE</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/uitest/src/com/vaadin/tests/applicationservlet/SystemMessagesTest.java b/uitest/src/com/vaadin/tests/applicationservlet/SystemMessagesTest.java new file mode 100644 index 0000000000..516c0ca8e0 --- /dev/null +++ b/uitest/src/com/vaadin/tests/applicationservlet/SystemMessagesTest.java @@ -0,0 +1,90 @@ +package com.vaadin.tests.applicationservlet;
+
+import java.util.Locale;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.server.CustomizedSystemMessages;
+import com.vaadin.server.SystemMessages;
+import com.vaadin.server.SystemMessagesInfo;
+import com.vaadin.server.SystemMessagesProvider;
+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.NativeSelect;
+
+public class SystemMessagesTest extends AbstractTestUI {
+
+ public class MyButton extends Button {
+ private boolean fail = false;
+
+ @Override
+ public void beforeClientResponse(boolean initial) {
+ super.beforeClientResponse(initial);
+ if (fail) {
+ throw new RuntimeException("Failed on purpose");
+ }
+ }
+
+ }
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ final NativeSelect localeSelect = new NativeSelect("UI locale");
+ localeSelect.setImmediate(true);
+ localeSelect.addItem(new Locale("en", "US"));
+ localeSelect.addItem(new Locale("fi", "FI"));
+ localeSelect.addItem(Locale.GERMANY);
+ localeSelect.addValueChangeListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ setLocale((Locale) localeSelect.getValue());
+ getSession().getService().setSystemMessagesProvider(
+ new SystemMessagesProvider() {
+
+ @Override
+ public SystemMessages getSystemMessages(
+ SystemMessagesInfo systemMessagesInfo) {
+ CustomizedSystemMessages csm = new CustomizedSystemMessages();
+ // csm.setInternalErrorCaption("Request query string: "
+ // + ((VaadinServletRequest) systemMessagesInfo
+ // .getRequest()).getQueryString());
+ csm.setInternalErrorMessage("MessagesInfo locale: "
+ + systemMessagesInfo.getLocale());
+ return csm;
+
+ }
+ });
+ }
+ });
+ localeSelect.setValue(new Locale("fi", "FI"));
+ addComponent(localeSelect);
+ final MyButton failButton = new MyButton();
+ failButton.setCaption("Generate server side error");
+ failButton.addClickListener(new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ failButton.fail = true;
+ }
+ });
+ addComponent(failButton);
+
+ }
+
+ @Override
+ protected String getTestDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/AbstractTestCase.java b/uitest/src/com/vaadin/tests/components/AbstractTestCase.java index e7423173c7..1f117a8ea8 100644 --- a/uitest/src/com/vaadin/tests/components/AbstractTestCase.java +++ b/uitest/src/com/vaadin/tests/components/AbstractTestCase.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components; import com.vaadin.server.LegacyApplication; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WebBrowser; public abstract class AbstractTestCase extends LegacyApplication { @@ -11,7 +11,7 @@ public abstract class AbstractTestCase extends LegacyApplication { protected abstract Integer getTicketNumber(); protected WebBrowser getBrowser() { - WebBrowser webBrowser = VaadinServiceSession.getCurrent().getBrowser(); + WebBrowser webBrowser = VaadinSession.getCurrent().getBrowser(); return webBrowser; } diff --git a/uitest/src/com/vaadin/tests/components/AbstractTestUIProvider.java b/uitest/src/com/vaadin/tests/components/AbstractTestUIProvider.java index 2bb460e8b5..9ad6bbf56f 100644 --- a/uitest/src/com/vaadin/tests/components/AbstractTestUIProvider.java +++ b/uitest/src/com/vaadin/tests/components/AbstractTestUIProvider.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components; import com.vaadin.server.UIProvider; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WebBrowser; public abstract class AbstractTestUIProvider extends UIProvider { @@ -10,7 +10,7 @@ public abstract class AbstractTestUIProvider extends UIProvider { protected abstract Integer getTicketNumber(); protected WebBrowser getBrowser() { - WebBrowser webBrowser = VaadinServiceSession.getCurrent().getBrowser(); + WebBrowser webBrowser = VaadinSession.getCurrent().getBrowser(); return webBrowser; } } diff --git a/uitest/src/com/vaadin/tests/components/FileDownloaderTest.html b/uitest/src/com/vaadin/tests/components/FileDownloaderTest.html new file mode 100644 index 0000000000..bfe87091cc --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/FileDownloaderTest.html @@ -0,0 +1,36 @@ +<?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/com.vaadin.tests.components.FileDownloaderTest?restartApplication</td> + <td></td> +</tr> +<tr> + <td>assertElementPresent</td> + <td>vaadin=runcomvaadintestscomponentsFileDownloaderTest::PID_Scom.vaadin.ui.ButtonDynamicimage/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsFileDownloaderTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[4]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>vaadin=runcomvaadintestscomponentsFileDownloaderTest::PID_Scom.vaadin.ui.ButtonDynamicimage/domChild[0]/domChild[0]</td> + <td></td> +</tr> +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/FileDownloaderTest.java b/uitest/src/com/vaadin/tests/components/FileDownloaderTest.java index e773c8c75b..55d2afd32d 100644 --- a/uitest/src/com/vaadin/tests/components/FileDownloaderTest.java +++ b/uitest/src/com/vaadin/tests/components/FileDownloaderTest.java @@ -37,6 +37,7 @@ import com.vaadin.server.StreamResource; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinResponse; import com.vaadin.tests.components.embedded.EmbeddedPdf; +import com.vaadin.tests.util.Log; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; @@ -45,12 +46,18 @@ import com.vaadin.ui.Component; import com.vaadin.ui.CssLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; +import com.vaadin.ui.Layout; import com.vaadin.ui.NativeButton; public class FileDownloaderTest extends AbstractTestUI { + private AbstractComponent firstDownloadComponent; + private Log log = new Log(5); + @Override protected void setup(VaadinRequest request) { + addComponent(log); + List<Class<? extends Component>> components = new ArrayList<Class<? extends Component>>(); components.add(Button.class); components.add(NativeButton.class); @@ -104,6 +111,29 @@ public class FileDownloaderTest extends AbstractTestUI { // addComponents(resource, components); resource = new ClassResource(new EmbeddedPdf().getClass(), "test.pdf"); addComponents("Class resource pdf", resource, components); + + addComponent(new Button("Remove first download button", + new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + Layout parent = (Layout) firstDownloadComponent + .getParent(); + parent.removeComponent(firstDownloadComponent); + } + })); + addComponent(new Button( + "Detach FileDownloader from first download button", + new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + FileDownloader e = (FileDownloader) firstDownloadComponent + .getExtensions().iterator().next(); + e.removeFromTarget(); + log.log("FileDownload detached"); + } + })); } public void addComponents(String caption, ConnectorResource resource, @@ -113,7 +143,11 @@ public class FileDownloaderTest extends AbstractTestUI { for (Class<? extends Component> cls : components) { try { AbstractComponent c = (AbstractComponent) cls.newInstance(); - c.setId(cls.getName()); + if (firstDownloadComponent == null) { + firstDownloadComponent = c; + } + + c.setId(cls.getName() + caption.replace(" ", "")); c.setCaption(cls.getName()); c.setDescription(resource.getMIMEType() + " / " + resource.getClass()); diff --git a/uitest/src/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java b/uitest/src/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java index 971bd1cbe3..2eef498aff 100644 --- a/uitest/src/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java +++ b/uitest/src/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java @@ -8,7 +8,7 @@ import com.vaadin.data.Container; import com.vaadin.data.Item; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.Log; import com.vaadin.ui.AbstractField; @@ -55,7 +55,7 @@ public abstract class AbstractComponentDataBindingTest extends TestBase } protected void updateLocale(Locale locale) { - VaadinServiceSession.getCurrent().setLocale(locale); + VaadinSession.getCurrent().setLocale(locale); for (Component c : fields) { removeComponent(c); } diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldTest.html b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldTest.html new file mode 100644 index 0000000000..eb9859bf9d --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldTest.html @@ -0,0 +1,102 @@ +<?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>PopupDateFieldTest</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">PopupDateFieldTest</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.datefield.PopupDateFieldTest?restartApplication</td> + <td></td> +</tr> +<tr> + <td>assertEditable</td> + <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#field</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::/VVerticalLayout[0]/VVerticalLayout[0]/VMenuBar[0]#item0</td> + <td>29,9</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[0]/VMenuBar[0]#item4</td> + <td>26,9</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[1]/VMenuBar[0]#item6</td> + <td>84,9</td> +</tr> +<tr> + <td>assertNotEditable</td> + <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#field</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::/VVerticalLayout[0]/VVerticalLayout[0]/VMenuBar[0]#item0</td> + <td>31,6</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[0]/VMenuBar[0]#item0</td> + <td>29,7</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[1]/VMenuBar[0]#item1</td> + <td>42,7</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::/VVerticalLayout[0]/VVerticalLayout[0]/VMenuBar[0]#item0</td> + <td>45,7</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[0]/VMenuBar[0]#item0</td> + <td>43,7</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[1]/VMenuBar[0]#item1</td> + <td>39,6</td> +</tr> +<tr> + <td>assertNotEditable</td> + <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#field</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::/VVerticalLayout[0]/VVerticalLayout[0]/VMenuBar[0]#item0</td> + <td>36,7</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[0]/VMenuBar[0]#item4</td> + <td>34,6</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[1]/VMenuBar[0]#item6</td> + <td>71,7</td> +</tr> +<tr> + <td>assertEditable</td> + <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#field</td> + <td></td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldTest.java b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldTest.java index 3e8b0678a7..6e3250a825 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldTest.java +++ b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldTest.java @@ -16,6 +16,7 @@ public class PopupDateFieldTest extends DateFieldTest<PopupDateField> { super.createActions(); createInputPromptSelectAction(CATEGORY_FEATURES); + createTextEnabledAction(CATEGORY_FEATURES); } private void createInputPromptSelectAction(String category) { @@ -36,4 +37,16 @@ public class PopupDateFieldTest extends DateFieldTest<PopupDateField> { }); } + private void createTextEnabledAction(String category) { + this.createBooleanAction("Text field enabled", category, true, + new Command<PopupDateField, Boolean>() { + + @Override + public void execute(PopupDateField c, Boolean value, + Object data) { + c.setTextFieldEnabled(value); + } + + }); + } } diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldTextEnabled.java b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldTextEnabled.java new file mode 100644 index 0000000000..731869f668 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldTextEnabled.java @@ -0,0 +1,43 @@ +package com.vaadin.tests.components.datefield; + +import com.vaadin.data.Property; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.CheckBox; +import com.vaadin.ui.PopupDateField; + +public class PopupDateFieldTextEnabled extends TestBase { + + private static final String ENABLED = "DateField text box enabled"; + private static final String DISABLED = "DateField text box disabled"; + @Override + public void setup() { + final PopupDateField field = new PopupDateField(); + final CheckBox box = new CheckBox(ENABLED, true); + box.addListener(new Property.ValueChangeListener() { + + @Override + public void valueChange(Property.ValueChangeEvent event) { + field.setTextFieldEnabled((Boolean) event.getProperty() + .getValue()); + if(field.isTextFieldEnabled()){ + box.setCaption(ENABLED); + }else{ + box.setCaption(DISABLED); + } + } + }); + addComponent(box); + addComponent(field); + } + + @Override + protected String getDescription() { + return "tests whether or not enabling text field in the component works"; + } + + @Override + protected Integer getTicketNumber() { + return 6790; + } + +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/ui/LazyInitUIs.java b/uitest/src/com/vaadin/tests/components/ui/LazyInitUIs.java index 57fc9f3e62..984ac69d6e 100644 --- a/uitest/src/com/vaadin/tests/components/ui/LazyInitUIs.java +++ b/uitest/src/com/vaadin/tests/components/ui/LazyInitUIs.java @@ -87,7 +87,7 @@ public class LazyInitUIs extends AbstractTestUIProvider { public static Label getRequestInfo(String name, VaadinRequest request) { String info = name; - info += "<br />pathInfo: " + request.getRequestPathInfo(); + info += "<br />pathInfo: " + request.getPathInfo(); info += "<br />parameters: " + request.getParameterMap().keySet(); info += "<br />uri fragment: " + Page.getCurrent().getLocation().getFragment(); diff --git a/uitest/src/com/vaadin/tests/components/ui/UIInitBrowserDetails.html b/uitest/src/com/vaadin/tests/components/ui/UIInitBrowserDetails.html new file mode 100644 index 0000000000..3fd7a0d560 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/UIInitBrowserDetails.html @@ -0,0 +1,112 @@ +<?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:8070/" /> +<title>UIInitBrowserDetails</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">UIInitBrowserDetails</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/UIInitBrowserDetails?restartApplication</td> + <td></td> +</tr> +<!--location--> +<tr> + <td>assertNotText</td> + <td>vaadin=runUIInitBrowserDetails::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VGridLayout[0]/VLabel[4]</td> + <td>null</td> +</tr> +<tr> + <td>assertNotText</td> + <td>vaadin=runUIInitBrowserDetails::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VGridLayout[0]/VLabel[2]</td> + <td>null</td> +</tr> +<!--browser window width--> +<tr> + <td>assertNotText</td> + <td>vaadin=runUIInitBrowserDetails::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VGridLayout[0]/VLabel[4]</td> + <td>null</td> +</tr> +<tr> + <td>assertNotText</td> + <td>vaadin=runUIInitBrowserDetails::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VGridLayout[0]/VLabel[5]</td> + <td>-1</td> +</tr> +<!--browser window height--> +<tr> + <td>assertNotText</td> + <td>vaadin=runUIInitBrowserDetails::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VGridLayout[0]/VLabel[10]</td> + <td>null</td> +</tr> +<tr> + <td>assertNotText</td> + <td>vaadin=runUIInitBrowserDetails::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VGridLayout[0]/VLabel[8]</td> + <td>-1</td> +</tr> +<!--screen width--> +<tr> + <td>assertNotText</td> + <td>vaadin=runUIInitBrowserDetails::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VGridLayout[0]/VLabel[10]</td> + <td>null</td> +</tr> +<tr> + <td>assertNotText</td> + <td>vaadin=runUIInitBrowserDetails::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VGridLayout[0]/VLabel[11]</td> + <td>-1</td> +</tr> +<!--screen height--> +<tr> + <td>assertNotText</td> + <td>vaadin=runUIInitBrowserDetails::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VGridLayout[0]/VLabel[13]</td> + <td>null</td> +</tr> +<tr> + <td>assertNotText</td> + <td>vaadin=runUIInitBrowserDetails::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VGridLayout[0]/VLabel[14]</td> + <td>-1</td> +</tr> +<!--timezone offset--> +<tr> + <td>assertNotText</td> + <td>vaadin=runUIInitBrowserDetails::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VGridLayout[0]/VLabel[16]</td> + <td>null</td> +</tr> +<!--raw timezone offset--> +<tr> + <td>assertNotText</td> + <td>vaadin=runUIInitBrowserDetails::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VGridLayout[0]/VLabel[19]</td> + <td>null</td> +</tr> +<!--dst saving--> +<tr> + <td>assertNotText</td> + <td>vaadin=runUIInitBrowserDetails::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VGridLayout[0]/VLabel[22]</td> + <td>null</td> +</tr> +<!--dst in effect--> +<tr> + <td>assertNotText</td> + <td>vaadin=runUIInitBrowserDetails::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VGridLayout[0]/VLabel[25]</td> + <td>null</td> +</tr> +<!--current date--> +<tr> + <td>assertNotText</td> + <td>vaadin=runUIInitBrowserDetails::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VGridLayout[0]/VLabel[28]</td> + <td>null</td> +</tr> +<tr> + <td>assertNotText</td> + <td>vaadin=runUIInitBrowserDetails::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VGridLayout[0]/VLabel[29]</td> + <td>null</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/ui/UIInitBrowserDetails.java b/uitest/src/com/vaadin/tests/components/ui/UIInitBrowserDetails.java new file mode 100644 index 0000000000..587c9f0f9b --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/UIInitBrowserDetails.java @@ -0,0 +1,56 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ + +package com.vaadin.tests.components.ui; + +import com.vaadin.server.Page; +import com.vaadin.server.VaadinRequest; +import com.vaadin.server.WebBrowser; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.GridLayout; +import com.vaadin.ui.Label; + +public class UIInitBrowserDetails extends AbstractTestUI { + + private GridLayout l = new GridLayout(3, 1); + private VaadinRequest r; + + @Override + protected void setup(VaadinRequest request) { + r = request; + l.setWidth("100%"); + addComponent(l); + + Page p = getPage(); + WebBrowser wb = p.getWebBrowser(); + + addDetail("location", "loc", p.getLocation()); + + addDetail("browser window width", "cw", p.getBrowserWindowWidth()); + addDetail("browser window height", "ch", p.getBrowserWindowHeight()); + addDetail("screen width", "sw", wb.getScreenWidth()); + addDetail("screen height", "sh", wb.getScreenHeight()); + + addDetail("timezone offset", "tzo", wb.getTimezoneOffset()); + addDetail("raw timezone offset", "rtzo", wb.getRawTimezoneOffset()); + addDetail("dst saving", "dstd", wb.getDSTSavings()); + addDetail("dst in effect", "dston", wb.isDSTInEffect()); + addDetail("current date", "curdate", wb.getCurrentDate()); + } + + @Override + public String getTestDescription() { + return "Browser details should be available in UI init"; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(9037); + } + + private void addDetail(String name, String param, Object value) { + l.addComponents(new Label(name), new Label(r.getParameter(param)), + new Label("" + value)); + } +} diff --git a/uitest/src/com/vaadin/tests/components/ui/UIsInMultipleTabs.java b/uitest/src/com/vaadin/tests/components/ui/UIsInMultipleTabs.java index 53df69f028..49b8472a7a 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UIsInMultipleTabs.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIsInMultipleTabs.java @@ -5,7 +5,7 @@ import java.util.concurrent.atomic.AtomicInteger; import com.vaadin.server.UIClassSelectionEvent; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.tests.components.AbstractTestUIProvider; import com.vaadin.ui.Label; import com.vaadin.ui.UI; @@ -13,12 +13,12 @@ import com.vaadin.ui.VerticalLayout; public class UIsInMultipleTabs extends AbstractTestUIProvider { // No cleanup -> will leak, but shouldn't matter for tests - private static ConcurrentHashMap<VaadinServiceSession, AtomicInteger> numberOfUIsOpened = new ConcurrentHashMap<VaadinServiceSession, AtomicInteger>(); + private static ConcurrentHashMap<VaadinSession, AtomicInteger> numberOfUIsOpened = new ConcurrentHashMap<VaadinSession, AtomicInteger>(); public static class TabUI extends UI { @Override protected void init(VaadinRequest request) { - VaadinServiceSession application = VaadinServiceSession + VaadinSession application = VaadinSession .getCurrent(); AtomicInteger count = numberOfUIsOpened.get(application); if (count == null) { diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java index ba7ef78ec1..858f202e6d 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java @@ -17,7 +17,7 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; @@ -41,7 +41,7 @@ public class FindCurrentUI extends UI { @Override public void buttonClick(ClickEvent event) { String msg = "Running in "; - msg += VaadinServiceSession.getCurrent().getConfiguration() + msg += VaadinSession.getCurrent().getConfiguration() .isProductionMode() ? "production" : "debug"; Notification.show(msg); } diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java index c4d496641d..6cf0514df4 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java @@ -44,7 +44,7 @@ public class UsingXyzWhenInitializing extends UI { layout.addComponent(new Label("Hello " + name)); - String pathInfo = request.getRequestPathInfo(); + String pathInfo = request.getPathInfo(); if ("/viewSource".equals(pathInfo)) { layout.addComponent(new Label("This is the source")); } else { diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b1/Addition.java b/uitest/src/com/vaadin/tests/minitutorials/v7b1/Addition.java index a91df49508..f22e56733c 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b1/Addition.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b1/Addition.java @@ -16,7 +16,7 @@ package com.vaadin.tests.minitutorials.v7b1; -import com.vaadin.shared.ComponentState; +import com.vaadin.shared.AbstractComponentState; import com.vaadin.ui.AbstractComponent; public class Addition extends AbstractComponent { @@ -63,6 +63,6 @@ public class Addition extends AbstractComponent { } } -class AddResultState extends ComponentState { +class AddResultState extends AbstractComponentState { public int sum; } diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1589.java b/uitest/src/com/vaadin/tests/tickets/Ticket1589.java index 67b5e3e347..db6fa682fc 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1589.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1589.java @@ -16,7 +16,7 @@ import com.vaadin.server.LegacyApplication; import com.vaadin.server.RequestHandler; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinResponse; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.LegacyWindow; import com.vaadin.ui.Link; @@ -29,7 +29,7 @@ public class Ticket1589 extends LegacyApplication { MyDynamicResource res = new MyDynamicResource(); - VaadinServiceSession.getCurrent().addRequestHandler(res); + VaadinSession.getCurrent().addRequestHandler(res); w.addComponent(new Link( "Test (without Content-Disposition, should suggest generatedFile.png when saving, browser default for actual disposition)", @@ -52,9 +52,9 @@ class MyDynamicResource implements RequestHandler { * stream that contains the response from the server. */ @Override - public boolean handleRequest(VaadinServiceSession session, + public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { - String relativeUri = request.getRequestPathInfo(); + String relativeUri = request.getPathInfo(); // Catch the given URI that identifies the resource, otherwise let other // URI handlers or the Application to handle the response. if (!relativeUri.startsWith("myresource")) { diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1921.java b/uitest/src/com/vaadin/tests/tickets/Ticket1921.java index cde90ff3d6..79dcd3bd71 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1921.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1921.java @@ -7,7 +7,7 @@ import com.vaadin.server.LegacyApplication; import com.vaadin.server.RequestHandler; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinResponse; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; @@ -42,7 +42,7 @@ public class Ticket1921 extends LegacyApplication implements RequestHandler { newState(); - VaadinServiceSession.getCurrent().addRequestHandler(this); + VaadinSession.getCurrent().addRequestHandler(this); } public void newState() { @@ -94,7 +94,7 @@ public class Ticket1921 extends LegacyApplication implements RequestHandler { } @Override - public boolean handleRequest(VaadinServiceSession session, + public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { Map<String, String[]> parameters = request.getParameterMap(); String[] s = parameters.get("state"); diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2292.java b/uitest/src/com/vaadin/tests/tickets/Ticket2292.java index f6ec542ad2..e81ad3185a 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2292.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2292.java @@ -14,7 +14,7 @@ import com.vaadin.server.ExternalResource; import com.vaadin.server.RequestHandler; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinResponse; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.Button; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Label; @@ -44,13 +44,13 @@ public class Ticket2292 extends com.vaadin.server.LegacyApplication implements Link l = new Link("l", icon); main.addComponent(l); - VaadinServiceSession.getCurrent().addRequestHandler(this); + VaadinSession.getCurrent().addRequestHandler(this); } @Override - public boolean handleRequest(VaadinServiceSession session, + public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { - String relativeUri = request.getRequestPathInfo(); + String relativeUri = request.getPathInfo(); if (!relativeUri.contains("icon.png")) { return false; diff --git a/uitest/src/com/vaadin/tests/util/SampleDirectory.java b/uitest/src/com/vaadin/tests/util/SampleDirectory.java index 74b5dfe5e8..0eeae4ca9e 100644 --- a/uitest/src/com/vaadin/tests/util/SampleDirectory.java +++ b/uitest/src/com/vaadin/tests/util/SampleDirectory.java @@ -20,7 +20,7 @@ import java.io.File; import com.vaadin.server.SystemError; import com.vaadin.server.VaadinService; -import com.vaadin.server.VaadinServiceSession; +import com.vaadin.server.VaadinSession; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Label; import com.vaadin.ui.LegacyWindow; @@ -43,7 +43,7 @@ public class SampleDirectory { * @param application * @return file pointing to sample directory */ - public static File getDirectory(VaadinServiceSession application, + public static File getDirectory(VaadinSession application, LegacyWindow uI) { String errorMessage = "Access to application " + "context base directory failed, " diff --git a/uitest/src/com/vaadin/tests/widgetset/client/DelegateState.java b/uitest/src/com/vaadin/tests/widgetset/client/DelegateState.java index e9ac8a1e61..1af0d04bf6 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/DelegateState.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/DelegateState.java @@ -16,10 +16,10 @@ package com.vaadin.tests.widgetset.client; -import com.vaadin.shared.ComponentState; +import com.vaadin.shared.AbstractComponentState; import com.vaadin.shared.annotations.DelegateToWidget; -public class DelegateState extends ComponentState { +public class DelegateState extends AbstractComponentState { @DelegateToWidget public String value1; diff --git a/uitest/src/com/vaadin/tests/widgetset/client/LabelState.java b/uitest/src/com/vaadin/tests/widgetset/client/LabelState.java index 91a269e33f..9bc1397339 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/LabelState.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/LabelState.java @@ -16,7 +16,7 @@ package com.vaadin.tests.widgetset.client; -import com.vaadin.shared.ComponentState; +import com.vaadin.shared.AbstractComponentState; /** * State class with the same simple name as @@ -26,7 +26,7 @@ import com.vaadin.shared.ComponentState; * @version @VERSION@ * @since 7.0.0 */ -public class LabelState extends ComponentState { +public class LabelState extends AbstractComponentState { private String text; 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 b64d0f0ad5..58ec6fc892 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 @@ -16,9 +16,9 @@ package com.vaadin.tests.widgetset.client.minitutorials.v7a2; -import com.vaadin.shared.ComponentState; +import com.vaadin.shared.AbstractComponentState; import com.vaadin.shared.Connector; -public class ComponentInStateState extends ComponentState { +public class ComponentInStateState extends AbstractComponentState { public Connector otherComponent; } 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 948f98e756..a7a6b987fb 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 @@ -1,8 +1,8 @@ package com.vaadin.tests.widgetset.client.minitutorials.v7a2; -import com.vaadin.shared.ComponentState; +import com.vaadin.shared.AbstractComponentState; -public class MyComponentState extends ComponentState { +public class MyComponentState extends AbstractComponentState { public String text; 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 3db8d712c4..d0c2992003 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 @@ -20,6 +20,6 @@ import com.vaadin.shared.annotations.Delayed; import com.vaadin.shared.communication.ServerRpc; public interface CapsLockWarningRpc extends ServerRpc { - @Delayed(lastonly = true) + @Delayed(lastOnly = true) public void isCapsLockEnabled(boolean isCapsLockEnabled); } |