From: Artur Signell Date: Tue, 26 Apr 2011 14:22:12 +0000 (+0000) Subject: Add support for testing filtering mode X-Git-Tag: 6.7.0.beta1~270 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=78cdba59e9bf41cd876734a10b908e5643e97ee2;p=vaadin-framework.git Add support for testing filtering mode svn changeset:18472/svn branch:6.6 --- diff --git a/tests/src/com/vaadin/tests/components/combobox/ComboBoxes2.java b/tests/src/com/vaadin/tests/components/combobox/ComboBoxes2.java index 92e9c29595..f41176c6ca 100644 --- a/tests/src/com/vaadin/tests/components/combobox/ComboBoxes2.java +++ b/tests/src/com/vaadin/tests/components/combobox/ComboBoxes2.java @@ -3,16 +3,23 @@ package com.vaadin.tests.components.combobox; import java.util.LinkedHashMap; import com.vaadin.terminal.Resource; -import com.vaadin.tests.components.select.AbstractSelectTestCase; +import com.vaadin.tests.components.select.SelectTest; import com.vaadin.ui.ComboBox; +import com.vaadin.ui.Select; -public class ComboBoxes2 extends AbstractSelectTestCase { +public class ComboBoxes2 extends SelectTest { private Command inputPromptCommand = new Command() { public void execute(ComboBox c, String value, Object data) { c.setInputPrompt(value); } }; + private Command filteringModeCommand = new Command() { + + public void execute(ComboBox c, Integer value, Object data) { + c.setFilteringMode(value); + } + }; @Override protected Class getTestClass() { @@ -24,6 +31,18 @@ public class ComboBoxes2 extends AbstractSelectTestCase { super.createActions(); createItemIconSelect(CATEGORY_DATA_SOURCE); createInputPromptAction(CATEGORY_FEATURES); + createFilteringModeAction(CATEGORY_FEATURES); + } + + private void createFilteringModeAction(String category) { + LinkedHashMap options = new LinkedHashMap(); + options.put("Off", Select.FILTERINGMODE_OFF); + options.put("Contains", Select.FILTERINGMODE_CONTAINS); + options.put("Starts with", Select.FILTERINGMODE_STARTSWITH); + + createSelectAction("Filtering mode", category, options, "Contains", + filteringModeCommand); + } private void createInputPromptAction(String category) { diff --git a/tests/src/com/vaadin/tests/components/select/SelectTest.java b/tests/src/com/vaadin/tests/components/select/SelectTest.java index 3febdd0cec..cdc30921fa 100644 --- a/tests/src/com/vaadin/tests/components/select/SelectTest.java +++ b/tests/src/com/vaadin/tests/components/select/SelectTest.java @@ -2,11 +2,12 @@ package com.vaadin.tests.components.select; import com.vaadin.ui.Select; -public class SelectTest extends AbstractSelectTestCase getTestClass() { - return Select.class; + protected Class getTestClass() { + return (Class) Select.class; } }