diff options
author | Artur Signell <artur.signell@itmill.com> | 2010-10-15 18:19:23 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2010-10-15 18:19:23 +0000 |
commit | 17d308f8ac8320e4642fb5a4bf5fef52007b6c5e (patch) | |
tree | 89590cba157652b4c6730141a051d5ad30e5cce4 | |
parent | ef8f55e6e0a93d22cf3780c921f1fbe4bf5e9ca8 (diff) | |
download | vaadin-framework-17d308f8ac8320e4642fb5a4bf5fef52007b6c5e.tar.gz vaadin-framework-17d308f8ac8320e4642fb5a4bf5fef52007b6c5e.zip |
Test case for TwinColSelect
svn changeset:15580/svn branch:6.4
-rw-r--r-- | tests/src/com/vaadin/tests/components/twincolselect/TwinColSelects.java | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/tests/src/com/vaadin/tests/components/twincolselect/TwinColSelects.java b/tests/src/com/vaadin/tests/components/twincolselect/TwinColSelects.java new file mode 100644 index 0000000000..896cbcc503 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/twincolselect/TwinColSelects.java @@ -0,0 +1,64 @@ +package com.vaadin.tests.components.twincolselect;
+
+import java.util.LinkedHashMap;
+
+import com.vaadin.tests.components.select.AbstractSelectTestCase;
+import com.vaadin.ui.TwinColSelect;
+
+public class TwinColSelects extends AbstractSelectTestCase<TwinColSelect> {
+
+ @Override
+ protected Class<TwinColSelect> getTestClass() {
+ return TwinColSelect.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<TwinColSelect, Integer> columnsAction = new Command<TwinColSelect, Integer>() {
+
+ public void execute(TwinColSelect c, Integer value, Object data) {
+ c.setColumns(value);
+ }
+ };
+ private Command<TwinColSelect, Integer> rowsAction = new Command<TwinColSelect, Integer>() {
+
+ public void execute(TwinColSelect c, Integer value, Object data) {
+ c.setRows(value);
+ }
+ };
+}
|