From 90d1e732a81a886a0d880eab0a13e49137763bec Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 18 Oct 2010 05:44:13 +0000 Subject: [PATCH] Merged test updates from 6.4 svn changeset:15590/svn branch:6.5 --- .../components/AbstractComponentTestCase.java | 92 ++++- .../MenuBasedComponentTestCase.java | 308 +++++++++------ .../abstractfield/AbstractFieldTestCase.java | 124 ++++++ .../tests/components/button/Buttons2.java | 56 +++ .../components/checkbox/CheckBoxes2.java | 57 +++ .../components/combobox/ComboBoxes2.java | 45 +++ .../datefield/DateFieldTestCase.java | 108 ++++++ .../datefield/InlineDateFields2.java | 12 + .../datefield/PopupDateFields2.java | 38 ++ .../components/listselect/ListSelects.java | 65 ++++ .../components/optiongroup/OptionGroups.java | 37 ++ .../select/AbstractSelectTestCase.java | 168 +++++++++ .../vaadin/tests/components/table/Tables.java | 53 +-- .../vaadin/tests/components/tree/Trees.java | 353 ++++++++++++++++++ .../twincolselect/TwinColSelects.java | 64 ++++ 15 files changed, 1419 insertions(+), 161 deletions(-) create mode 100644 tests/src/com/vaadin/tests/components/abstractfield/AbstractFieldTestCase.java create mode 100644 tests/src/com/vaadin/tests/components/button/Buttons2.java create mode 100644 tests/src/com/vaadin/tests/components/checkbox/CheckBoxes2.java create mode 100644 tests/src/com/vaadin/tests/components/combobox/ComboBoxes2.java create mode 100644 tests/src/com/vaadin/tests/components/datefield/DateFieldTestCase.java create mode 100644 tests/src/com/vaadin/tests/components/datefield/InlineDateFields2.java create mode 100644 tests/src/com/vaadin/tests/components/datefield/PopupDateFields2.java create mode 100644 tests/src/com/vaadin/tests/components/listselect/ListSelects.java create mode 100644 tests/src/com/vaadin/tests/components/optiongroup/OptionGroups.java create mode 100644 tests/src/com/vaadin/tests/components/select/AbstractSelectTestCase.java create mode 100644 tests/src/com/vaadin/tests/components/tree/Trees.java create mode 100644 tests/src/com/vaadin/tests/components/twincolselect/TwinColSelects.java diff --git a/tests/src/com/vaadin/tests/components/AbstractComponentTestCase.java b/tests/src/com/vaadin/tests/components/AbstractComponentTestCase.java index fdd3a3fce7..aa7da25e7e 100644 --- a/tests/src/com/vaadin/tests/components/AbstractComponentTestCase.java +++ b/tests/src/com/vaadin/tests/components/AbstractComponentTestCase.java @@ -1,8 +1,12 @@ package com.vaadin.tests.components; import java.util.ArrayList; +import java.util.Date; import java.util.List; +import java.util.Locale; +import com.vaadin.terminal.Resource; +import com.vaadin.terminal.ThemeResource; import com.vaadin.terminal.UserError; import com.vaadin.tests.util.Log; import com.vaadin.ui.AbstractComponent; @@ -12,10 +16,27 @@ import com.vaadin.ui.Layout.SpacingHandler; public abstract class AbstractComponentTestCase extends TestBase { + protected static final ThemeResource ICON_16_USER_PNG_CACHEABLE = cacheableThemeResource("../runo/icons/16/user.png"); + protected static final ThemeResource ICON_16_USER_PNG_UNCACHEABLE = uncacheableThemeResource("../runo/icons/16/user.png"); + protected static final ThemeResource ICON_32_ATTENTION_PNG_CACHEABLE = cacheableThemeResource("../runo/icons/32/attention.png"); + protected static final ThemeResource ICON_32_ATTENTION_PNG_UNCACHEABLE = uncacheableThemeResource("../runo/icons/32/attention.png"); + protected static final ThemeResource ICON_64_EMAIL_REPLY_PNG_CACHEABLE = cacheableThemeResource("../runo/icons/64/email-reply.png"); + protected static final ThemeResource ICON_64_EMAIL_REPLY_PNG_UNCACHEABLE = uncacheableThemeResource("../runo/icons/64/email-reply.png"); + private List testComponents = new ArrayList(); abstract protected Class getTestClass(); + protected static ThemeResource uncacheableThemeResource( + String resourceLocation) { + return new ThemeResource(resourceLocation + "?" + new Date().getTime()); + } + + protected static ThemeResource cacheableThemeResource( + String resourceLocation) { + return new ThemeResource(resourceLocation); + } + abstract protected void initializeComponents(); private Log log = null; @@ -75,6 +96,32 @@ public abstract class AbstractComponentTestCase } }; + protected Command errorIndicatorCommand = new Command() { + + public void execute(T c, Boolean enabled, Object data) { + if (enabled) { + c.setComponentError(new UserError(errorMessage)); + } else { + c.setComponentError(null); + + } + } + }; + private String errorMessage = null; + + protected Command errorMessageCommand = new Command() { + + public void execute(T c, String value, Object data) { + errorMessage = value; + if (c.getComponentError() != null) { + errorIndicatorCommand.execute(c, true, null); + } + + } + + }; + + // TODO Move to AbstractFieldTestCase protected Command requiredCommand = new Command() { public void execute(T c, Boolean enabled, Object data) { @@ -86,16 +133,17 @@ public abstract class AbstractComponentTestCase } } }; + protected Command requiredErrorMessageCommand = new Command() { - protected Command errorIndicatorCommand = new Command() { + public void execute(T c, String value, Object data) { + ((Field) c).setRequiredError(value); + } - public void execute(T c, Boolean enabled, Object data) { - if (enabled) { - c.setComponentError(new UserError("It failed!")); - } else { - c.setComponentError(null); + }; - } + protected Command descriptionCommand = new Command() { + public void execute(T c, String value, Object data) { + c.setDescription(value); } }; @@ -106,6 +154,36 @@ public abstract class AbstractComponentTestCase } }; + protected Command visibleCommand = new Command() { + + public void execute(T c, Boolean enabled, Object data) { + c.setVisible(enabled); + } + }; + + protected Command iconCommand = new Command() { + + public void execute(T c, Resource value, Object data) { + c.setIcon(value); + } + + }; + protected Command captionCommand = new Command() { + + public void execute(T c, String value, Object data) { + c.setCaption(value); + } + + }; + + protected Command localeCommand = new Command() { + + public void execute(T c, Locale value, Object data) { + c.setLocale(value); + } + + }; + protected void doCommand(Command command, VALUET value) { doCommand(command, value, null); } diff --git a/tests/src/com/vaadin/tests/components/MenuBasedComponentTestCase.java b/tests/src/com/vaadin/tests/components/MenuBasedComponentTestCase.java index 88129ecedc..d3675b0b3f 100644 --- a/tests/src/com/vaadin/tests/components/MenuBasedComponentTestCase.java +++ b/tests/src/com/vaadin/tests/components/MenuBasedComponentTestCase.java @@ -1,24 +1,31 @@ package com.vaadin.tests.components; +import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; +import java.util.Locale; +import java.util.Map; import java.util.Set; -import com.vaadin.data.Container; -import com.vaadin.data.Item; -import com.vaadin.data.util.IndexedContainer; import com.vaadin.terminal.Resource; import com.vaadin.terminal.ThemeResource; +import com.vaadin.tests.util.LoremIpsum; import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.AbstractSelect; -import com.vaadin.ui.Field; import com.vaadin.ui.MenuBar; import com.vaadin.ui.MenuBar.MenuItem; +//TODO swap the inheritance order so AbstractComponentTestCase refers to AbstractComponent and this is the base class. Can only be done when all old tests are converted to use this. public abstract class MenuBasedComponentTestCase extends AbstractComponentTestCase { + protected static final String TEXT_SHORT = "Short"; + protected static final String TEXT_MEDIUM = "This is a semi-long text that might wrap."; + protected static final String TEXT_LONG = "This is a long text. " + + LoremIpsum.get(500); + protected static final String TEXT_VERY_LONG = "This is a very, very long text. " + + LoremIpsum.get(5000); + private static final Resource SELECTED_ICON = new ThemeResource( "../runo/icons/16/ok.png"); @@ -31,18 +38,29 @@ public abstract class MenuBasedComponentTestCase // Used to determine if a menuItem should be selected and the other // unselected on click private Set parentOfSelectableMenuItem = new HashSet(); + private MenuItem windowMenu; + + /** + * Maps the category name to a menu item + */ + private Map categoryToMenuItem = new HashMap(); protected static final String CATEGORY_STATE = "State"; protected static final String CATEGORY_SIZE = "Size"; protected static final String CATEGORY_SELECTION = "Selection"; - protected static final String CATEGORY_CONTENT = "Contents"; protected static final String CATEGORY_LISTENERS = "Listeners"; + protected static final String CATEGORY_FEATURES = "Features"; + protected static final String CATEGORY_DECORATIONS = "Decorations"; @Override protected final void setup() { + setTheme("tests-components"); + // Create menu here so it appears before the components menu = new MenuBar(); - mainMenu = menu.addItem("Settings", null); + menu.setDebugId("menu"); + mainMenu = menu.addItem("Component", null); + windowMenu = menu.addItem("Test", null); addComponent(menu); getLayout().setSizeFull(); @@ -50,7 +68,7 @@ public abstract class MenuBasedComponentTestCase super.setup(); // Create menu actions and trigger default actions - populateMenu(); + createActions(); // Clear initialization log messages clearLog(); @@ -63,6 +81,7 @@ public abstract class MenuBasedComponentTestCase @Override protected void initializeComponents() { component = constructComponent(); + component.setDebugId("testComponent"); addTestComponent(component); } @@ -94,96 +113,68 @@ public abstract class MenuBasedComponentTestCase } } - private void populateMenu() { - createDefaultActions(); - createCustomActions(); - } - - private void createDefaultActions() { + /** + * Create actions for the component. Remember to call super.createActions() + * when overriding. + */ + protected void createActions() { createBooleanAction("Immediate", CATEGORY_STATE, true, immediateCommand); createBooleanAction("Enabled", CATEGORY_STATE, true, enabledCommand); createBooleanAction("Readonly", CATEGORY_STATE, false, readonlyCommand); + createBooleanAction("Visible", CATEGORY_STATE, true, visibleCommand); createBooleanAction("Error indicator", CATEGORY_STATE, false, errorIndicatorCommand); + createLocaleSelect(CATEGORY_STATE); + createErrorMessageSelect(CATEGORY_DECORATIONS); + + createDescriptionSelect(CATEGORY_DECORATIONS); + createCaptionSelect(CATEGORY_DECORATIONS); + createIconSelect(CATEGORY_DECORATIONS); - if (component instanceof Field) { - createBooleanAction("Required", CATEGORY_STATE, false, - requiredCommand); - } createWidthSelect(CATEGORY_SIZE); createHeightSelect(CATEGORY_SIZE); - if (component instanceof AbstractSelect) { - createNullSelectAllowedCheckbox(CATEGORY_SELECTION); - createItemsInContainerSelect(CATEGORY_CONTENT); - createColumnsInContainerSelect(CATEGORY_CONTENT); - } - } + // TODO Style name - @SuppressWarnings("unchecked") - protected void createItemsInContainerSelect(String category) { - LinkedHashMap options = new LinkedHashMap(); - options.put("0", 0); - options.put("20", 20); - options.put("100", 100); - options.put("1000", 1000); - options.put("10000", 10000); - options.put("100000", 100000); - - createSelectAction("Items in container", category, options, "20", - (Command) itemsInContainerCommand); } - @SuppressWarnings("unchecked") - protected void createColumnsInContainerSelect(String category) { - LinkedHashMap options = new LinkedHashMap(); - options.put("0", 0); - options.put("5", 5); - options.put("10", 10); - options.put("50", 50); - options.put("100", 100); - options.put("1000", 1000); - - createSelectAction("Columns in container", category, options, "10", - (Command) columnsInContainerCommand); - } - - private Container createContainer(int properties, int items) { - IndexedContainer c = new IndexedContainer(); - for (int i = 1; i <= properties; i++) { - c.addContainerProperty("Column " + i, String.class, ""); - } - for (int i = 1; i <= items; i++) { - Item item = c.addItem("Item " + i); - for (int j = 1; j <= properties; j++) { - item.getItemProperty("Column " + j).setValue( - "Item " + i + "," + j); - } - } + private void createErrorMessageSelect(String category) { + LinkedHashMap options = new LinkedHashMap(); + options.put("-", null); + options.put(TEXT_SHORT, TEXT_SHORT); + options.put("Medium", TEXT_MEDIUM); + options.put("Long", TEXT_LONG); + options.put("Very long", TEXT_VERY_LONG); + createSelectAction("Error message", category, options, "-", + errorMessageCommand); - return c; } - @SuppressWarnings("unchecked") - protected void createNullSelectAllowedCheckbox(String category) { - createBooleanAction("Null Selection Allowed", category, false, - (Command) nullSelectionAllowedCommand); + private void createDescriptionSelect(String category) { + LinkedHashMap options = new LinkedHashMap(); + options.put("-", null); + options.put(TEXT_SHORT, TEXT_SHORT); + options.put("Medium", TEXT_MEDIUM); + options.put("Long", TEXT_LONG); + options.put("Very long", TEXT_VERY_LONG); + createSelectAction("Description / tooltip", category, options, "-", + descriptionCommand); } - @SuppressWarnings("unchecked") - protected void createNullSelectItemId(String category) { - LinkedHashMap options = new LinkedHashMap(); - options.put("- None -", null); - for (Object id : ((AbstractSelect) component).getContainerDataSource() - .getContainerPropertyIds()) { - options.put(id.toString(), id); - } - createSelectAction("Null Selection Item Id", category, options, - "- None -", (Command) nullSelectItemIdCommand); + private void createCaptionSelect(String category) { + LinkedHashMap options = new LinkedHashMap(); + options.put("-", null); + options.put("Short", TEXT_SHORT); + options.put("Medium", TEXT_MEDIUM); + options.put("Long", TEXT_LONG); + options.put("Very long", TEXT_VERY_LONG); + createSelectAction("Caption", category, options, "Short", + captionCommand); + } - protected void createWidthSelect(String category) { + private void createWidthSelect(String category) { LinkedHashMap options = new LinkedHashMap(); options.put("Undefined", null); options.put("50%", "50%"); @@ -196,7 +187,29 @@ public abstract class MenuBasedComponentTestCase widthCommand, null); } - protected void createHeightSelect(String category) { + private void createIconSelect(String category) { + LinkedHashMap options = new LinkedHashMap(); + options.put("-", null); + options.put("16x16", ICON_16_USER_PNG_CACHEABLE); + options.put("32x32", ICON_32_ATTENTION_PNG_CACHEABLE); + options.put("64x64", ICON_64_EMAIL_REPLY_PNG_CACHEABLE); + + createSelectAction("Icon", category, options, "-", iconCommand, null); + } + + private void createLocaleSelect(String category) { + LinkedHashMap options = new LinkedHashMap(); + options.put("-", null); + options.put("fi_FI", new Locale("fi", "FI")); + options.put("en_US", Locale.US); + options.put("zh_CN", Locale.SIMPLIFIED_CHINESE); + options.put("fr_FR", Locale.FRANCE); + + createSelectAction("Locale", category, options, "-", localeCommand, + null); + } + + private void createHeightSelect(String category) { LinkedHashMap options = new LinkedHashMap(); options.put("Undefined", null); options.put("50%", "50%"); @@ -224,25 +237,53 @@ public abstract class MenuBasedComponentTestCase doCommand(caption, command, initialState, data); } + protected void createClickAction(String caption, + String category, final Command command, DATATYPE value) { + createClickAction(caption, category, command, value, null); + } + + protected void createClickAction(String caption, + String category, final Command command, + DATATYPE value, Object data) { + MenuItem categoryItem = getCategoryMenuItem(category); + categoryItem.addItem(caption, menuClickCommand(command, value, data)); + doCommand(caption, command, value, data); + } + private MenuItem getCategoryMenuItem(String category) { if (category == null) { return getCategoryMenuItem("Misc"); } - if (mainMenu.getChildren() != null) { - for (MenuItem i : mainMenu.getChildren()) { - if (i.getText().equals(category)) { - return i; - } - } + MenuItem item = categoryToMenuItem.get(category); + if (item != null) { + return item; } - return mainMenu.addItem(category, null); + + return createCategory(category, null); } /** - * Provide custom actions for the test case by creating them in this method. + * Creates category "category" in parent category "parentCategory". Each + * category name must be globally unique. + * + * @param category + * @param parentCategory + * @return */ - protected abstract void createCustomActions(); + protected MenuItem createCategory(String category, String parentCategory) { + if (categoryToMenuItem.containsKey(category)) { + return categoryToMenuItem.get(category); + } + MenuItem item; + if (parentCategory == null) { + item = mainMenu.addItem(category, null); + } else { + item = getCategoryMenuItem(parentCategory).addItem(category, null); + } + categoryToMenuItem.put(category, item); + return item; + } private MenuBar.Command menuBooleanCommand( final com.vaadin.tests.components.ComponentTestCase.Command booleanCommand, @@ -258,6 +299,18 @@ public abstract class MenuBasedComponentTestCase }; } + private MenuBar.Command menuClickCommand( + final com.vaadin.tests.components.ComponentTestCase.Command command, + final DATATYPE value, final Object data) { + + return new MenuBar.Command() { + public void menuSelected(MenuItem selectedItem) { + doCommand(getText(selectedItem), command, value, data); + } + + }; + } + protected void setSelected(MenuItem item, boolean selected) { if (selected) { item.setIcon(SELECTED_ICON); @@ -327,59 +380,76 @@ public abstract class MenuBasedComponentTestCase } - protected void createSelectAction( + protected void createMultiClickAction( String caption, String category, LinkedHashMap options, - String initialValue, com.vaadin.tests.components.ComponentTestCase.Command command, Object data) { - MenuItem parentItem = getCategoryMenuItem(category); - MenuItem mainItem = parentItem.addItem(caption, null); + MenuItem categoryItem = getCategoryMenuItem(category); + MenuItem mainItem = categoryItem.addItem(caption, null); - parentOfSelectableMenuItem.add(mainItem); for (String option : options.keySet()) { - MenuBar.Command cmd = singleSelectMenuCommand(command, + MenuBar.Command cmd = menuClickCommand(command, options.get(option), data); - MenuItem item = mainItem.addItem(option, cmd); - if (option.equals(initialValue)) { - cmd.menuSelected(item); - } + mainItem.addItem(option, cmd); } } - /* COMMANDS */ + protected void createMultiToggleAction( + String caption, + String category, + LinkedHashMap options, + com.vaadin.tests.components.ComponentTestCase.Command command, + boolean defaultValue) { - protected Command nullSelectionAllowedCommand = new Command() { + LinkedHashMap defaultValues = new LinkedHashMap(); - public void execute(AbstractSelect c, Boolean value, Object data) { - (c).setNullSelectionAllowed(value); + for (String option : options.keySet()) { + defaultValues.put(option, defaultValue); } - }; - protected Command nullSelectItemIdCommand = new Command() { + createMultiToggleAction(caption, category, options, command, + defaultValues); + } - public void execute(AbstractSelect c, Object value, Object data) { - c.setNullSelectionItemId(value); - } - }; + protected void createMultiToggleAction( + String caption, + String category, + LinkedHashMap options, + com.vaadin.tests.components.ComponentTestCase.Command command, + LinkedHashMap defaultValues) { - protected Command itemsInContainerCommand = new Command() { + createCategory(caption, category); + + for (String option : options.keySet()) { + createBooleanAction(option, caption, defaultValues.get(option), + command, options.get(option)); - public void execute(AbstractSelect t, Integer value, Object data) { - t.setContainerDataSource(createContainer(t.getContainerDataSource() - .getContainerPropertyIds().size(), value)); } - }; + } + + protected void createSelectAction( + String caption, + String category, + LinkedHashMap options, + String initialValue, + com.vaadin.tests.components.ComponentTestCase.Command command, + Object data) { - protected Command columnsInContainerCommand = new Command() { + MenuItem parentItem = getCategoryMenuItem(category); + MenuItem mainItem = parentItem.addItem(caption, null); - public void execute(AbstractSelect t, Integer value, Object data) { - t.setContainerDataSource(createContainer(value, t - .getContainerDataSource().size())); + parentOfSelectableMenuItem.add(mainItem); + for (String option : options.keySet()) { + MenuBar.Command cmd = singleSelectMenuCommand(command, + options.get(option), data); + MenuItem item = mainItem.addItem(option, cmd); + if (option.equals(initialValue)) { + cmd.menuSelected(item); + } } - }; + } - /* COMMANDS END */ } diff --git a/tests/src/com/vaadin/tests/components/abstractfield/AbstractFieldTestCase.java b/tests/src/com/vaadin/tests/components/abstractfield/AbstractFieldTestCase.java new file mode 100644 index 0000000000..d13e164b6e --- /dev/null +++ b/tests/src/com/vaadin/tests/components/abstractfield/AbstractFieldTestCase.java @@ -0,0 +1,124 @@ +package com.vaadin.tests.components.abstractfield; + +import java.util.LinkedHashMap; + +import com.vaadin.data.Property.ReadOnlyStatusChangeEvent; +import com.vaadin.data.Property.ReadOnlyStatusChangeListener; +import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.event.FieldEvents.BlurEvent; +import com.vaadin.event.FieldEvents.BlurListener; +import com.vaadin.event.FieldEvents.BlurNotifier; +import com.vaadin.event.FieldEvents.FocusEvent; +import com.vaadin.event.FieldEvents.FocusListener; +import com.vaadin.event.FieldEvents.FocusNotifier; +import com.vaadin.tests.components.MenuBasedComponentTestCase; +import com.vaadin.ui.AbstractField; + +public abstract class AbstractFieldTestCase extends + MenuBasedComponentTestCase implements ValueChangeListener, + ReadOnlyStatusChangeListener, FocusListener, BlurListener { + + @Override + protected void createActions() { + super.createActions(); + createBooleanAction("Required", CATEGORY_STATE, false, requiredCommand); + createRequiredErrorSelect(CATEGORY_DECORATIONS); + + createValueChangeListener(CATEGORY_LISTENERS); + createReadOnlyStatusChangeListener(CATEGORY_LISTENERS); + } + + private void createRequiredErrorSelect(String category) { + LinkedHashMap options = new LinkedHashMap(); + options.put("-", null); + options.put(TEXT_SHORT, TEXT_SHORT); + options.put("Medium", TEXT_MEDIUM); + options.put("Long", TEXT_LONG); + options.put("Very long", TEXT_VERY_LONG); + createSelectAction("Required error message", category, options, "-", + requiredErrorMessageCommand); + + } + + private void createValueChangeListener(String category) { + + createBooleanAction("Value change listener", category, false, + valueChangeListenerCommand); + } + + private void createReadOnlyStatusChangeListener(String category) { + + createBooleanAction("Read only status change listener", category, + false, readonlyStatusChangeListenerCommand); + } + + protected void createFocusListener(String category) { + createBooleanAction("Focus listener", category, false, + focusListenerCommand); + + } + + protected void createBlurListener(String category) { + createBooleanAction("Blur listener", category, false, + blurListenerCommand); + + } + + protected Command valueChangeListenerCommand = new Command() { + + public void execute(T c, Boolean value, Object data) { + if (value) { + c.addListener((ValueChangeListener) AbstractFieldTestCase.this); + } else { + c.removeListener((ValueChangeListener) AbstractFieldTestCase.this); + } + } + }; + protected Command readonlyStatusChangeListenerCommand = new Command() { + + public void execute(T c, Boolean value, Object data) { + if (value) { + c.addListener((ReadOnlyStatusChangeListener) AbstractFieldTestCase.this); + } else { + c.removeListener((ReadOnlyStatusChangeListener) AbstractFieldTestCase.this); + } + } + }; + protected Command focusListenerCommand = new Command() { + + public void execute(T c, Boolean value, Object data) { + if (value) { + ((FocusNotifier) c).addListener(AbstractFieldTestCase.this); + } else { + ((FocusNotifier) c).removeListener(AbstractFieldTestCase.this); + } + } + }; + protected Command blurListenerCommand = new Command() { + + public void execute(T c, Boolean value, Object data) { + if (value) { + ((BlurNotifier) c).addListener(AbstractFieldTestCase.this); + } else { + ((BlurNotifier) c).removeListener(AbstractFieldTestCase.this); + } + } + }; + + public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) { + log(event.getClass().getSimpleName() + ", new value: " + + event.getProperty().getValue()); + }; + + public void readOnlyStatusChange(ReadOnlyStatusChangeEvent event) { + log(event.getClass().getSimpleName()); + } + + public void focus(FocusEvent event) { + log(event.getClass().getSimpleName()); + } + + public void blur(BlurEvent event) { + log(event.getClass().getSimpleName()); + } +} diff --git a/tests/src/com/vaadin/tests/components/button/Buttons2.java b/tests/src/com/vaadin/tests/components/button/Buttons2.java new file mode 100644 index 0000000000..ecb5d34fa4 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/button/Buttons2.java @@ -0,0 +1,56 @@ +package com.vaadin.tests.components.button; + +import com.vaadin.tests.components.abstractfield.AbstractFieldTestCase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; + +public class Buttons2 extends AbstractFieldTestCase