]> source.dussan.org Git - vaadin-framework.git/commitdiff
Remove test for separate url handlers for different windows
authorLeif Åstrand <leif@vaadin.com>
Wed, 16 Nov 2011 10:47:01 +0000 (12:47 +0200)
committerLeif Åstrand <leif@vaadin.com>
Wed, 16 Nov 2011 10:47:01 +0000 (12:47 +0200)
tests/testbench/com/vaadin/tests/tickets/Ticket2440.java [deleted file]

diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2440.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2440.java
deleted file mode 100644 (file)
index cd1e8e6..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.vaadin.tests.tickets;
-
-import java.net.URL;
-
-import com.vaadin.Application;
-import com.vaadin.terminal.DownloadStream;
-import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.URIHandler;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Link;
-import com.vaadin.ui.Window;
-
-public class Ticket2440 extends Application {
-
-    @Override
-    public void init() {
-        final Window main = new MainWindow();
-        setMainWindow(main);
-        main.addComponent(new Label(
-                "Clicking the link should open a new window that should receive the URI 'msg/hello' and add that a a Label to it's ui. Currently the Label ends up in this (main) window (try reloading). Console intentionally spams during the window finding/uri handling - looks, uhm, interesting."));
-    }
-
-    @Override
-    public Window getWindow(String name) {
-        System.err.println("Looking for " + name);
-        if ("msg".equals(name)) {
-            System.err
-                    .println(" rest uri, returning new MainWindow with message from uri");
-            MainWindow restWindow = new MainWindow();
-            addWindow(restWindow);
-            return restWindow;
-        }
-        // If we already have the requested window, use it
-        Window w = super.getWindow(name);
-        if (w == null) {
-            // If no window found, create it
-            System.err.println(" new win");
-            w = new MainWindow();
-            w.setName(name);
-            addWindow(w);
-            return w;
-        } else {
-            System.err.println(" found win");
-            return w;
-        }
-
-    }
-
-    private class MainWindow extends Window {
-        public MainWindow() {
-            super("Main window");
-
-            addComponent(new Link("new mainwin", new ExternalResource(
-                    Ticket2440.this.getURL() + "msg/hello"), "_blank", -1, -1,
-                    Window.BORDER_DEFAULT));
-
-            addURIHandler(new URIHandler() {
-                public DownloadStream handleURI(URL context, String relativeUri) {
-                    System.err
-                            .println((getMainWindow() == getWindow() ? "mainwin: "
-                                    : "subwin: ")
-                                    + context + ", " + relativeUri);
-                    addComponent(new Label(relativeUri));
-                    return null;
-                }
-            });
-        }
-
-        @Override
-        public DownloadStream handleURI(URL context, String relativeUri) {
-            System.err.println("MainWindow.handleURI();");
-            return super.handleURI(context, relativeUri);
-        }
-
-    }
-
-}