]> source.dussan.org Git - vaadin-framework.git/commitdiff
Testcase for #5744
authorJohn Alhroos <john.ahlroos@itmill.com>
Tue, 26 Oct 2010 13:28:36 +0000 (13:28 +0000)
committerJohn Alhroos <john.ahlroos@itmill.com>
Tue, 26 Oct 2010 13:28:36 +0000 (13:28 +0000)
svn changeset:15720/svn branch:6.4

tests/src/com/vaadin/tests/components/table/TableMultiSelectSimple.html [new file with mode: 0644]
tests/src/com/vaadin/tests/components/table/TableMultiSelectSimple.java [new file with mode: 0644]

diff --git a/tests/src/com/vaadin/tests/components/table/TableMultiSelectSimple.html b/tests/src/com/vaadin/tests/components/table/TableMultiSelectSimple.html
new file mode 100644 (file)
index 0000000..acf02be
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+       <td>open</td>
+       <td>/run/com.vaadin.tests.components.table.TableMultiSelectSimple?restartApplication</td>
+       <td></td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=vaadin648runcomvaadintestscomponentstableTableMultiSelectSimple::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+       <td>28,17</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=vaadin648runcomvaadintestscomponentstableTableMultiSelectSimple::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+       <td>48,11</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=vaadin648runcomvaadintestscomponentstableTableMultiSelectSimple::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[4]/domChild[0]/domChild[0]</td>
+       <td>48,9</td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>0-2-4Selected</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=vaadin648runcomvaadintestscomponentstableTableMultiSelectSimple::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[4]/domChild[0]/domChild[0]</td>
+       <td>38,18</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=vaadin648runcomvaadintestscomponentstableTableMultiSelectSimple::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+       <td>32,13</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=vaadin648runcomvaadintestscomponentstableTableMultiSelectSimple::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+       <td>35,13</td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>NoSelection</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/src/com/vaadin/tests/components/table/TableMultiSelectSimple.java b/tests/src/com/vaadin/tests/components/table/TableMultiSelectSimple.java
new file mode 100644 (file)
index 0000000..4934895
--- /dev/null
@@ -0,0 +1,57 @@
+package com.vaadin.tests.components.table;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.AbstractSelect.MultiSelectMode;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.Table;
+
+public class TableMultiSelectSimple extends TestBase {
+    Log log = new Log(3);
+
+    @Override
+    protected void setup() {
+        log.setDebugId("eventlog");
+
+        Table t = new Table();
+
+        t.setSelectable(true);
+        t.setNullSelectionAllowed(true);
+        t.setMultiSelect(true);
+        t.setMultiSelectMode(MultiSelectMode.SIMPLE);
+        t.setImmediate(true);
+        t.addListener(new ValueChangeListener() {
+
+            public void valueChange(ValueChangeEvent event) {
+                log.log("Selected value: " + event.getProperty().getValue());
+            }
+        });
+
+        t.addContainerProperty("string", String.class, null);
+        t.addContainerProperty("button", Component.class, null);
+
+        for (int i = 0; i < 10; i++) {
+            t.addItem(i);
+            t.getContainerProperty(i, "string").setValue(i);
+            t.getContainerProperty(i, "button")
+                    .setValue(new Button("Click me"));
+        }
+
+        addComponent(log);
+        addComponent(t);
+    }
+
+    @Override
+    protected String getDescription() {
+        return "Tests that MultiSelectMode.SIMPLE is working properly";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return 5744;
+    }
+
+}