diff options
author | Artur Signell <artur.signell@itmill.com> | 2010-10-15 18:15:31 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2010-10-15 18:15:31 +0000 |
commit | ddd11d6634380f6bebf5eab0f04029f82f9121f9 (patch) | |
tree | 4d0dd9738034811e8edda1cd93bb44301ba2f5a2 | |
parent | 25eeb8bb980e679d9cdab9b469002a0489c8802c (diff) | |
download | vaadin-framework-ddd11d6634380f6bebf5eab0f04029f82f9121f9.tar.gz vaadin-framework-ddd11d6634380f6bebf5eab0f04029f82f9121f9.zip |
Test case for ListSelect
svn changeset:15578/svn branch:6.4
-rw-r--r-- | tests/src/com/vaadin/tests/components/listselect/ListSelects.java | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/tests/src/com/vaadin/tests/components/listselect/ListSelects.java b/tests/src/com/vaadin/tests/components/listselect/ListSelects.java new file mode 100644 index 0000000000..b5bb1ddaa7 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/listselect/ListSelects.java @@ -0,0 +1,65 @@ +package com.vaadin.tests.components.listselect;
+
+import java.util.LinkedHashMap;
+
+import com.vaadin.tests.components.select.AbstractSelectTestCase;
+import com.vaadin.ui.ListSelect;
+
+public class ListSelects extends AbstractSelectTestCase<ListSelect> {
+
+ @Override
+ protected Class<ListSelect> getTestClass() {
+ return ListSelect.class;
+ }
+
+ @Override
+ protected void createActions() {
+ super.createActions();
+ createColumnSelectAction();
+ createRowSelectAction();
+ }
+
+ private void createColumnSelectAction() {
+ LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();
+ options.put("-", 0);
+ for (int i = 1; i <= 10; i++) {
+ options.put(String.valueOf(i), i);
+ }
+ options.put("50", 50);
+ options.put("100", 100);
+ options.put("1000", 1000);
+
+ super.createSelectAction("Columns", CATEGORY_CONTENT, options, "-",
+ columnsAction);
+
+ }
+
+ private void createRowSelectAction() {
+ LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();
+ options.put("-", 0);
+ for (int i = 1; i <= 10; i++) {
+ options.put(String.valueOf(i), i);
+ }
+ options.put("50", 50);
+ options.put("100", 100);
+ options.put("1000", 1000);
+
+ super.createSelectAction("Rows", CATEGORY_CONTENT, options, "-",
+ rowsAction);
+
+ }
+
+ private Command<ListSelect, Integer> columnsAction = new Command<ListSelect, Integer>() {
+
+ public void execute(ListSelect c, Integer value, Object data) {
+ c.setColumns(value);
+ }
+ };
+ private Command<ListSelect, Integer> rowsAction = new Command<ListSelect, Integer>() {
+
+ public void execute(ListSelect c, Integer value, Object data) {
+ c.setRows(value);
+ }
+ };
+
+}
|