diff options
author | Artur Signell <artur@vaadin.com> | 2016-08-09 09:53:08 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2016-08-09 11:13:27 +0300 |
commit | d1af5d84e3f6b352318aa0819a65a36b7c6e2dad (patch) | |
tree | c81d6edd8d3fedc47939a20aeefaff33f94f8b20 /uitest/src | |
parent | da98958f4b7c4f3a649cf8bbecd575302bb30e05 (diff) | |
download | vaadin-framework-d1af5d84e3f6b352318aa0819a65a36b7c6e2dad.tar.gz vaadin-framework-d1af5d84e3f6b352318aa0819a65a36b7c6e2dad.zip |
Add support for required status to AbstractField
Change-Id: I64ef7d4425946031432032cc4060e0dcad43678b
Diffstat (limited to 'uitest/src')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTestCase.java | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTestCase.java b/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTestCase.java index 9414bc0fb4..7849124031 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTestCase.java +++ b/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTestCase.java @@ -5,6 +5,7 @@ import java.util.Date; import java.util.List; import java.util.Locale; +import com.vaadin.data.HasRequired; import com.vaadin.legacy.ui.LegacyField; import com.vaadin.server.Resource; import com.vaadin.server.ThemeResource; @@ -15,15 +16,24 @@ import com.vaadin.ui.Layout.SpacingHandler; public abstract class AbstractComponentTestCase<T extends AbstractComponent> extends TestBase { - protected static final ThemeResource ICON_16_HELP_PNG_CACHEABLE = cacheableThemeResource("../runo/icons/16/help.png"); - protected static final ThemeResource ICON_16_FOLDER_PNG_CACHEABLE = cacheableThemeResource("../runo/icons/16/folder.png"); - protected static final ThemeResource ICON_16_ERROR_PNG_CACHEABLE = cacheableThemeResource("../runo/icons/16/error.png"); - 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"); + protected static final ThemeResource ICON_16_HELP_PNG_CACHEABLE = cacheableThemeResource( + "../runo/icons/16/help.png"); + protected static final ThemeResource ICON_16_FOLDER_PNG_CACHEABLE = cacheableThemeResource( + "../runo/icons/16/folder.png"); + protected static final ThemeResource ICON_16_ERROR_PNG_CACHEABLE = cacheableThemeResource( + "../runo/icons/16/error.png"); + 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<T> testComponents = new ArrayList<T>(); @@ -132,8 +142,8 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent> @Override public void execute(T c, Boolean enabled, Object data) { - if (c instanceof LegacyField) { - ((LegacyField<?>) c).setRequired(enabled); + if (c instanceof HasRequired) { + ((HasRequired) c).setRequired(enabled); } else { throw new IllegalArgumentException(c.getClass().getName() + " is not a field and cannot be set to required"); @@ -198,7 +208,8 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent> }; - protected <VALUET> void doCommand(Command<T, VALUET> command, VALUET value) { + protected <VALUET> void doCommand(Command<T, VALUET> command, + VALUET value) { doCommand(command, value, null); } |