]> source.dussan.org Git - vaadin-framework.git/commitdiff
added test case
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 6 Nov 2009 11:09:09 +0000 (11:09 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 6 Nov 2009 11:09:09 +0000 (11:09 +0000)
svn changeset:9662/svn branch:6.2

tests/src/com/vaadin/tests/components/window/LongNotifications.java [new file with mode: 0644]

diff --git a/tests/src/com/vaadin/tests/components/window/LongNotifications.java b/tests/src/com/vaadin/tests/components/window/LongNotifications.java
new file mode 100644 (file)
index 0000000..c70c14e
--- /dev/null
@@ -0,0 +1,79 @@
+package com.vaadin.tests.components.window;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Window.Notification;
+
+public class LongNotifications extends TestBase {
+    private final String text = "This is a veeeery large notification in the main window which should definitly not exist at all, in any app. But they finally do in real world applications, no matter what you do. People have small screens and desperatly try to run web apps in their iphones.";
+
+    @Override
+    protected String getDescription() {
+        return "Notifications should not be wider than the screen.";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return 2632;
+    }
+
+    @Override
+    protected void setup() {
+        setTheme("tests-tickets");
+
+        Button b = new Button("Show loooong notification",
+                new Button.ClickListener() {
+
+                    public void buttonClick(ClickEvent event) {
+
+                        getMainWindow().showNotification(
+                                text,
+                                "This is description for the same notifications."
+                                        + text,
+                                Notification.TYPE_HUMANIZED_MESSAGE);
+                    }
+                });
+        getLayout().addComponent(b);
+
+        b = new Button("Show notifications", new Button.ClickListener() {
+
+            public void buttonClick(ClickEvent event) {
+
+                getMainWindow().showNotification("Example failed",
+                        "This is description for the same notifications.",
+                        Notification.TYPE_HUMANIZED_MESSAGE);
+            }
+        });
+
+        getLayout().addComponent(b);
+
+        b = new Button("Show loooong notification  (error)",
+                new Button.ClickListener() {
+
+                    public void buttonClick(ClickEvent event) {
+
+                        getMainWindow()
+                                .showNotification(
+                                        text,
+                                        "This is description for the same notifications."
+                                                + text,
+                                        Notification.TYPE_ERROR_MESSAGE);
+                    }
+                });
+        getLayout().addComponent(b);
+
+        b = new Button("Show notification (error)", new Button.ClickListener() {
+
+            public void buttonClick(ClickEvent event) {
+
+                getMainWindow().showNotification("Example failed",
+                        "This is description for the same notifications.",
+                        Notification.TYPE_ERROR_MESSAGE);
+            }
+        });
+
+        getLayout().addComponent(b);
+
+    }
+}