diff options
author | Leif Åstrand <leif@vaadin.com> | 2013-05-17 16:14:27 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2013-05-17 16:14:27 +0300 |
commit | 73a50dbf002b381411a7c6ca1d6b4e59a93bbe0c (patch) | |
tree | 49dfcde7194cf82cc3e96519170decaf12051992 /uitest | |
parent | 5a9303869ce6912afcb158f6b75b3202d77a40a1 (diff) | |
parent | 0c8edf1ff0502070d92dc6d8ef5af304d7570934 (diff) | |
download | vaadin-framework-73a50dbf002b381411a7c6ca1d6b4e59a93bbe0c.tar.gz vaadin-framework-73a50dbf002b381411a7c6ca1d6b4e59a93bbe0c.zip |
Merge changes from origin/7.0
1a6200e Merge #6880 test from 6.8; fix itself is not needed in Vaadin 7
67696f3 SQLContainer.indexOfId() also searches backwards (#11849, #10376)
611e5f9 Test for #11267 adapted from 6.8.
609acd1 Fixed table height rendering in Android 2.3 #11331
63dd611 Centers VOverlays in visual viewport on iOS, Android, fixes #11614
5a33d7d Test for #11775
0c8edf1 Avoid marking AbstractField dirty in primitive getters (#11201)
Change-Id: I7437e0b249c1a95372d6f349e9d6336fb85f08a4
Diffstat (limited to 'uitest')
8 files changed, 411 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxBorder.html b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxBorder.html new file mode 100644 index 0000000000..7e7bb7722d --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxBorder.html @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="http://localhost:8888/" /> +<title>ComboBoxBorder</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">ComboBoxBorder</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/ComboBoxBorder?restartApplication</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runComboBoxBorder::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]#textbox</td> + <td>53,10</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runComboBoxBorder::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]#textbox</td> + <td>down</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runComboBoxBorder::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]#textbox</td> + <td>down</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runComboBoxBorder::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]#textbox</td> + <td>down</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runComboBoxBorder::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]#textbox</td> + <td>enter</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td></td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxBorder.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxBorder.java new file mode 100644 index 0000000000..731e23188e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxBorder.java @@ -0,0 +1,43 @@ +package com.vaadin.tests.components.combobox; + +import java.util.Arrays; + +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.server.UserError; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.ComboBox; + +public class ComboBoxBorder extends TestBase { + + @Override + protected void setup() { + setTheme("tests-tickets"); + + final ComboBox cb = new ComboBox("All errors", Arrays.asList("Error", + "Error 2")); + cb.setStyleName("ComboBoxBorder"); + cb.setImmediate(true); + cb.setWidth("200px"); // must have with to reproduce + + cb.addListener(new ValueChangeListener() { + public void valueChange(ValueChangeEvent event) { + cb.setComponentError(new UserError("Error")); + } + }); + + addComponent(cb); + + } + + @Override + protected String getDescription() { + return "Adding a border as a result of styleName change should not break the ComboBox"; + } + + @Override + protected Integer getTicketNumber() { + return 11267; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperInPanel.html b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperInPanel.html new file mode 100644 index 0000000000..e98c8bd41c --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperInPanel.html @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="" /> +<title>DragAndDropWrapperInPanel</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">DragAndDropWrapperInPanel</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.draganddropwrapper.DragAndDropWrapperInPanel?restartApplication</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>no-scrollbars</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragAndDropWrapperInPanel::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>resized-no-scrollbars</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperInPanel.java b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperInPanel.java new file mode 100644 index 0000000000..6a680abdf0 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperInPanel.java @@ -0,0 +1,79 @@ +/* + * Copyright 2012 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.tests.components.draganddropwrapper; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Component; +import com.vaadin.ui.DragAndDropWrapper; +import com.vaadin.ui.Label; +import com.vaadin.ui.Panel; +import com.vaadin.ui.TextArea; + +public class DragAndDropWrapperInPanel extends TestBase { + + @Override + protected void setup() { + + addComponent(new Button("Click to resize", new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + for (int i = 1; i < getLayout().getComponentCount(); ++i) { + Component c = getLayout().getComponent(i); + c.setWidth("400px"); + c.setHeight("200px"); + } + } + })); + + Component content; + + content = new Button("Undefined-sized Button"); + content.setSizeUndefined(); + addDnDPanel(content); + + content = new Label("Full-sized Label"); + content.setSizeFull(); + addDnDPanel(content); + + content = new TextArea(null, "200x100px TextArea"); + content.setWidth("200px"); + content.setHeight("100px"); + addDnDPanel(content); + } + + @Override + protected String getDescription() { + return "A full-sized DragAndDropWrapper causes scrollbars inside Panel"; + } + + @Override + protected Integer getTicketNumber() { + return 6880; + } + + private void addDnDPanel(Component content) { + Panel panel = new Panel(); + panel.setSizeUndefined(); + panel.setWidth("300px"); + panel.setHeight("150px"); + DragAndDropWrapper dndWrapper = new DragAndDropWrapper(content); + dndWrapper.setSizeFull(); + panel.setContent(dndWrapper); + addComponent(panel); + } +} diff --git a/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutWithNonIntegerWidth.java b/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutWithNonIntegerWidth.java new file mode 100644 index 0000000000..8312b15ba7 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutWithNonIntegerWidth.java @@ -0,0 +1,53 @@ +package com.vaadin.tests.components.gridlayout; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.GridLayout; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.Panel; +import com.vaadin.ui.VerticalLayout; + +/** + * Main UI class + */ +@SuppressWarnings("serial") +public class GridLayoutWithNonIntegerWidth extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + Panel p1 = new Panel("Panel with GridLayout"); + GridLayout grid = new GridLayout(1, 1, new Label("A")); + grid.setWidth(100, Unit.PERCENTAGE); + p1.setContent(grid); + p1.setWidth("354.390625px"); + + Panel p2 = new Panel("Panel with HorizontalLayout"); + HorizontalLayout hl = new HorizontalLayout(new Label("A")); + hl.setWidth(100, Unit.PERCENTAGE); + p2.setContent(hl); + p2.setWidth("354.390625px"); + + setContent(new VerticalLayout(p1, p2)); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "Neither of the panels should contain scrollbars"; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 11775; + } +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/window/CenteredInVisualViewport.java b/uitest/src/com/vaadin/tests/components/window/CenteredInVisualViewport.java new file mode 100644 index 0000000000..428b2ae3f9 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/window/CenteredInVisualViewport.java @@ -0,0 +1,66 @@ +package com.vaadin.tests.components.window; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.GridLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.Window; + +public class CenteredInVisualViewport extends TestBase { + + @Override + protected String getDescription() { + return "Should open centered, even if zoomed in on one button (e.g zoom in iOS)"; + } + + @Override + protected Integer getTicketNumber() { + return 11614; + } + + @Override + protected void setup() { + GridLayout layout = new GridLayout(3, 3); + layout.setWidth("1000px"); + layout.setHeight("1000px"); + addComponent(layout); + + Button b = new Button("Open", new Button.ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + Window centered = new Window("A window", new Label( + "Centered window")); + centered.center(); + getMainWindow().addWindow(centered); + } + }); + layout.addComponent(b, 0, 0); + + b = new Button("Open", new Button.ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + Window centered = new Window("A window", new Label( + "Centered window")); + centered.center(); + getMainWindow().addWindow(centered); + } + }); + layout.addComponent(b, 1, 1); + + b = new Button("Open", new Button.ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + Window centered = new Window("A window", new Label( + "Centered window")); + centered.center(); + getMainWindow().addWindow(centered); + } + }); + layout.addComponent(b, 2, 2); + + } +} diff --git a/uitest/src/com/vaadin/tests/containers/sqlcontainer/DatabaseHelper.java b/uitest/src/com/vaadin/tests/containers/sqlcontainer/DatabaseHelper.java index 287d772901..7e95a41742 100644 --- a/uitest/src/com/vaadin/tests/containers/sqlcontainer/DatabaseHelper.java +++ b/uitest/src/com/vaadin/tests/containers/sqlcontainer/DatabaseHelper.java @@ -15,6 +15,8 @@ class DatabaseHelper { private JDBCConnectionPool connectionPool = null; private SQLContainer testContainer = null; private static final String TABLENAME = "testtable"; + private SQLContainer largeContainer = null; + private static final String LARGE_TABLENAME = "largetable"; public DatabaseHelper() { initConnectionPool(); @@ -32,24 +34,42 @@ class DatabaseHelper { // Will fail if table doesn't exist, which is OK. conn.rollback(); } + try { + statement.execute("drop table " + LARGE_TABLENAME); + } catch (SQLException e) { + // Will fail if table doesn't exist, which is OK. + conn.rollback(); + } switch (SQLTestsConstants.db) { case HSQLDB: statement .execute("create table " + TABLENAME + " (id integer GENERATED BY DEFAULT AS IDENTITY, field1 varchar(100), field2 boolean, primary key(id))"); + statement + .execute("create table " + + LARGE_TABLENAME + + " (id integer GENERATED BY DEFAULT AS IDENTITY, field1 varchar(100), primary key(id))"); break; case MYSQL: statement .execute("create table " + TABLENAME + " (id integer auto_increment not null, field1 varchar(100), field2 boolean, primary key(id))"); + statement + .execute("create table " + + LARGE_TABLENAME + + " (id integer auto_increment not null, field1 varchar(100), primary key(id))"); break; case POSTGRESQL: statement .execute("create table " + TABLENAME + " (\"id\" serial primary key, \"field1\" varchar(100), \"field2\" boolean)"); + statement + .execute("create table " + + LARGE_TABLENAME + + " (\"id\" serial primary key, \"field1\" varchar(100))"); break; } statement.executeUpdate("insert into " + TABLENAME @@ -58,6 +78,12 @@ class DatabaseHelper { + " values(default, 'Ville', 'true')"); statement.executeUpdate("insert into " + TABLENAME + " values(default, 'Jussi', 'true')"); + + for (int i = 0; i < 400; ++i) { + statement.executeUpdate("insert into " + LARGE_TABLENAME + + " values(default, 'User " + i + "')"); + } + statement.close(); conn.commit(); connectionPool.releaseConnection(conn); @@ -71,6 +97,10 @@ class DatabaseHelper { TableQuery q1 = new TableQuery(TABLENAME, connectionPool); q1.setVersionColumn("id"); testContainer = new SQLContainer(q1); + + TableQuery q2 = new TableQuery(LARGE_TABLENAME, connectionPool); + q2.setVersionColumn("id"); + largeContainer = new SQLContainer(q2); } catch (SQLException e) { e.printStackTrace(); } @@ -89,4 +119,8 @@ class DatabaseHelper { public SQLContainer getTestContainer() { return testContainer; } + + public SQLContainer getLargeContainer() { + return largeContainer; + } }
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/containers/sqlcontainer/SqlcontainertableApplication.java b/uitest/src/com/vaadin/tests/containers/sqlcontainer/SqlcontainertableApplication.java new file mode 100644 index 0000000000..8d4f1c5842 --- /dev/null +++ b/uitest/src/com/vaadin/tests/containers/sqlcontainer/SqlcontainertableApplication.java @@ -0,0 +1,47 @@ +package com.vaadin.tests.containers.sqlcontainer; + +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.server.LegacyApplication; +import com.vaadin.ui.HorizontalSplitPanel; +import com.vaadin.ui.Label; +import com.vaadin.ui.LegacyWindow; +import com.vaadin.ui.Table; + +public class SqlcontainertableApplication extends LegacyApplication { + private LegacyWindow mainWindow; + private Table table; + private HorizontalSplitPanel panel; + private Label label = new Label(); + + @Override + public void init() { + mainWindow = new LegacyWindow("SQLContainer Test"); + setMainWindow(mainWindow); + mainWindow.getContent().setSizeFull(); + + panel = new HorizontalSplitPanel(); + panel.setSecondComponent(label); + + final DatabaseHelper helper = new DatabaseHelper(); + table = new Table(); + table.setSizeFull(); + table.setContainerDataSource(helper.getLargeContainer()); + table.setSelectable(true); + table.setImmediate(true); + table.setMultiSelect(true); + table.addValueChangeListener(new ValueChangeListener() { + @Override + public void valueChange(ValueChangeEvent event) { + label.setValue(table.getValue().toString()); + } + }); + + panel.setSizeFull(); + panel.addComponent(table); + + mainWindow.addComponent(panel); + + } + +}
\ No newline at end of file |