]> source.dussan.org Git - vaadin-framework.git/commitdiff
Test for #8170
authorArtur Signell <artur.signell@itmill.com>
Wed, 21 Dec 2011 16:37:45 +0000 (16:37 +0000)
committerArtur Signell <artur.signell@itmill.com>
Wed, 21 Dec 2011 16:37:45 +0000 (16:37 +0000)
svn changeset:22465/svn branch:6.7

tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java

index a6040c06d3c4dfb014bdf793c487462fea9fcacc..593491f1e9ed62258dfa0c06950014f7efb1f571 100644 (file)
@@ -10,7 +10,6 @@ import com.vaadin.tests.util.Log;
 import com.vaadin.ui.Button;\r
 import com.vaadin.ui.Button.ClickEvent;\r
 import com.vaadin.ui.Button.ClickListener;\r
-import com.vaadin.ui.Component;\r
 import com.vaadin.ui.Label;\r
 import com.vaadin.ui.Window;\r
 \r
@@ -31,16 +30,7 @@ public class AttachShouldBeCalledForSubWindows extends AbstractTestCase
                 log(this);\r
                 super.attach();\r
             }\r
-\r
-            @Override\r
-            public void addWindow(Window w) {\r
-                log.log("Adding sub window");\r
-                super.addWindow(w);\r
-                log.log("Sub window added");\r
-\r
-            }\r
         };\r
-        mainWindow.setCaption("Main window");\r
         mainWindow.addComponent(log);\r
         mainWindow.getContent().setSizeFull();\r
         Label label = new Label("This is the main app") {\r
@@ -55,14 +45,15 @@ public class AttachShouldBeCalledForSubWindows extends AbstractTestCase
         Window loginWindow = createSubWindow();\r
         if (addSubWindowBeforeMainWindow) {\r
             mainWindow.addWindow(loginWindow);\r
+            log.log("Sub window added to application");\r
         }\r
 \r
-        log.log("Setting main window");\r
         setMainWindow(mainWindow); // At this point\r
         log.log("Main window set");\r
 \r
         if (!addSubWindowBeforeMainWindow) {\r
             mainWindow.addWindow(loginWindow);\r
+            log.log("Sub window added to application");\r
         }\r
     }\r
 \r
@@ -94,13 +85,12 @@ public class AttachShouldBeCalledForSubWindows extends AbstractTestCase
         return w;\r
     }\r
 \r
-    public void log(Component c) {\r
-        Class<?> cls = c.getClass();\r
+    public void log(Object o) {\r
+        Class cls = o.getClass();\r
         if (cls.isAnonymousClass()) {\r
             cls = cls.getSuperclass();\r
         }\r
-        log.log(cls.getName() + " '" + c.getCaption()\r
-                + "' attached to application");\r
+        log.log(cls.getName() + " attached to application");\r
     }\r
 \r
     @Override\r