diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-09-05 19:04:20 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-09-05 19:04:20 +0300 |
commit | d1c361e251800c6f7d596ddf79ed1c7569196856 (patch) | |
tree | 858d5965870a4810e5db37d8522aaa8064a78825 /uitest/src | |
parent | 5ab35cc6080653a7e9b25712f637db6c95c183ce (diff) | |
download | vaadin-framework-d1c361e251800c6f7d596ddf79ed1c7569196856.tar.gz vaadin-framework-d1c361e251800c6f7d596ddf79ed1c7569196856.zip |
Rename Application to VaadinSession (#9402)
Diffstat (limited to 'uitest/src')
21 files changed, 59 insertions, 59 deletions
diff --git a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java index 34c1cc1fce..4f37a9b505 100644 --- a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java +++ b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java @@ -29,13 +29,13 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import com.vaadin.Application; import com.vaadin.LegacyApplication; import com.vaadin.server.AbstractUIProvider; import com.vaadin.server.ApplicationConfiguration; import com.vaadin.server.LegacyVaadinServlet; -import com.vaadin.server.ServletApplicationContext; +import com.vaadin.server.VaadinServletSession; import com.vaadin.server.UIProvider; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WrappedHttpServletRequest; import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.TestBase; @@ -113,17 +113,17 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet { } @Override - protected ServletApplicationContext createApplication( + protected VaadinServletSession createApplication( HttpServletRequest request) throws ServletException { try { final Class<?> classToRun = getClassToRun(); if (UI.class.isAssignableFrom(classToRun)) { - ServletApplicationContext application = new ServletApplicationContext(); + VaadinServletSession application = new VaadinServletSession(); application.addUIProvider(new AbstractUIProvider() { @Override public Class<? extends UI> getUIClass( - Application application, WrappedRequest request) { + VaadinSession application, WrappedRequest request) { return (Class<? extends UI>) classToRun; } }); @@ -131,7 +131,7 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet { } else if (LegacyApplication.class.isAssignableFrom(classToRun)) { return super.createApplication(request); } else if (UIProvider.class.isAssignableFrom(classToRun)) { - ServletApplicationContext application = new ServletApplicationContext(); + VaadinServletSession application = new VaadinServletSession(); application .addUIProvider((UIProvider) classToRun.newInstance()); return application; diff --git a/uitest/src/com/vaadin/tests/ModalWindow.java b/uitest/src/com/vaadin/tests/ModalWindow.java index 558989e069..7c9e60c943 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.Application + * @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 901b0a6dd7..01270456c8 100644 --- a/uitest/src/com/vaadin/tests/Parameters.java +++ b/uitest/src/com/vaadin/tests/Parameters.java @@ -21,10 +21,10 @@ import java.net.URL; import java.util.Iterator; import java.util.Map; -import com.vaadin.Application; import com.vaadin.LegacyApplication; import com.vaadin.server.ExternalResource; import com.vaadin.server.RequestHandler; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WrappedRequest; import com.vaadin.server.WrappedResponse; import com.vaadin.ui.Label; @@ -57,7 +57,7 @@ public class Parameters extends com.vaadin.LegacyApplication setMainWindow(main); // This class acts both as URI handler and parameter handler - Application.getCurrent().addRequestHandler(this); + VaadinSession.getCurrent().addRequestHandler(this); final VerticalLayout layout = new VerticalLayout(); final Label info = new Label("To test URI and Parameter Handlers, " @@ -107,7 +107,7 @@ public class Parameters extends com.vaadin.LegacyApplication } @Override - public boolean handleRequest(Application application, + public boolean handleRequest(VaadinSession application, WrappedRequest request, WrappedResponse response) throws IOException { context.setValue("Context not available"); diff --git a/uitest/src/com/vaadin/tests/TestBench.java b/uitest/src/com/vaadin/tests/TestBench.java index d5b603db39..098ce4af29 100644 --- a/uitest/src/com/vaadin/tests/TestBench.java +++ b/uitest/src/com/vaadin/tests/TestBench.java @@ -312,7 +312,7 @@ public class TestBench extends com.vaadin.LegacyApplication final Class<?> c = Class.forName(p); if (c.getSuperclass() != null) { if ((c.getSuperclass() - .equals(com.vaadin.Application.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 096952c74c..3d1705381e 100644 --- a/uitest/src/com/vaadin/tests/TreeFilesystem.java +++ b/uitest/src/com/vaadin/tests/TreeFilesystem.java @@ -18,9 +18,9 @@ package com.vaadin.tests; import java.io.File; -import com.vaadin.Application; import com.vaadin.LegacyApplication; import com.vaadin.data.Item; +import com.vaadin.server.VaadinSession; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.tests.util.SampleDirectory; import com.vaadin.ui.Label; @@ -64,7 +64,7 @@ public class TreeFilesystem extends com.vaadin.LegacyApplication // Get sample directory final File sampleDir = SampleDirectory.getDirectory( - Application.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 baf73b4383..b61a7a53a5 100644 --- a/uitest/src/com/vaadin/tests/TreeFilesystemContainer.java +++ b/uitest/src/com/vaadin/tests/TreeFilesystemContainer.java @@ -18,10 +18,10 @@ package com.vaadin.tests; import java.io.File; -import com.vaadin.Application; import com.vaadin.LegacyApplication; import com.vaadin.data.util.FilesystemContainer; import com.vaadin.data.util.FilesystemContainer.FileItem; +import com.vaadin.server.VaadinSession; import com.vaadin.tests.util.SampleDirectory; import com.vaadin.ui.Component.Event; import com.vaadin.ui.Component.Listener; @@ -80,7 +80,7 @@ public class TreeFilesystemContainer extends // Get sample directory final File sampleDir = SampleDirectory.getDirectory( - Application.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/ThreadLocalInstances.java b/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java index 1eda9e54fe..3adb284f1b 100644 --- a/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java +++ b/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java @@ -1,8 +1,8 @@ package com.vaadin.tests.application; -import com.vaadin.Application; import com.vaadin.server.DownloadStream; import com.vaadin.server.PaintException; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.tests.integration.FlagSeResource; @@ -14,7 +14,7 @@ import com.vaadin.ui.UI; import com.vaadin.ui.UI.LegacyWindow; public class ThreadLocalInstances extends AbstractTestCase { - private static final Application staticInitApplication = Application + private static final VaadinSession staticInitApplication = VaadinSession .getCurrent(); private static final UI staticInitRoot = UI.getCurrent(); @@ -87,10 +87,10 @@ public class ThreadLocalInstances extends AbstractTestCase { } private void reportCurrentStatus(String phase) { - reportStatus(phase, Application.getCurrent(), UI.getCurrent()); + reportStatus(phase, VaadinSession.getCurrent(), UI.getCurrent()); } - private void reportStatus(String phase, Application application, UI uI) { + 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/applicationcontext/ChangeSessionId.java b/uitest/src/com/vaadin/tests/applicationcontext/ChangeSessionId.java index 96ebe1345f..72e0a215a7 100644 --- a/uitest/src/com/vaadin/tests/applicationcontext/ChangeSessionId.java +++ b/uitest/src/com/vaadin/tests/applicationcontext/ChangeSessionId.java @@ -1,6 +1,6 @@ package com.vaadin.tests.applicationcontext; -import com.vaadin.server.ServletApplicationContext; +import com.vaadin.server.VaadinServletSession; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.tests.util.Log; import com.vaadin.ui.Button; @@ -32,7 +32,7 @@ public class ChangeSessionId extends AbstractTestCase { loginButton.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { - ServletApplicationContext context = ((ServletApplicationContext) getContext()); + VaadinServletSession context = ((VaadinServletSession) getContext()); String oldSessionId = context.getHttpSession().getId(); context.reinitializeSession(); @@ -55,7 +55,7 @@ public class ChangeSessionId extends AbstractTestCase { } protected String getSessionId() { - return ((ServletApplicationContext) getContext()).getHttpSession().getId(); + return ((VaadinServletSession) getContext()).getHttpSession().getId(); } @Override diff --git a/uitest/src/com/vaadin/tests/components/AbstractTestCase.java b/uitest/src/com/vaadin/tests/components/AbstractTestCase.java index 5dc5fd7128..356b130433 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.Application; import com.vaadin.LegacyApplication; +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 = Application.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 4311cd6a0f..db388405a8 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.Application; import com.vaadin.server.AbstractUIProvider; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WebBrowser; public abstract class AbstractTestUIProvider extends AbstractUIProvider { @@ -10,7 +10,7 @@ public abstract class AbstractTestUIProvider extends AbstractUIProvider { protected abstract Integer getTicketNumber(); protected WebBrowser getBrowser() { - WebBrowser webBrowser = Application.getCurrent().getBrowser(); + WebBrowser webBrowser = VaadinSession.getCurrent().getBrowser(); return webBrowser; } } diff --git a/uitest/src/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java b/uitest/src/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java index 327ed0f86b..2eef498aff 100644 --- a/uitest/src/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java +++ b/uitest/src/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java @@ -4,11 +4,11 @@ import java.util.HashSet; import java.util.Locale; import java.util.Set; -import com.vaadin.Application; 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.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) { - Application.getCurrent().setLocale(locale); + VaadinSession.getCurrent().setLocale(locale); for (Component c : fields) { removeComponent(c); } diff --git a/uitest/src/com/vaadin/tests/components/ui/LazyInitUIs.java b/uitest/src/com/vaadin/tests/components/ui/LazyInitUIs.java index b141dc0990..a3ca2420f7 100644 --- a/uitest/src/com/vaadin/tests/components/ui/LazyInitUIs.java +++ b/uitest/src/com/vaadin/tests/components/ui/LazyInitUIs.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.ui; -import com.vaadin.Application; import com.vaadin.server.ExternalResource; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WrappedRequest; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.tests.components.AbstractTestUIProvider; @@ -20,13 +20,13 @@ public class LazyInitUIs extends AbstractTestUIProvider { } @Override - public UI createInstance(Application application, Class<? extends UI> type, + public UI createInstance(VaadinSession application, Class<? extends UI> type, WrappedRequest request) { return getUI(request); } @Override - public Class<? extends UI> getUIClass(Application application, + public Class<? extends UI> getUIClass(VaadinSession application, WrappedRequest request) { return getUI(request).getClass(); } @@ -52,13 +52,13 @@ public class LazyInitUIs extends AbstractTestUIProvider { addComponent(getRequestInfo("NormalUI", request)); Link lazyCreateLink = new Link("Open lazyCreate UI", - new ExternalResource(Application.getCurrent() + new ExternalResource(VaadinSession.getCurrent() .getURL() + "?lazyCreate#lazyCreate")); lazyCreateLink.setTargetName("_blank"); addComponent(lazyCreateLink); Link lazyInitLink = new Link("Open eagerInit UI", - new ExternalResource(Application.getCurrent() + new ExternalResource(VaadinSession.getCurrent() .getURL() + "?eagerInit#eagerInit")); lazyInitLink.setTargetName("_blank"); addComponent(lazyInitLink); diff --git a/uitest/src/com/vaadin/tests/components/ui/UIsInMultipleTabs.java b/uitest/src/com/vaadin/tests/components/ui/UIsInMultipleTabs.java index 9a66e9ad0a..19c85a729d 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UIsInMultipleTabs.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIsInMultipleTabs.java @@ -3,7 +3,7 @@ package com.vaadin.tests.components.ui; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; -import com.vaadin.Application; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUIProvider; import com.vaadin.ui.Label; @@ -11,12 +11,12 @@ import com.vaadin.ui.UI; public class UIsInMultipleTabs extends AbstractTestUIProvider { // No cleanup -> will leak, but shouldn't matter for tests - private static ConcurrentHashMap<Application, AtomicInteger> numberOfUIsOpened = new ConcurrentHashMap<Application, AtomicInteger>(); + private static ConcurrentHashMap<VaadinSession, AtomicInteger> numberOfUIsOpened = new ConcurrentHashMap<VaadinSession, AtomicInteger>(); public static class TabUI extends UI { @Override protected void init(WrappedRequest request) { - Application application = Application.getCurrent(); + VaadinSession application = VaadinSession.getCurrent(); AtomicInteger count = numberOfUIsOpened.get(application); if (count == null) { numberOfUIsOpened.putIfAbsent(application, new AtomicInteger()); @@ -32,7 +32,7 @@ public class UIsInMultipleTabs extends AbstractTestUIProvider { } @Override - public Class<? extends UI> getUIClass(Application application, + public Class<? extends UI> getUIClass(VaadinSession application, WrappedRequest request) { return TabUI.class; } diff --git a/uitest/src/com/vaadin/tests/integration/JSR286PortletApplication.java b/uitest/src/com/vaadin/tests/integration/JSR286PortletApplication.java index a296d912bc..f3c7f009c8 100644 --- a/uitest/src/com/vaadin/tests/integration/JSR286PortletApplication.java +++ b/uitest/src/com/vaadin/tests/integration/JSR286PortletApplication.java @@ -21,8 +21,8 @@ import javax.portlet.WindowState; import com.vaadin.LegacyApplication; import com.vaadin.annotations.StyleSheet; import com.vaadin.server.ExternalResource; -import com.vaadin.server.PortletApplicationContext2; -import com.vaadin.server.PortletApplicationContext2.PortletListener; +import com.vaadin.server.VaadinPortletSession; +import com.vaadin.server.VaadinPortletSession.PortletListener; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Embedded; import com.vaadin.ui.Label; @@ -87,8 +87,8 @@ public class JSR286PortletApplication extends LegacyApplication { }); main.addComponent(upload); - if (getContext() instanceof PortletApplicationContext2) { - PortletApplicationContext2 ctx = (PortletApplicationContext2) getContext(); + if (getContext() instanceof VaadinPortletSession) { + VaadinPortletSession ctx = (VaadinPortletSession) getContext(); ctx.addPortletListener(new DemoPortletListener()); } else { getMainWindow().showNotification("Not inited via Portal!", diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java index 05da2506e8..f9309d87b2 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java @@ -16,8 +16,8 @@ package com.vaadin.tests.minitutorials.v7a1; -import com.vaadin.Application; import com.vaadin.server.AbstractUIProvider; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WebBrowser; import com.vaadin.server.WrappedRequest; import com.vaadin.ui.Label; @@ -34,7 +34,7 @@ import com.vaadin.ui.UI; public class DifferentFeaturesForDifferentClients extends AbstractUIProvider { @Override - public Class<? extends UI> getUIClass(Application application, + public Class<? extends UI> getUIClass(VaadinSession application, WrappedRequest request) { // could also use browser version etc. if (request.getHeader("user-agent").contains("mobile")) { @@ -47,7 +47,7 @@ public class DifferentFeaturesForDifferentClients extends AbstractUIProvider { // Must override as default implementation isn't allowed to // instantiate our non-public classes @Override - public UI createInstance(Application application, Class<? extends UI> type, + public UI createInstance(VaadinSession application, Class<? extends UI> type, WrappedRequest request) { try { return type.newInstance(); diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java index 4fd9c1187b..d78cdd9ad5 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java @@ -7,9 +7,9 @@ import java.net.URL; import javax.imageio.ImageIO; -import com.vaadin.Application; import com.vaadin.server.ExternalResource; import com.vaadin.server.RequestHandler; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WrappedRequest; import com.vaadin.server.WrappedResponse; import com.vaadin.tests.components.AbstractTestUI; @@ -56,7 +56,7 @@ class DynamicImageRequestHandler implements RequestHandler { public static final String IMAGE_URL = "myimage.png"; @Override - public boolean handleRequest(Application application, + public boolean handleRequest(VaadinSession application, WrappedRequest request, WrappedResponse response) throws IOException { String pathInfo = request.getRequestPathInfo(); diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java index e0f53935c7..147ea2a919 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java @@ -16,7 +16,7 @@ package com.vaadin.tests.minitutorials.v7a1; -import com.vaadin.Application; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WrappedRequest; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; @@ -41,7 +41,7 @@ public class FindCurrentUI extends UI { @Override public void buttonClick(ClickEvent event) { String msg = "Running in "; - msg += Application.getCurrent().isProductionMode() ? "production" + msg += VaadinSession.getCurrent().isProductionMode() ? "production" : "debug"; Notification.show(msg); } diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1589.java b/uitest/src/com/vaadin/tests/tickets/Ticket1589.java index 580aa3f7a6..4e90ae0e9e 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1589.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1589.java @@ -10,11 +10,11 @@ import java.util.Date; import javax.imageio.ImageIO; -import com.vaadin.Application; import com.vaadin.LegacyApplication; import com.vaadin.server.DownloadStream; import com.vaadin.server.ExternalResource; import com.vaadin.server.RequestHandler; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WrappedRequest; import com.vaadin.server.WrappedResponse; import com.vaadin.ui.Link; @@ -29,7 +29,7 @@ public class Ticket1589 extends LegacyApplication { MyDynamicResource res = new MyDynamicResource(); - Application.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,7 +52,7 @@ class MyDynamicResource implements RequestHandler { * stream that contains the response from the server. */ @Override - public boolean handleRequest(Application application, + public boolean handleRequest(VaadinSession application, WrappedRequest request, WrappedResponse response) throws IOException { String relativeUri = request.getRequestPathInfo(); diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1921.java b/uitest/src/com/vaadin/tests/tickets/Ticket1921.java index 165f4a8d0d..6f525a1bfc 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1921.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1921.java @@ -3,9 +3,9 @@ package com.vaadin.tests.tickets; import java.io.IOException; import java.util.Map; -import com.vaadin.Application; import com.vaadin.LegacyApplication; import com.vaadin.server.RequestHandler; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WrappedRequest; import com.vaadin.server.WrappedResponse; import com.vaadin.ui.Button; @@ -43,7 +43,7 @@ public class Ticket1921 extends LegacyApplication implements newState(); - Application.getCurrent().addRequestHandler(this); + VaadinSession.getCurrent().addRequestHandler(this); } public void newState() { @@ -95,7 +95,7 @@ public class Ticket1921 extends LegacyApplication implements } @Override - public boolean handleRequest(Application application, + public boolean handleRequest(VaadinSession application, WrappedRequest request, WrappedResponse response) throws IOException { Map<String, String[]> parameters = request.getParameterMap(); diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2292.java b/uitest/src/com/vaadin/tests/tickets/Ticket2292.java index 34f24276e5..0f663d78f5 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2292.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2292.java @@ -9,11 +9,11 @@ import java.io.IOException; import javax.imageio.ImageIO; -import com.vaadin.Application; import com.vaadin.LegacyApplication; import com.vaadin.server.DownloadStream; import com.vaadin.server.ExternalResource; import com.vaadin.server.RequestHandler; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WrappedRequest; import com.vaadin.server.WrappedResponse; import com.vaadin.ui.Button; @@ -45,11 +45,11 @@ public class Ticket2292 extends com.vaadin.LegacyApplication Link l = new Link("l", icon); main.addComponent(l); - Application.getCurrent().addRequestHandler(this); + VaadinSession.getCurrent().addRequestHandler(this); } @Override - public boolean handleRequest(Application application, + public boolean handleRequest(VaadinSession application, WrappedRequest request, WrappedResponse response) throws IOException { String relativeUri = request.getRequestPathInfo(); diff --git a/uitest/src/com/vaadin/tests/util/SampleDirectory.java b/uitest/src/com/vaadin/tests/util/SampleDirectory.java index 7304f1cab8..be98de67cc 100644 --- a/uitest/src/com/vaadin/tests/util/SampleDirectory.java +++ b/uitest/src/com/vaadin/tests/util/SampleDirectory.java @@ -18,8 +18,8 @@ package com.vaadin.tests.util; import java.io.File; -import com.vaadin.Application; import com.vaadin.server.SystemError; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WrappedRequest; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Label; @@ -43,7 +43,7 @@ public class SampleDirectory { * @param application * @return file pointing to sample directory */ - public static File getDirectory(Application application, UI uI) { + public static File getDirectory(VaadinSession application, UI uI) { String errorMessage = "Access to application " + "context base directory failed, " + "possible security constraint with Application " |