aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJohannes Dahlström <johannes.dahlstrom@vaadin.com>2011-12-22 15:35:32 +0000
committerJohannes Dahlström <johannes.dahlstrom@vaadin.com>2011-12-22 15:35:32 +0000
commit6b17598182a7fd2162adf03c21b079569c6d6195 (patch)
tree4f1cefe111da8c22d5be81262a29badad35e59e7 /tests
parentf4dd777d871553606968ee103b1cc0416401a49a (diff)
downloadvaadin-framework-6b17598182a7fd2162adf03c21b079569c6d6195.tar.gz
vaadin-framework-6b17598182a7fd2162adf03c21b079569c6d6195.zip
Improved test cases for #8170
svn changeset:22474/svn branch:6.7
Diffstat (limited to 'tests')
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java20
1 files changed, 15 insertions, 5 deletions
diff --git a/tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java b/tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java
index 593491f1e9..a6040c06d3 100644
--- a/tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java
+++ b/tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java
@@ -10,6 +10,7 @@ import com.vaadin.tests.util.Log;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
import com.vaadin.ui.Window;
@@ -30,7 +31,16 @@ public class AttachShouldBeCalledForSubWindows extends AbstractTestCase
log(this);
super.attach();
}
+
+ @Override
+ public void addWindow(Window w) {
+ log.log("Adding sub window");
+ super.addWindow(w);
+ log.log("Sub window added");
+
+ }
};
+ mainWindow.setCaption("Main window");
mainWindow.addComponent(log);
mainWindow.getContent().setSizeFull();
Label label = new Label("This is the main app") {
@@ -45,15 +55,14 @@ public class AttachShouldBeCalledForSubWindows extends AbstractTestCase
Window loginWindow = createSubWindow();
if (addSubWindowBeforeMainWindow) {
mainWindow.addWindow(loginWindow);
- log.log("Sub window added to application");
}
+ log.log("Setting main window");
setMainWindow(mainWindow); // At this point
log.log("Main window set");
if (!addSubWindowBeforeMainWindow) {
mainWindow.addWindow(loginWindow);
- log.log("Sub window added to application");
}
}
@@ -85,12 +94,13 @@ public class AttachShouldBeCalledForSubWindows extends AbstractTestCase
return w;
}
- public void log(Object o) {
- Class cls = o.getClass();
+ public void log(Component c) {
+ Class<?> cls = c.getClass();
if (cls.isAnonymousClass()) {
cls = cls.getSuperclass();
}
- log.log(cls.getName() + " attached to application");
+ log.log(cls.getName() + " '" + c.getCaption()
+ + "' attached to application");
}
@Override