diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2016-08-31 17:33:21 +0300 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2016-09-05 17:05:20 +0300 |
commit | c4a38e2502a6f7ce1cd0487fa95b0b3661de5518 (patch) | |
tree | c3e0b88a2d154f0ab924f7f5d1b27b0d4d592e3c /uitest/src/main | |
parent | a253d8b94d88ec2f0c28ba2399262d942980ba07 (diff) | |
download | vaadin-framework-c4a38e2502a6f7ce1cd0487fa95b0b3661de5518.tar.gz vaadin-framework-c4a38e2502a6f7ce1cd0487fa95b0b3661de5518.zip |
Refactor AbstractComponentTest to extend AbstractTestUI
Change-Id: Ie614e7a7bf069ab4035cfcd35c3bc98007adfd4b
Diffstat (limited to 'uitest/src/main')
54 files changed, 144 insertions, 511 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/Components.java b/uitest/src/main/java/com/vaadin/tests/Components.java deleted file mode 100644 index eea70f6ad1..0000000000 --- a/uitest/src/main/java/com/vaadin/tests/Components.java +++ /dev/null @@ -1,270 +0,0 @@ -package com.vaadin.tests; - -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.vaadin.server.ExternalResource; -import com.vaadin.server.LegacyApplication; -import com.vaadin.server.Sizeable; -import com.vaadin.shared.MouseEventDetails.MouseButton; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.tests.components.AbstractComponentTest; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Component; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.HorizontalSplitPanel; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.v7.data.Item; -import com.vaadin.v7.data.util.DefaultItemSorter; -import com.vaadin.v7.data.util.HierarchicalContainer; -import com.vaadin.v7.event.ItemClickEvent; -import com.vaadin.v7.event.ItemClickEvent.ItemClickListener; -import com.vaadin.v7.ui.Tree; -import com.vaadin.v7.ui.Tree.ItemStyleGenerator; - -public class Components extends LegacyApplication { - - private static final Object CAPTION = "c"; - private Map<Class<? extends AbstractComponentTest>, String> tests = new HashMap<>(); - private Tree naviTree; - private HorizontalSplitPanel sp; - private LegacyWindow mainWindow; - private final Embedded applicationEmbedder = new Embedded(); - private String baseUrl; - private List<Class<? extends Component>> componentsWithoutTests = new ArrayList<>(); - - { - for (Class<?> c : VaadinClasses.getBasicComponentTests()) { - String testClass = c.getSimpleName(); - tests.put((Class<? extends AbstractComponentTest>) c, testClass); - } - - List<Class<? extends Component>> componentsWithoutTest = VaadinClasses - .getComponents(); - Set<String> availableTests = new HashSet<>(); - for (String testName : tests.values()) { - availableTests.add(testName); - } - - for (Class<? extends Component> component : componentsWithoutTest) { - String baseName = component.getSimpleName(); - if (availableTests.contains(baseName + "es")) { - continue; - } - if (availableTests.contains(baseName + "es2")) { - continue; - } - if (availableTests.contains(baseName + "s2")) { - continue; - } - if (availableTests.contains(baseName + "s")) { - continue; - } - if (availableTests.contains(baseName + "Test")) { - continue; - } - - componentsWithoutTests.add(component); - } - - } - - class MissingTest extends AbstractComponentTest<AbstractComponent> { - @Override - protected Class<AbstractComponent> getTestClass() { - return null; - } - } - - @Override - public void init() { - mainWindow = new LegacyWindow(); - setTheme("tests-components"); - mainWindow.getContent().setSizeFull(); - setMainWindow(mainWindow); - sp = new HorizontalSplitPanel(); - sp.setSizeFull(); - VerticalLayout naviLayout = new VerticalLayout(); - naviLayout.addComponent(new Label( - "Click to open a test case.<br/>Right click to open test in a new window<br/><br/>", - ContentMode.HTML)); - naviLayout.addComponent(createMenu()); - naviLayout.addComponent(createMissingTestsList()); - - sp.setFirstComponent(naviLayout); - sp.setSplitPosition(250, Sizeable.UNITS_PIXELS); - VerticalLayout embeddingLayout = new VerticalLayout(); - embeddingLayout.setSizeFull(); - embeddingLayout.addComponent(new Label( - "<b>Do not use the embedded version for creating automated tests. Open the test in a new window before recording.</b><br/>", - ContentMode.HTML)); - applicationEmbedder.setSizeFull(); - embeddingLayout.addComponent(applicationEmbedder); - embeddingLayout.setExpandRatio(applicationEmbedder, 1); - sp.setSecondComponent(embeddingLayout); - mainWindow.addComponent(sp); - - applicationEmbedder.setType(Embedded.TYPE_BROWSER); - baseUrl = getURL().toString().replace(getClass().getName(), "") - .replaceAll("//$", "/"); - } - - private Component createMissingTestsList() { - String missingTests = ""; - for (Class<? extends Component> component : componentsWithoutTests) { - String cls = "missing"; - if (component.getAnnotation(Deprecated.class) != null) { - cls = "missing-deprecated"; - } - missingTests += "<font class=\"" + cls + "\">" - + component.getSimpleName() + "</font><br/>"; - } - return new Label( - "<b>Components without a test:</B><br/>" + missingTests, - ContentMode.HTML); - } - - private Component createMenu() { - naviTree = new Tree(); - naviTree.setItemStyleGenerator(new ItemStyleGenerator() { - - @Override - public String getStyle(Tree source, Object itemId) { - Class<?> cls = (Class<?>) itemId; - if (!isAbstract(cls)) { - return "blue"; - } - return null; - } - }); - HierarchicalContainer hc = new HierarchicalContainer(); - naviTree.setContainerDataSource(hc); - DefaultItemSorter sorter = new DefaultItemSorter() { - @SuppressWarnings("rawtypes") - @Override - public int compare(Object o1, Object o2) { - if (o1 instanceof Class && o2 instanceof Class && o1 != null - && o2 != null) { - Class<?> c1 = (Class) o1; - Class<?> c2 = (Class) o2; - boolean a1 = isAbstract(c1); - boolean a2 = isAbstract(c2); - - if (a1 && !a2) { - return 1; - } else if (!a1 && a2) { - return -1; - } - - } - return super.compare(o1, o2); - } - }; - hc.setItemSorter(sorter); - naviTree.addContainerProperty(CAPTION, String.class, ""); - naviTree.setItemCaptionPropertyId(CAPTION); - for (Class<? extends AbstractComponentTest> cls : tests.keySet()) { - addTreeItem(cls); - } - hc.sort(new Object[] { CAPTION }, new boolean[] { true }); - naviTree.setSelectable(false); - for (Object o : naviTree.rootItemIds()) { - expandAndSetChildrenAllowed(o); - } - - naviTree.addListener(new ItemClickListener() { - - @Override - public void itemClick(ItemClickEvent event) { - Class<?> cls = (Class<?>) event.getItemId(); - if (!isAbstract(cls)) { - String url = baseUrl + cls.getName() - + "?restartApplication"; - if (event.getButton() == MouseButton.LEFT) { - openEmbedded(url); - naviTree.setValue(event.getItemId()); - } else if (event.getButton() == MouseButton.RIGHT) { - openInNewTab(url); - } - } - } - - }); - return naviTree; - } - - protected void openInNewTab(String url) { - getMainWindow().open(new ExternalResource(url), "_blank"); - } - - protected void openEmbedded(String url) { - applicationEmbedder.setSource(new ExternalResource(url)); - } - - private void expandAndSetChildrenAllowed(Object o) { - Collection<?> children = naviTree.getChildren(o); - if (children == null || children.size() == 0) { - naviTree.setChildrenAllowed(o, false); - } else { - naviTree.expandItem(o); - for (Object c : children) { - expandAndSetChildrenAllowed(c); - } - } - - } - - protected boolean isAbstract(Class<?> cls) { - return Modifier.isAbstract(cls.getModifiers()); - } - - @SuppressWarnings("unchecked") - private void addTreeItem(Class<? extends AbstractComponentTest> cls) { - String name = tests.get(cls); - if (name == null) { - name = cls.getSimpleName(); - } - - Class<? extends AbstractComponentTest> superClass = (Class<? extends AbstractComponentTest>) cls - .getSuperclass(); - - // This cast is needed only to make compilation through Ant work .. - if (((Class<?>) cls) != AbstractComponentTest.class) { - addTreeItem(superClass); - } - if (naviTree.containsId(cls)) { - return; - } - - Item i = naviTree.addItem(cls); - i.getItemProperty(CAPTION).setValue(name); - naviTree.setParent(cls, superClass); - } - - protected Component createTestComponent( - Class<? extends AbstractComponentTest> cls) { - try { - AbstractComponentTest t = cls.newInstance(); - t.init(); - Component c = t.getMainWindow().getContent(); - t.getMainWindow().setContent(null); - return c; - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - } - -} diff --git a/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTest.java b/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTest.java index 2c51bd132d..1e0f54bebc 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTest.java @@ -9,23 +9,24 @@ import java.util.Locale; import java.util.Map; import java.util.Set; +import com.vaadin.annotations.Theme; 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.server.DefaultErrorHandler; import com.vaadin.server.Resource; import com.vaadin.server.ThemeResource; +import com.vaadin.server.VaadinRequest; import com.vaadin.tests.util.Log; import com.vaadin.tests.util.LoremIpsum; import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Component.Focusable; import com.vaadin.ui.MenuBar; import com.vaadin.ui.MenuBar.MenuItem; import com.vaadin.ui.themes.BaseTheme; +@Theme("tests-components") public abstract class AbstractComponentTest<T extends AbstractComponent> extends AbstractComponentTestCase<T> implements FocusListener, BlurListener { @@ -81,15 +82,14 @@ public abstract class AbstractComponentTest<T extends AbstractComponent> extends protected static final String CATEGORY_DECORATIONS = "Decorations"; @Override - protected final void setup() { - setTheme("tests-components"); + protected final void setup(VaadinRequest request) { // Create menu here so it appears before the components addComponent(createMainMenu()); getLayout().setSizeFull(); createLog(); - super.setup(); + super.setup(request); // Create menu actions and trigger default actions createActions(); @@ -748,16 +748,6 @@ public abstract class AbstractComponentTest<T extends AbstractComponent> extends } @Override - public void error(com.vaadin.server.ErrorEvent event) { - final Throwable throwable = DefaultErrorHandler - .findRelevantThrowable(event.getThrowable()); - - log.log("Exception occured, " + throwable.getClass().getName() + ": " - + throwable.getMessage()); - throwable.printStackTrace(); - } - - @Override public void focus(FocusEvent event) { log(event.getClass().getSimpleName()); } 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 bdb1ff3f83..c52e332b94 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTestCase.java +++ b/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTestCase.java @@ -9,12 +9,13 @@ import com.vaadin.data.HasRequired; import com.vaadin.server.Resource; import com.vaadin.server.ThemeResource; import com.vaadin.server.UserError; +import com.vaadin.server.VaadinRequest; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.Layout.SpacingHandler; import com.vaadin.v7.ui.Field; public abstract class AbstractComponentTestCase<T extends AbstractComponent> - extends TestBase { + extends AbstractTestUI { protected static final ThemeResource ICON_16_HELP_PNG_CACHEABLE = cacheableThemeResource( "../runo/icons/16/help.png"); @@ -52,7 +53,7 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent> abstract protected void initializeComponents(); @Override - protected void setup() { + protected void setup(VaadinRequest request) { ((SpacingHandler) getLayout()).setSpacing(true); // Create Components @@ -77,136 +78,66 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent> public void execute(T c, VALUETYPE value, Object data); } - /* COMMANDS */ - - protected Command<T, String> widthCommand = new Command<T, String>() { - - @Override - public void execute(T t, String value, Object data) { - t.setWidth(value); - } - }; - protected Command<T, String> heightCommand = new Command<T, String>() { - - @Override - public void execute(T t, String value, Object data) { - t.setHeight(value); - } - }; - - protected Command<T, Boolean> enabledCommand = new Command<T, Boolean>() { - - @Override - public void execute(T c, Boolean enabled, Object data) { - c.setEnabled(enabled); - } - }; - - protected Command<T, Boolean> immediateCommand = new Command<T, Boolean>() { - - @Override - public void execute(T c, Boolean immediate, Object data) { - c.setImmediate(immediate); - } - }; - - protected Command<T, Boolean> errorIndicatorCommand = new Command<T, Boolean>() { - - @Override - 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<T, String> errorMessageCommand = new Command<T, String>() { - - @Override - public void execute(T c, String value, Object data) { - errorMessage = value; - if (c.getComponentError() != null) { - errorIndicatorCommand.execute(c, true, null); - } - - } - - }; + /* COMMANDS */ - // TODO Move to AbstractFieldTestCase - protected Command<T, Boolean> requiredCommand = new Command<T, Boolean>() { - - @Override - public void execute(T c, Boolean enabled, Object data) { - 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"); - } - } - }; - protected Command<T, String> requiredErrorMessageCommand = new Command<T, String>() { + protected Command<T, String> widthCommand = (t, value, data) -> t.setWidth( + value); + protected Command<T, String> heightCommand = (t, value, data) -> t + .setHeight(value); - @Override - public void execute(T c, String value, Object data) { - ((Field<?>) c).setRequiredError(value); - } + protected Command<T, Boolean> enabledCommand = (c, enabled, data) -> c + .setEnabled(enabled); - }; + protected Command<T, Boolean> immediateCommand = (c, immediate, data) -> c + .setImmediate(immediate); - protected Command<T, String> descriptionCommand = new Command<T, String>() { - @Override - public void execute(T c, String value, Object data) { - c.setDescription(value); + protected Command<T, Boolean> errorIndicatorCommand = (c, enabled, + data) -> { + if (enabled) { + c.setComponentError(new UserError(errorMessage)); + } else { + c.setComponentError(null); } }; - protected Command<T, Boolean> readonlyCommand = new Command<T, Boolean>() { - - @Override - public void execute(T c, Boolean enabled, Object data) { - c.setReadOnly(enabled); + protected Command<T, String> errorMessageCommand = (c, value, data) -> { + errorMessage = value; + if (c.getComponentError() != null) { + errorIndicatorCommand.execute(c, true, null); } - }; - - protected Command<T, Boolean> visibleCommand = new Command<T, Boolean>() { - @Override - public void execute(T c, Boolean enabled, Object data) { - c.setVisible(enabled); - } }; - protected Command<T, Resource> iconCommand = new Command<T, Resource>() { - - @Override - public void execute(T c, Resource value, Object data) { - c.setIcon(value); + // TODO Move to AbstractFieldTestCase + protected Command<T, Boolean> requiredCommand = (c, enabled, data) -> { + 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"); } - }; - protected Command<T, String> captionCommand = new Command<T, String>() { + protected Command<T, String> requiredErrorMessageCommand = (c, value, + data) -> ((Field<?>) c).setRequiredError(value); - @Override - public void execute(T c, String value, Object data) { - c.setCaption(value); - } + protected Command<T, String> descriptionCommand = (c, value, data) -> c + .setDescription(value); - }; + protected Command<T, Boolean> readonlyCommand = (c, enabled, data) -> c + .setReadOnly(enabled); - protected Command<T, Locale> localeCommand = new Command<T, Locale>() { + protected Command<T, Boolean> visibleCommand = (c, enabled, data) -> c + .setVisible(enabled); - @Override - public void execute(T c, Locale value, Object data) { - c.setLocale(value); - } + protected Command<T, Resource> iconCommand = (c, value, data) -> c.setIcon( + value); + protected Command<T, String> captionCommand = (c, value, data) -> c + .setCaption(value); - }; + protected Command<T, Locale> localeCommand = (c, value, data) -> c + .setLocale(value); protected <VALUET> void doCommand(Command<T, VALUET> command, VALUET value) { @@ -230,23 +161,14 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent> doCommand(command, value, data); } - protected Command<T, String> styleNameCommand = new Command<T, String>() { - @Override - public void execute(T c, String value, Object data) { - c.setStyleName(value); - } - }; + protected Command<T, String> styleNameCommand = (c, value, data) -> c + .setStyleName(value); - protected Command<T, String> primaryStyleNameCommand = new Command<T, String>() { - @Override - public void execute(T c, String value, Object data) { - c.setPrimaryStyleName(value); - } - }; + protected Command<T, String> primaryStyleNameCommand = (c, value, data) -> c + .setPrimaryStyleName(value); @Override - protected String getDescription() { + protected String getTestDescription() { return "Generic test case for " + getTestClass().getSimpleName(); } - } diff --git a/uitest/src/main/java/com/vaadin/tests/components/ComponentTestCase.java b/uitest/src/main/java/com/vaadin/tests/components/ComponentTestCase.java index 2786eb8558..86a743001b 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/ComponentTestCase.java +++ b/uitest/src/main/java/com/vaadin/tests/components/ComponentTestCase.java @@ -4,16 +4,14 @@ import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; +import com.vaadin.server.VaadinRequest; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Component; import com.vaadin.ui.HorizontalLayout; import com.vaadin.v7.data.Item; -import com.vaadin.v7.data.Property; -import com.vaadin.v7.data.Property.ValueChangeEvent; import com.vaadin.v7.ui.Field; import com.vaadin.v7.ui.NativeSelect; @@ -25,12 +23,12 @@ public abstract class ComponentTestCase<T extends AbstractComponent> private HorizontalLayout actionLayout; @Override - protected final void setup() { + protected final void setup(VaadinRequest request) { // Create action layout so it appears before the components actionLayout = createActionLayout(); addComponent(actionLayout); - super.setup(); + super.setup(request); // Create actions and add to layout populateActionLayout(); @@ -129,14 +127,11 @@ public abstract class ComponentTestCase<T extends AbstractComponent> Button button = new Button(caption); button.setData(Boolean.FALSE); - button.addListener(new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - Button b = event.getButton(); - boolean state = (Boolean) b.getData(); - b.setData(!state); - doCommand(command, state); - } + button.addClickListener(event -> { + Button b = event.getButton(); + boolean state = (Boolean) b.getData(); + b.setData(!state); + doCommand(command, state); }); button.setId("buttonaction-" + caption); @@ -156,17 +151,12 @@ public abstract class ComponentTestCase<T extends AbstractComponent> select.addContainerProperty(VALUE, Object.class, ""); select.setItemCaptionPropertyId(CAPTION); select.setNullSelectionAllowed(false); - select.addListener(new Property.ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - Object itemId = event.getProperty().getValue(); - Item item = select.getItem(itemId); - @SuppressWarnings("unchecked") - TYPE value = (TYPE) item.getItemProperty(VALUE).getValue(); - doCommand(command, value); - - } + select.addValueChangeListener(event -> { + Object itemId = event.getProperty().getValue(); + Item item = select.getItem(itemId); + @SuppressWarnings("unchecked") + TYPE value = (TYPE) item.getItemProperty(VALUE).getValue(); + doCommand(command, value); }); for (String itemCaption : options.keySet()) { @@ -177,7 +167,6 @@ public abstract class ComponentTestCase<T extends AbstractComponent> if (itemCaption.equals(initialValue)) { select.setValue(itemId); } - } select.setId("selectaction-" + caption); diff --git a/uitest/src/main/java/com/vaadin/tests/components/TouchDevicesTooltip.java b/uitest/src/main/java/com/vaadin/tests/components/TouchDevicesTooltip.java index 8db90bf332..24ba6c3a20 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/TouchDevicesTooltip.java +++ b/uitest/src/main/java/com/vaadin/tests/components/TouchDevicesTooltip.java @@ -62,7 +62,7 @@ public class TouchDevicesTooltip extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "Unable to dismiss a tooltip on touch devices"; } -}
\ No newline at end of file +} diff --git a/uitest/src/main/java/com/vaadin/tests/components/button/ButtonHtml.java b/uitest/src/main/java/com/vaadin/tests/components/button/ButtonHtml.java index 1c3070f38b..0b1ab42667 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/button/ButtonHtml.java +++ b/uitest/src/main/java/com/vaadin/tests/components/button/ButtonHtml.java @@ -4,6 +4,12 @@ import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; +/* + * NOTE This class is arbitrarily picked to represent a legacy application in + * MultipleServletConfigurationTest and the corresponding "Embed App 1" servlet + * configuration. The test will break if this class is refactored to extend UI + * instead of LegacyApplication. Just a friendly warning. + */ public class ButtonHtml extends TestBase { @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/button/Buttons.java b/uitest/src/main/java/com/vaadin/tests/components/button/Buttons.java index a6c4e326fe..2913c64a98 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/button/Buttons.java +++ b/uitest/src/main/java/com/vaadin/tests/components/button/Buttons.java @@ -64,7 +64,7 @@ public class Buttons extends ComponentTestCase<Button> { } @Override - protected String getDescription() { + protected String getTestDescription() { return "A generic test for Buttons in different configurations"; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/button/ButtonsWaiAria.java b/uitest/src/main/java/com/vaadin/tests/components/button/ButtonsWaiAria.java index 24dc942171..de803256f5 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/button/ButtonsWaiAria.java +++ b/uitest/src/main/java/com/vaadin/tests/components/button/ButtonsWaiAria.java @@ -50,7 +50,7 @@ public class ButtonsWaiAria extends ComponentTestCase<Button> { } @Override - protected String getDescription() { + protected String getTestDescription() { return "A generic test for Buttons in different configurations"; } } diff --git a/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxes.java b/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxes.java index 24f53889b3..87e7dae16f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxes.java +++ b/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxes.java @@ -64,7 +64,7 @@ public class CheckBoxes extends ComponentTestCase<CheckBox> { } @Override - protected String getDescription() { + protected String getTestDescription() { return "A generic test for CheckBoxes in different configurations"; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxPageLength.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxPageLength.java index dc8b152185..bdf7131318 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxPageLength.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxPageLength.java @@ -33,9 +33,8 @@ public class ComboBoxPageLength extends ComboBoxes2<ComboBox> { } @Override - protected String getDescription() { - return super.getDescription() + protected String getTestDescription() { + return super.getTestDescription() + ", changing ComboBox value will change the ComboBox pageLength to the # of the selected item, or to 0 in null selection."; } - } diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabled.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabled.java index e1c5c49a57..3bf724bad4 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabled.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabled.java @@ -60,7 +60,7 @@ public class ComboBoxScrollingToPageDisabled } @Override - protected String getDescription() { + protected String getTestDescription() { return "Test that selected value appears on the client " + "side even though setScrollToSelectedItem(false) " + "has been called. Textbox should contain 'Item 50'."; diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/Comboboxes.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/Comboboxes.java index e5c4a33992..9ebc37a4bf 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/Comboboxes.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/Comboboxes.java @@ -115,7 +115,7 @@ public class Comboboxes extends ComponentTestCase<ComboBox> { } @Override - protected String getDescription() { + protected String getTestDescription() { return "A generic test for ComboBoxes in different configurations"; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/FilteringTurkishLocale.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/FilteringTurkishLocale.java index 5d2ef019f1..4624d213e9 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/FilteringTurkishLocale.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/FilteringTurkishLocale.java @@ -48,10 +48,9 @@ public class FilteringTurkishLocale extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "When the Turkish locale is used," + " filtering for 'i' should show the option with a dot" + " while filtering for 'ı' should show the option witout a dot"; } - } diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/InlineDateFields.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/InlineDateFields.java index 8136097040..2c5f387292 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/InlineDateFields.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/InlineDateFields.java @@ -57,7 +57,7 @@ public class InlineDateFields extends ComponentTestCase<InlineDateField> { } @Override - protected String getDescription() { + protected String getTestDescription() { return "A generic test for InlineDateFields in different configurations"; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/PopupDateFields.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/PopupDateFields.java index 60e90a8f1b..4847bb0c70 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/PopupDateFields.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/PopupDateFields.java @@ -53,7 +53,7 @@ public class PopupDateFields extends ComponentTestCase<PopupDateField> { } @Override - protected String getDescription() { + protected String getTestDescription() { return "A generic test for PopupDateFields in different configurations"; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/gridlayout/ComponentAlignments.java b/uitest/src/main/java/com/vaadin/tests/components/gridlayout/ComponentAlignments.java index e50bdd8dcd..b84735c740 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/gridlayout/ComponentAlignments.java +++ b/uitest/src/main/java/com/vaadin/tests/components/gridlayout/ComponentAlignments.java @@ -55,8 +55,7 @@ public class ComponentAlignments extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "TOP_CENTER and TOP_RIGHT alignments should work in VerticalLayout"; } - } diff --git a/uitest/src/main/java/com/vaadin/tests/components/label/LabelModes.java b/uitest/src/main/java/com/vaadin/tests/components/label/LabelModes.java index 6c61e16402..dd6bb14aa2 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/label/LabelModes.java +++ b/uitest/src/main/java/com/vaadin/tests/components/label/LabelModes.java @@ -51,7 +51,7 @@ public class LabelModes extends ComponentTestCase<Label> { } @Override - protected String getDescription() { + protected String getTestDescription() { return "A generic test for Labels in different configurations"; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/label/Labels.java b/uitest/src/main/java/com/vaadin/tests/components/label/Labels.java index 0d296b1b92..416de00bdb 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/label/Labels.java +++ b/uitest/src/main/java/com/vaadin/tests/components/label/Labels.java @@ -67,7 +67,7 @@ public class Labels extends ComponentTestCase<Label> { } @Override - protected String getDescription() { + protected String getTestDescription() { return "A generic test for Labels in different configurations"; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarHtmlItems.java b/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarHtmlItems.java index d6e79224a3..068043c31c 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarHtmlItems.java +++ b/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarHtmlItems.java @@ -20,9 +20,9 @@ public class MenuBarHtmlItems extends ComponentTestCase<MenuBar> { @Override protected void initializeComponents() { MenuBar m = new MenuBar(); - MenuItem submenu = m.addItem("Item <u>1</u>", getIcon(), null); + MenuItem submenu = m.addItem("Item <u>1</u>", getMenuIcon(), null); MenuItem subsubmenu = submenu.addItem("<b>Bold</b> item", null); - subsubmenu.addItem("<i><u>I</u>talic</i> item", getIcon(), null); + subsubmenu.addItem("<i><u>I</u>talic</i> item", getMenuIcon(), null); submenu.addItem( "<span style='font-size: 30px'>Big</span> <span style='font-size: 8px'>disabled</span> item", null).setEnabled(false); @@ -32,7 +32,7 @@ public class MenuBarHtmlItems extends ComponentTestCase<MenuBar> { addTestComponent(m); } - private Resource getIcon() { + private Resource getMenuIcon() { return new ThemeResource("../runo/icons/16/user.png"); } @@ -57,7 +57,7 @@ public class MenuBarHtmlItems extends ComponentTestCase<MenuBar> { } @Override - protected String getDescription() { + protected String getTestDescription() { return "A menu containing items with embedded html. Items should chould either render the html or show it as plain text depending on the setting."; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarNavigation.java b/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarNavigation.java index c8814320f0..b7f2206979 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarNavigation.java +++ b/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarNavigation.java @@ -14,12 +14,12 @@ public class MenuBarNavigation extends AbstractTestUIWithLog private MenuItem export; @Override - public String getDescription() { + protected String getTestDescription() { return "Test case for mouse and keyboard navigation in MenuBar"; } @Override - public Integer getTicketNumber() { + protected Integer getTicketNumber() { return 5174; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarTest.java b/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarTest.java index 99c84793fc..8b47bc20de 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarTest.java @@ -301,7 +301,7 @@ public class MenuBarTest extends AbstractComponentTest<MenuBar> { private void updateIcons(MenuItem item, int idx) { if (iconInterval > 0 && idx % iconInterval == 0) { - item.setIcon(getIcon()); + item.setIcon(getMenuIcon()); } else { item.setIcon(null); } @@ -315,7 +315,7 @@ public class MenuBarTest extends AbstractComponentTest<MenuBar> { private long iconCacheIndex = new Date().getTime(); - private Resource getIcon() { + private Resource getMenuIcon() { String resourceID = null; if (iconSize == 16) { resourceID = "../runo/icons/16/user.png"; diff --git a/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuItemStyleRemoved.java b/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuItemStyleRemoved.java index 8efafa3afa..716fef65b3 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuItemStyleRemoved.java +++ b/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuItemStyleRemoved.java @@ -48,7 +48,7 @@ public class MenuItemStyleRemoved extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "MenuItem's custom class names removed when hovering"; } } diff --git a/uitest/src/main/java/com/vaadin/tests/components/menubar/Menubars.java b/uitest/src/main/java/com/vaadin/tests/components/menubar/Menubars.java index 90dba78ec0..dd3c5cecb8 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/menubar/Menubars.java +++ b/uitest/src/main/java/com/vaadin/tests/components/menubar/Menubars.java @@ -72,7 +72,7 @@ public class Menubars extends ComponentTestCase<MenuBar> { } @Override - protected String getDescription() { + protected String getTestDescription() { return "A generic test for MenuBars in different configurations"; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/notification/ChromeBottomNotification.java b/uitest/src/main/java/com/vaadin/tests/components/notification/ChromeBottomNotification.java index df1e0048be..aa68288753 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/notification/ChromeBottomNotification.java +++ b/uitest/src/main/java/com/vaadin/tests/components/notification/ChromeBottomNotification.java @@ -26,7 +26,7 @@ public class ChromeBottomNotification extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "Bottom notification on Chrome goes up to top"; } } diff --git a/uitest/src/main/java/com/vaadin/tests/components/optiongroup/DisabledOptionGroupItems.java b/uitest/src/main/java/com/vaadin/tests/components/optiongroup/DisabledOptionGroupItems.java index 2cb400670e..c82310f2fa 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/optiongroup/DisabledOptionGroupItems.java +++ b/uitest/src/main/java/com/vaadin/tests/components/optiongroup/DisabledOptionGroupItems.java @@ -87,7 +87,7 @@ public class DisabledOptionGroupItems extends ComponentTestCase<OptionGroup> { } @Override - protected String getDescription() { + protected String getTestDescription() { return "Test case for disabled items in an OptionGroup"; } } diff --git a/uitest/src/main/java/com/vaadin/tests/components/optiongroup/HtmlOptionGroupItems.java b/uitest/src/main/java/com/vaadin/tests/components/optiongroup/HtmlOptionGroupItems.java index c6c0ac3d90..f4b6b584ac 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/optiongroup/HtmlOptionGroupItems.java +++ b/uitest/src/main/java/com/vaadin/tests/components/optiongroup/HtmlOptionGroupItems.java @@ -101,7 +101,7 @@ public class HtmlOptionGroupItems extends ComponentTestCase<OptionGroup> { } @Override - protected String getDescription() { + protected String getTestDescription() { return "Test case for html items in an OptionGroup"; } } diff --git a/uitest/src/main/java/com/vaadin/tests/components/select/NativeSelects.java b/uitest/src/main/java/com/vaadin/tests/components/select/NativeSelects.java index 8c77cfd465..a207d31983 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/select/NativeSelects.java +++ b/uitest/src/main/java/com/vaadin/tests/components/select/NativeSelects.java @@ -99,7 +99,7 @@ public class NativeSelects extends ComponentTestCase<NativeSelect> { } @Override - protected String getDescription() { + protected String getTestDescription() { return "A generic test for Labels in different configurations"; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/ContextMenuSize.java b/uitest/src/main/java/com/vaadin/tests/components/table/ContextMenuSize.java index 34cf62c055..9ab631aa22 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/ContextMenuSize.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/ContextMenuSize.java @@ -55,7 +55,7 @@ public class ContextMenuSize extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "If context menu original position doesn't allow to show it then " + "its bottom should be aligned with the window bottom and height " + "should be reset after repositioning."; diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/Footer.java b/uitest/src/main/java/com/vaadin/tests/components/table/Footer.java index e4022b0897..0686615664 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/Footer.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/Footer.java @@ -100,7 +100,7 @@ public class Footer extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "Table with footer"; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/FooterClick.java b/uitest/src/main/java/com/vaadin/tests/components/table/FooterClick.java index fbd632dc85..aa80d15af8 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/FooterClick.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/FooterClick.java @@ -62,7 +62,7 @@ public class FooterClick extends AbstractTestUIWithLog { } @Override - public String getDescription() { + protected String getTestDescription() { return "Tests the footer click handler"; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/HeaderClick.java b/uitest/src/main/java/com/vaadin/tests/components/table/HeaderClick.java index db79287433..3e0a695b31 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/HeaderClick.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/HeaderClick.java @@ -60,7 +60,7 @@ public class HeaderClick extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "Tests the header click listener"; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/HeaderFooterClickLeftRightMiddle.java b/uitest/src/main/java/com/vaadin/tests/components/table/HeaderFooterClickLeftRightMiddle.java index 84ff51ae99..8263b481eb 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/HeaderFooterClickLeftRightMiddle.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/HeaderFooterClickLeftRightMiddle.java @@ -118,7 +118,7 @@ public class HeaderFooterClickLeftRightMiddle extends AbstractTestUIWithLog { } @Override - public String getDescription() { + protected String getTestDescription() { return "Tests the header click listener"; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/HeaderPositionWhenSorting.java b/uitest/src/main/java/com/vaadin/tests/components/table/HeaderPositionWhenSorting.java index 6faa259d5a..9f060ddf85 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/HeaderPositionWhenSorting.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/HeaderPositionWhenSorting.java @@ -111,8 +111,10 @@ public class HeaderPositionWhenSorting extends AbstractTestUI } @Override - public String getDescription() { - return "Table should only prevent the browser context menu when the right click is used for some Table specific operation. In practice these are either action handlers/context menu or item click listeners (right click). Note that item click listeners affects rows only, not the body."; + protected String getTestDescription() { + return "Table should only prevent the browser context menu when the right click is used for some Table specific operation. " + + "In practice these are either action handlers/context menu or item click listeners (right click). " + + "Note that item click listeners affects rows only, not the body."; } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/HeaderSyncOnScroll.java b/uitest/src/main/java/com/vaadin/tests/components/table/HeaderSyncOnScroll.java index 3d14cdcdae..1d4a620ff3 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/HeaderSyncOnScroll.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/HeaderSyncOnScroll.java @@ -13,8 +13,8 @@ public class HeaderSyncOnScroll extends AbstractTestUI { private Table table; @Override - public String getDescription() { - return "Header's should be in sync when scrolling"; + protected String getTestDescription() { + return "Headers should be in sync when scrolling"; } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java b/uitest/src/main/java/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java index a612c67827..ba88cc93a9 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java @@ -35,7 +35,7 @@ public class HeaderUpdateWhenNoRows extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "The header should be updated when toggling column header mode"; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableSetUndefinedSize.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableSetUndefinedSize.java index 3d9e9a25d6..af850774ce 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableSetUndefinedSize.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableSetUndefinedSize.java @@ -111,7 +111,7 @@ public class TableSetUndefinedSize extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "Table width and height changing to undefined doesn't update table size"; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java index 53c7684ea1..ad25d2b78d 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java @@ -14,7 +14,7 @@ public class TableVisibleColumnsUpdate extends AbstractTestUI { private Table table; @Override - public String getDescription() { + protected String getTestDescription() { return "Columns should change between p1,p2,p3 and p1,p4,p3"; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleWhenTabsheetNotClipped.java b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleWhenTabsheetNotClipped.java index c58edc38a8..c3817083a2 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleWhenTabsheetNotClipped.java +++ b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/FirstTabNotVisibleWhenTabsheetNotClipped.java @@ -129,7 +129,7 @@ public class FirstTabNotVisibleWhenTabsheetNotClipped extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "TabSheet should display re-shown tab if there's room for it"; } } diff --git a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/VetoTabChange.java b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/VetoTabChange.java index 9025d87a2f..850bad4249 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/tabsheet/VetoTabChange.java +++ b/uitest/src/main/java/com/vaadin/tests/components/tabsheet/VetoTabChange.java @@ -43,7 +43,7 @@ public class VetoTabChange extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "Tests the behavior when there's a listener that always changes back to the first tab."; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/upload/DisabledUploadButton.java b/uitest/src/main/java/com/vaadin/tests/components/upload/DisabledUploadButton.java index dcf2ac2784..13be9ad53d 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/upload/DisabledUploadButton.java +++ b/uitest/src/main/java/com/vaadin/tests/components/upload/DisabledUploadButton.java @@ -29,7 +29,7 @@ public class DisabledUploadButton extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "Upload button should be disabled when upload " + "is set to readonly and/or disabled"; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/upload/TestImmediateUploadInFormLayout.java b/uitest/src/main/java/com/vaadin/tests/components/upload/TestImmediateUploadInFormLayout.java index 5ac15a7814..4cd28936b5 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/upload/TestImmediateUploadInFormLayout.java +++ b/uitest/src/main/java/com/vaadin/tests/components/upload/TestImmediateUploadInFormLayout.java @@ -8,6 +8,7 @@ import java.util.List; import com.vaadin.tests.components.ComponentTestCase; import com.vaadin.ui.Component; import com.vaadin.ui.FormLayout; +import com.vaadin.ui.Notification; import com.vaadin.ui.Upload; import com.vaadin.ui.Upload.Receiver; @@ -15,7 +16,7 @@ public class TestImmediateUploadInFormLayout extends ComponentTestCase<FormLayout> implements Receiver { @Override - protected String getDescription() { + protected String getTestDescription() { return "On Firefox 3.5 and Opera 10.10, clicking on an immediate upload in a wide FormLayout has no effect"; } @@ -48,7 +49,7 @@ public class TestImmediateUploadInFormLayout @Override public OutputStream receiveUpload(String filename, String MIMEType) { - getMainWindow().showNotification("Receiving upload"); + Notification.show("Receiving upload"); return new ByteArrayOutputStream(); } } diff --git a/uitest/src/main/java/com/vaadin/tests/components/upload/TestUpload.java b/uitest/src/main/java/com/vaadin/tests/components/upload/TestUpload.java index cac26c2297..519296d006 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/upload/TestUpload.java +++ b/uitest/src/main/java/com/vaadin/tests/components/upload/TestUpload.java @@ -7,6 +7,7 @@ import java.util.List; import com.vaadin.tests.components.ComponentTestCase; import com.vaadin.ui.Component; +import com.vaadin.ui.Notification; import com.vaadin.ui.Upload; import com.vaadin.ui.Upload.FinishedEvent; import com.vaadin.ui.Upload.Receiver; @@ -31,10 +32,10 @@ public class TestUpload extends ComponentTestCase<Upload> implements Receiver { u.setSizeUndefined(); addTestComponent(u); - u.addListener(new Upload.FinishedListener() { + u.addFinishedListener(new Upload.FinishedListener() { @Override public void uploadFinished(FinishedEvent event) { - getMainWindow().showNotification("Done"); + Notification.show("Done"); } }); @@ -54,7 +55,7 @@ public class TestUpload extends ComponentTestCase<Upload> implements Receiver { @Override public OutputStream receiveUpload(String filename, String MIMEType) { - getMainWindow().showNotification("Receiving upload"); + Notification.show("Receiving upload"); return new ByteArrayOutputStream(); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/upload/TestUploadAndDisableOnSuccess.java b/uitest/src/main/java/com/vaadin/tests/components/upload/TestUploadAndDisableOnSuccess.java index c117f179f7..299195d266 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/upload/TestUploadAndDisableOnSuccess.java +++ b/uitest/src/main/java/com/vaadin/tests/components/upload/TestUploadAndDisableOnSuccess.java @@ -8,6 +8,7 @@ import java.util.List; import com.vaadin.tests.components.ComponentTestCase; import com.vaadin.ui.Component; import com.vaadin.ui.Label; +import com.vaadin.ui.Notification; import com.vaadin.ui.Upload; import com.vaadin.ui.Upload.FinishedEvent; import com.vaadin.ui.Upload.Receiver; @@ -17,7 +18,7 @@ public class TestUploadAndDisableOnSuccess extends ComponentTestCase<Upload> implements Receiver { @Override - protected String getDescription() { + protected String getTestDescription() { return "If upload is detached and attached during upload, the client side componenent never receives information that the upload has finished. Second update will not be successful."; } @@ -49,7 +50,7 @@ public class TestUploadAndDisableOnSuccess extends ComponentTestCase<Upload> l = new Label(getUploadcount()); addComponent(l); - u.addListener(new Upload.StartedListener() { + u.addStartedListener(new Upload.StartedListener() { @Override public void uploadStarted(StartedEvent event) { @@ -63,10 +64,10 @@ public class TestUploadAndDisableOnSuccess extends ComponentTestCase<Upload> } }); - u.addListener(new Upload.FinishedListener() { + u.addFinishedListener(new Upload.FinishedListener() { @Override public void uploadFinished(FinishedEvent event) { - getMainWindow().showNotification("Done"); + Notification.show("Done"); l.setValue(getUploadcount()); } }); diff --git a/uitest/src/main/java/com/vaadin/tests/components/window/WindowTest.java b/uitest/src/main/java/com/vaadin/tests/components/window/WindowTest.java index 2639e257f5..ac8ca19e25 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/window/WindowTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/window/WindowTest.java @@ -12,12 +12,12 @@ public class WindowTest extends PanelTest<Window> { } @Override - protected void addTestComponent(Window c) { + protected void addTestComponent(Window w) { VerticalLayout layout = new VerticalLayout(); layout.setMargin(true); - c.setContent(layout); - getMainWindow().addWindow(c); - getTestComponents().add(c); + w.setContent(layout); + addWindow(w); + getTestComponents().add(w); } } diff --git a/uitest/src/main/java/com/vaadin/tests/debug/PushVersionInfo.java b/uitest/src/main/java/com/vaadin/tests/debug/PushVersionInfo.java index 0688eb431e..99f12013e7 100644 --- a/uitest/src/main/java/com/vaadin/tests/debug/PushVersionInfo.java +++ b/uitest/src/main/java/com/vaadin/tests/debug/PushVersionInfo.java @@ -40,7 +40,7 @@ public class PushVersionInfo extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "Debug window shows Push version in info Tab."; } diff --git a/uitest/src/main/java/com/vaadin/tests/extensions/IframeIsOpenedInNonIOS.java b/uitest/src/main/java/com/vaadin/tests/extensions/IframeIsOpenedInNonIOS.java index 1311e02b42..745904ebe2 100644 --- a/uitest/src/main/java/com/vaadin/tests/extensions/IframeIsOpenedInNonIOS.java +++ b/uitest/src/main/java/com/vaadin/tests/extensions/IframeIsOpenedInNonIOS.java @@ -41,7 +41,7 @@ public class IframeIsOpenedInNonIOS extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "IFrame with a file is not shown in iOS"; } } diff --git a/uitest/src/main/java/com/vaadin/tests/fieldgroup/BasicPersonForm.java b/uitest/src/main/java/com/vaadin/tests/fieldgroup/BasicPersonForm.java index 1c1e2efcef..503e5bd4eb 100644 --- a/uitest/src/main/java/com/vaadin/tests/fieldgroup/BasicPersonForm.java +++ b/uitest/src/main/java/com/vaadin/tests/fieldgroup/BasicPersonForm.java @@ -190,7 +190,7 @@ public class BasicPersonForm extends AbstractTestUIWithLog { } @Override - public String getDescription() { + protected String getTestDescription() { return "Basic Person Form"; } diff --git a/uitest/src/main/java/com/vaadin/tests/fieldgroup/DateForm.java b/uitest/src/main/java/com/vaadin/tests/fieldgroup/DateForm.java index 39a8d89153..964a87a614 100644 --- a/uitest/src/main/java/com/vaadin/tests/fieldgroup/DateForm.java +++ b/uitest/src/main/java/com/vaadin/tests/fieldgroup/DateForm.java @@ -139,7 +139,7 @@ public class DateForm extends AbstractTestUIWithLog { } @Override - public String getDescription() { + protected String getTestDescription() { return "Ensure FieldGroupFieldFactory supports Dates"; } diff --git a/uitest/src/main/java/com/vaadin/tests/themes/ThemeChangeFavicon.java b/uitest/src/main/java/com/vaadin/tests/themes/ThemeChangeFavicon.java index 152dc8f857..f670b2a601 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/ThemeChangeFavicon.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/ThemeChangeFavicon.java @@ -37,8 +37,7 @@ public class ThemeChangeFavicon extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "UI for testing that the favicon changes when changing themes"; } - } diff --git a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridCheckBoxDisplay.java b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridCheckBoxDisplay.java index dd144bdc58..3cd4ab4601 100644 --- a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridCheckBoxDisplay.java +++ b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridCheckBoxDisplay.java @@ -56,7 +56,7 @@ public class GridCheckBoxDisplay extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "Verify that checkbox state is correct for all items in editor"; } diff --git a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridDetailsWidth.java b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridDetailsWidth.java index c0fbc82af0..ee345773cc 100644 --- a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridDetailsWidth.java +++ b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridDetailsWidth.java @@ -84,7 +84,7 @@ public class GridDetailsWidth extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "Tests that Escalator will not set explicit widths to the TD element in a details row."; } diff --git a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridEditorMultiselect.java b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridEditorMultiselect.java index 047f1d7d84..5dad03339f 100644 --- a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridEditorMultiselect.java +++ b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridEditorMultiselect.java @@ -29,7 +29,7 @@ public class GridEditorMultiselect extends AbstractTestUI { } @Override - public String getDescription() { + protected String getTestDescription() { return "Grid Multiselect: Edit mode allows invalid selection"; } } diff --git a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridResizeHiddenColumn.java b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridResizeHiddenColumn.java index ca94035edc..20fad06c1f 100644 --- a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridResizeHiddenColumn.java +++ b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridResizeHiddenColumn.java @@ -56,9 +56,4 @@ public class GridResizeHiddenColumn extends AbstractTestUIWithLog { protected Integer getTicketNumber() { return 19826; } - - @Override - public String getDescription() { - return "Tests resize when columns with undefined width (-1) are hidden"; - } } diff --git a/uitest/src/main/webapp/WEB-INF/web.xml b/uitest/src/main/webapp/WEB-INF/web.xml index 99d2ced7a7..b96257b1e0 100644 --- a/uitest/src/main/webapp/WEB-INF/web.xml +++ b/uitest/src/main/webapp/WEB-INF/web.xml @@ -26,7 +26,7 @@ <servlet-class>com.vaadin.server.LegacyVaadinServlet</servlet-class> <init-param> <param-name>application</param-name> - <param-value>com.vaadin.tests.components.button.Buttons</param-value> + <param-value>com.vaadin.tests.components.button.ButtonHtml</param-value> </init-param> <async-supported>true</async-supported> </servlet> |