diff options
Diffstat (limited to 'uitest/src/com/vaadin')
3 files changed, 8 insertions, 18 deletions
diff --git a/uitest/src/com/vaadin/tests/TestBench.java b/uitest/src/com/vaadin/tests/TestBench.java index 91e3afd993..5a76a7259c 100644 --- a/uitest/src/com/vaadin/tests/TestBench.java +++ b/uitest/src/com/vaadin/tests/TestBench.java @@ -224,7 +224,7 @@ public class TestBench extends com.vaadin.LegacyApplication implements private Component createTestable(Class<?> c) { try { final LegacyApplication app = (LegacyApplication) c.newInstance(); - app.doInit(); + app.doInit(null); Layout lo = (Layout) app.getMainWindow().getContent(); lo.setParent(null); return lo; diff --git a/uitest/src/com/vaadin/tests/components/ui/LazyInitUIs.java b/uitest/src/com/vaadin/tests/components/ui/LazyInitUIs.java index 4648529db7..e1fae91a3c 100644 --- a/uitest/src/com/vaadin/tests/components/ui/LazyInitUIs.java +++ b/uitest/src/com/vaadin/tests/components/ui/LazyInitUIs.java @@ -5,7 +5,6 @@ import com.vaadin.server.UIClassSelectionEvent; import com.vaadin.server.UICreateEvent; import com.vaadin.server.UIProviderEvent; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinServiceSession; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.tests.components.AbstractTestUIProvider; import com.vaadin.ui.Label; @@ -53,17 +52,16 @@ public class LazyInitUIs extends AbstractTestUIProvider { protected void init(VaadinRequest request) { addComponent(getRequestInfo("NormalUI", request)); + String location = getPage().getLocation().toString(); Link lazyCreateLink = new Link("Open lazyCreate UI", - new ExternalResource(VaadinServiceSession - .getCurrent().getURL() - + "?lazyCreate#lazyCreate")); + new ExternalResource(location.replaceFirst( + "(\\?|#|$).*", "?lazyCreate#lazyCreate"))); lazyCreateLink.setTargetName("_blank"); addComponent(lazyCreateLink); Link lazyInitLink = new Link("Open eagerInit UI", - new ExternalResource(VaadinServiceSession - .getCurrent().getURL() - + "?eagerInit#eagerInit")); + new ExternalResource(location.replaceFirst( + "(\\?|#|$).*", "?eagerInit#eagerInit"))); lazyInitLink.setTargetName("_blank"); addComponent(lazyInitLink); } diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java index 4c9ba80677..b5057dd9c2 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java @@ -2,8 +2,6 @@ package com.vaadin.tests.minitutorials.v7a1; import java.awt.image.BufferedImage; import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; import javax.imageio.ImageIO; @@ -23,14 +21,8 @@ public class DynamicImageUI extends AbstractTestUI { getSession().addRequestHandler(new DynamicImageRequestHandler()); // Create a URL that we can handle in DynamicImageRequestHandler - URL imageUrl; - try { - imageUrl = new URL(getSession().getURL(), - DynamicImageRequestHandler.IMAGE_URL + "?text=Hello!"); - } catch (MalformedURLException e) { - // This should never happen - throw new RuntimeException(e); - } + String imageUrl = "app://" + DynamicImageRequestHandler.IMAGE_URL + + "?text=Hello!"; // Add an embedded using the created URL Embedded embedded = new Embedded("A dynamically generated image", |