summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-10-08 13:17:07 +0300
committerVaadin Code Review <review@vaadin.com>2012-10-08 10:43:19 +0000
commit48c19777e566dd8cd5e496ea364de8aea447abbf (patch)
treee6f5ff65c2d4d249230e92e62a52db537e6042a7 /uitest
parent13d5b3e98954c2ade382305f8d044b2b49fdbd0b (diff)
downloadvaadin-framework-48c19777e566dd8cd5e496ea364de8aea447abbf.tar.gz
vaadin-framework-48c19777e566dd8cd5e496ea364de8aea447abbf.zip
Remove VaadinServiceSession.getURL (#9884)
* Give an URL to LegacyApplication when initializing * Update LoginForm to use DynamicConnectorResource instead of RequestHandler * Make CustomUIClassLoader work again (including previous issues not caused by this change) * Update some other tests to use more sensible URLs Change-Id: I53ed5e9be3b44ed1b62f9762507b0007d53f15b7
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/TestBench.java2
-rw-r--r--uitest/src/com/vaadin/tests/components/ui/LazyInitUIs.java12
-rw-r--r--uitest/src/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java12
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",