+++ /dev/null
-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;
- }
-
-}
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 {
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();
super.doCommand(commandName, command, value, data);
}
- @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());
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");
abstract protected void initializeComponents();
@Override
- protected void setup() {
+ protected void setup(VaadinRequest request) {
((SpacingHandler) getLayout()).setSpacing(true);
// Create Components
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) {
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();
}
-
}
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;
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();
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);
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()) {
if (itemCaption.equals(initialValue)) {
select.setValue(itemId);
}
-
}
select.setId("selectaction-" + caption);
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "Unable to dismiss a tooltip on touch devices";
}
-}
\ No newline at end of file
+}
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
}
@Override
- protected String getDescription() {
+ protected String getTestDescription() {
return "A generic test for Buttons in different configurations";
}
}
@Override
- protected String getDescription() {
+ protected String getTestDescription() {
return "A generic test for Buttons in different configurations";
}
}
}
@Override
- protected String getDescription() {
+ protected String getTestDescription() {
return "A generic test for CheckBoxes in different configurations";
}
}
@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.";
}
-
}
}
@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'.";
}
@Override
- protected String getDescription() {
+ protected String getTestDescription() {
return "A generic test for ComboBoxes in different configurations";
}
}
@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";
}
-
}
}
@Override
- protected String getDescription() {
+ protected String getTestDescription() {
return "A generic test for InlineDateFields in different configurations";
}
}
@Override
- protected String getDescription() {
+ protected String getTestDescription() {
return "A generic test for PopupDateFields in different configurations";
}
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "TOP_CENTER and TOP_RIGHT alignments should work in VerticalLayout";
}
-
}
}
@Override
- protected String getDescription() {
+ protected String getTestDescription() {
return "A generic test for Labels in different configurations";
}
}
@Override
- protected String getDescription() {
+ protected String getTestDescription() {
return "A generic test for Labels in different configurations";
}
@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);
addTestComponent(m);
}
- private Resource getIcon() {
+ private Resource getMenuIcon() {
return new ThemeResource("../runo/icons/16/user.png");
}
}
@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.";
}
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;
}
private void updateIcons(MenuItem item, int idx) {
if (iconInterval > 0 && idx % iconInterval == 0) {
- item.setIcon(getIcon());
+ item.setIcon(getMenuIcon());
} else {
item.setIcon(null);
}
private long iconCacheIndex = new Date().getTime();
- private Resource getIcon() {
+ private Resource getMenuIcon() {
String resourceID = null;
if (iconSize == 16) {
resourceID = "../runo/icons/16/user.png";
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "MenuItem's custom class names removed when hovering";
}
}
}
@Override
- protected String getDescription() {
+ protected String getTestDescription() {
return "A generic test for MenuBars in different configurations";
}
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "Bottom notification on Chrome goes up to top";
}
}
}
@Override
- protected String getDescription() {
+ protected String getTestDescription() {
return "Test case for disabled items in an OptionGroup";
}
}
}
@Override
- protected String getDescription() {
+ protected String getTestDescription() {
return "Test case for html items in an OptionGroup";
}
}
}
@Override
- protected String getDescription() {
+ protected String getTestDescription() {
return "A generic test for Labels in different configurations";
}
}
@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.";
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "Table with footer";
}
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "Tests the footer click handler";
}
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "Tests the header click listener";
}
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "Tests the header click listener";
}
}
@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
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
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "The header should be updated when toggling column header mode";
}
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "Table width and height changing to undefined doesn't update table size";
}
private Table table;
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "Columns should change between p1,p2,p3 and p1,p4,p3";
}
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "TabSheet should display re-shown tab if there's room for it";
}
}
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "Tests the behavior when there's a listener that always changes back to the first tab.";
}
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "Upload button should be disabled when upload "
+ "is set to readonly and/or disabled";
}
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;
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";
}
@Override
public OutputStream receiveUpload(String filename, String MIMEType) {
- getMainWindow().showNotification("Receiving upload");
+ Notification.show("Receiving upload");
return new ByteArrayOutputStream();
}
}
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;
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");
}
});
@Override
public OutputStream receiveUpload(String filename, String MIMEType) {
- getMainWindow().showNotification("Receiving upload");
+ Notification.show("Receiving upload");
return new ByteArrayOutputStream();
}
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;
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.";
}
l = new Label(getUploadcount());
addComponent(l);
- u.addListener(new Upload.StartedListener() {
+ u.addStartedListener(new Upload.StartedListener() {
@Override
public void uploadStarted(StartedEvent event) {
}
});
- 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());
}
});
}
@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);
}
}
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "Debug window shows Push version in info Tab.";
}
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "IFrame with a file is not shown in iOS";
}
}
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "Basic Person Form";
}
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "Ensure FieldGroupFieldFactory supports Dates";
}
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "UI for testing that the favicon changes when changing themes";
}
-
}
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "Verify that checkbox state is correct for all items in editor";
}
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "Tests that Escalator will not set explicit widths to the TD element in a details row.";
}
}
@Override
- public String getDescription() {
+ protected String getTestDescription() {
return "Grid Multiselect: Edit mode allows invalid selection";
}
}
protected Integer getTicketNumber() {
return 19826;
}
-
- @Override
- public String getDescription() {
- return "Tests resize when columns with undefined width (-1) are hidden";
- }
}
<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>
public void testMultipleServletConfiguration() throws Exception {
getDriver().get(getBaseURL() + "/embed1");
assertLabelText(
- "A generic test for Buttons in different configurations");
+ "Verify that Button HTML rendering works");
getDriver().get(getBaseURL() + "/embed2");
assertLabelText(
"Margins inside labels should not be allowed to collapse out of the label as it causes problems with layotus measuring the label.");
getDriver().get(getBaseURL() + "/embed1");
assertLabelText(
- "A generic test for Buttons in different configurations");
+ "Verify that Button HTML rendering works");
}
private void assertLabelText(String expected) {