diff options
author | John Ahlroos <john@vaadin.com> | 2012-08-20 16:31:25 +0300 |
---|---|---|
committer | John Ahlroos <john@vaadin.com> | 2012-08-20 16:31:25 +0300 |
commit | bd5876005947b830a151889a86203fd77a6d6022 (patch) | |
tree | 0fb7b9398d1c7d6a6adc284f9a44315f1bbcf918 /tests | |
parent | 7323ac889012ad62680abd466c77b270597256f7 (diff) | |
parent | 0dfdb151913a13e929a65c4dd8b5987c9edd06d5 (diff) | |
download | vaadin-framework-bd5876005947b830a151889a86203fd77a6d6022.tar.gz vaadin-framework-bd5876005947b830a151889a86203fd77a6d6022.zip |
Merge branch 'master' into layoutgraph
Diffstat (limited to 'tests')
16 files changed, 724 insertions, 49 deletions
diff --git a/tests/server-side/com/vaadin/data/util/sqlcontainer/ColumnPropertyTest.java b/tests/server-side/com/vaadin/data/util/sqlcontainer/ColumnPropertyTest.java index b9621d518a..09f620cc2a 100644 --- a/tests/server-side/com/vaadin/data/util/sqlcontainer/ColumnPropertyTest.java +++ b/tests/server-side/com/vaadin/data/util/sqlcontainer/ColumnPropertyTest.java @@ -4,46 +4,48 @@ import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; +import java.util.ArrayList; import java.util.Arrays; -import com.vaadin.data.Property.ReadOnlyException; -import com.vaadin.data.util.sqlcontainer.ColumnProperty.NotNullableException; -import com.vaadin.data.util.sqlcontainer.query.QueryDelegate; - import org.easymock.EasyMock; import org.junit.Assert; import org.junit.Test; +import com.vaadin.data.Property.ReadOnlyException; +import com.vaadin.data.util.sqlcontainer.ColumnProperty.NotNullableException; +import com.vaadin.data.util.sqlcontainer.query.QueryDelegate; + public class ColumnPropertyTest { @Test public void constructor_legalParameters_shouldSucceed() { ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - "Ville", String.class); + false, "Ville", String.class); Assert.assertNotNull(cp); } @Test(expected = IllegalArgumentException.class) public void constructor_missingPropertyId_shouldFail() { - new ColumnProperty(null, false, true, true, "Ville", String.class); + new ColumnProperty(null, false, true, true, false, "Ville", + String.class); } @Test(expected = IllegalArgumentException.class) public void constructor_missingType_shouldFail() { - new ColumnProperty("NAME", false, true, true, "Ville", null); + new ColumnProperty("NAME", false, true, true, false, "Ville", null); } @Test public void getValue_defaultValue_returnsVille() { ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - "Ville", String.class); + false, "Ville", String.class); Assert.assertEquals("Ville", cp.getValue()); } @Test public void setValue_readWriteNullable_returnsKalle() { ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - "Ville", String.class); + false, "Ville", String.class); SQLContainer container = EasyMock.createMock(SQLContainer.class); RowItem owner = new RowItem(container, new RowId(new Object[] { 1 }), Arrays.asList(cp)); @@ -57,7 +59,7 @@ public class ColumnPropertyTest { @Test(expected = ReadOnlyException.class) public void setValue_readOnlyNullable_shouldFail() { ColumnProperty cp = new ColumnProperty("NAME", true, true, true, - "Ville", String.class); + false, "Ville", String.class); SQLContainer container = EasyMock.createMock(SQLContainer.class); new RowItem(container, new RowId(new Object[] { 1 }), Arrays.asList(cp)); EasyMock.replay(container); @@ -68,7 +70,7 @@ public class ColumnPropertyTest { @Test public void setValue_readWriteNullable_nullShouldWork() { ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - "Ville", String.class); + false, "Ville", String.class); SQLContainer container = EasyMock.createMock(SQLContainer.class); RowItem owner = new RowItem(container, new RowId(new Object[] { 1 }), Arrays.asList(cp)); @@ -82,7 +84,7 @@ public class ColumnPropertyTest { @Test(expected = NotNullableException.class) public void setValue_readWriteNotNullable_nullShouldFail() { ColumnProperty cp = new ColumnProperty("NAME", false, true, false, - "Ville", String.class); + false, "Ville", String.class); SQLContainer container = EasyMock.createMock(SQLContainer.class); RowItem owner = new RowItem(container, new RowId(new Object[] { 1 }), Arrays.asList(cp)); @@ -96,28 +98,28 @@ public class ColumnPropertyTest { @Test public void getType_normal_returnsStringClass() { ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - "Ville", String.class); + false, "Ville", String.class); Assert.assertSame(String.class, cp.getType()); } @Test public void isReadOnly_readWriteNullable_returnsTrue() { ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - "Ville", String.class); + false, "Ville", String.class); Assert.assertFalse(cp.isReadOnly()); } @Test public void isReadOnly_readOnlyNullable_returnsTrue() { ColumnProperty cp = new ColumnProperty("NAME", true, true, true, - "Ville", String.class); + false, "Ville", String.class); Assert.assertTrue(cp.isReadOnly()); } @Test public void setReadOnly_readOnlyChangeAllowed_shouldSucceed() { ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - "Ville", String.class); + false, "Ville", String.class); cp.setReadOnly(true); Assert.assertTrue(cp.isReadOnly()); } @@ -125,7 +127,7 @@ public class ColumnPropertyTest { @Test public void setReadOnly_readOnlyChangeDisallowed_shouldFail() { ColumnProperty cp = new ColumnProperty("NAME", false, false, true, - "Ville", String.class); + false, "Ville", String.class); cp.setReadOnly(true); Assert.assertFalse(cp.isReadOnly()); } @@ -133,14 +135,14 @@ public class ColumnPropertyTest { @Test public void getPropertyId_normal_returnsNAME() { ColumnProperty cp = new ColumnProperty("NAME", false, false, true, - "Ville", String.class); + false, "Ville", String.class); Assert.assertEquals("NAME", cp.getPropertyId()); } @Test public void isModified_valueModified_returnsTrue() { ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - "Ville", String.class); + false, "Ville", String.class); SQLContainer container = EasyMock.createMock(SQLContainer.class); RowItem owner = new RowItem(container, new RowId(new Object[] { 1 }), Arrays.asList(cp)); @@ -155,14 +157,14 @@ public class ColumnPropertyTest { @Test public void isModified_valueNotModified_returnsFalse() { ColumnProperty cp = new ColumnProperty("NAME", false, false, true, - "Ville", String.class); + false, "Ville", String.class); Assert.assertFalse(cp.isModified()); } @Test public void setValue_nullOnNullable_shouldWork() { ColumnProperty cp = new ColumnProperty("NAME", false, true, true, - "asdf", String.class); + false, "asdf", String.class); SQLContainer container = EasyMock.createMock(SQLContainer.class); new RowItem(container, new RowId(new Object[] { 1 }), Arrays.asList(cp)); cp.setValue(null); @@ -171,8 +173,8 @@ public class ColumnPropertyTest { @Test public void setValue_resetTonullOnNullable_shouldWork() { - ColumnProperty cp = new ColumnProperty("NAME", false, true, true, null, - String.class); + ColumnProperty cp = new ColumnProperty("NAME", false, true, true, false, + null, String.class); SQLContainer container = EasyMock.createMock(SQLContainer.class); new RowItem(container, new RowId(new Object[] { 1 }), Arrays.asList(cp)); cp.setValue("asdf"); @@ -202,7 +204,7 @@ public class ColumnPropertyTest { } ColumnProperty property = new ColumnProperty("NAME", false, true, true, - "Ville", String.class); + false, "Ville", String.class); Statement statement = EasyMock.createNiceMock(Statement.class); EasyMock.replay(statement); @@ -229,4 +231,85 @@ public class ColumnPropertyTest { Assert.assertEquals("Kalle", container.value); Assert.assertTrue(container.modified); } + + @Test + public void versionColumnsShouldNotBeInValueMap_shouldReturnFalse() { + ColumnProperty property = new ColumnProperty("NAME", false, true, true, + false, "Ville", String.class); + property.setVersionColumn(true); + + Assert.assertFalse(property.isPersistent()); + } + + @Test + public void neverWritableColumnsShouldNotBeInValueMap_shouldReturnFalse() { + ColumnProperty property = new ColumnProperty("NAME", true, false, true, + false, "Ville", String.class); + + Assert.assertFalse(property.isPersistent()); + } + + @Test + public void writableColumnsShouldBeInValueMap_shouldReturnTrue() { + ColumnProperty property = new ColumnProperty("NAME", false, true, true, + false, "Ville", String.class); + + Assert.assertTrue(property.isPersistent()); + } + + @Test + public void writableButReadOnlyColumnsShouldNotBeInValueMap_shouldReturnFalse() { + ColumnProperty property = new ColumnProperty("NAME", true, true, true, + false, "Ville", String.class); + + Assert.assertFalse(property.isPersistent()); + } + + @Test + public void primKeysShouldBeRowIdentifiers_shouldReturnTrue() { + ColumnProperty property = new ColumnProperty("NAME", false, true, true, + true, "Ville", String.class); + + Assert.assertTrue(property.isRowIdentifier()); + } + + @Test + public void versionColumnsShouldBeRowIdentifiers_shouldReturnTrue() { + ColumnProperty property = new ColumnProperty("NAME", false, true, true, + false, "Ville", String.class); + property.setVersionColumn(true); + + Assert.assertTrue(property.isRowIdentifier()); + } + + @Test + public void nonPrimKeyOrVersionColumnsShouldBeNotRowIdentifiers_shouldReturnFalse() { + ColumnProperty property = new ColumnProperty("NAME", false, true, true, + false, "Ville", String.class); + + Assert.assertFalse(property.isRowIdentifier()); + } + + @Test + public void getOldValueShouldReturnPreviousValue_shouldReturnVille() { + ColumnProperty property = new ColumnProperty("NAME", false, true, true, + false, "Ville", String.class); + + // Here we really don't care about the container management, but in + // order to set the value for a column the owner (RowItem) must be set + // and to create the owner we must have a container... + ArrayList<ColumnProperty> properties = new ArrayList<ColumnProperty>(); + properties.add(property); + + SQLContainer container = EasyMock.createNiceMock(SQLContainer.class); + RowItem rowItem = new RowItem(container, new RowId(new Object[] { 1 }), + Arrays.asList(property)); + + property.setValue("Kalle"); + // Just check that the new value was actually set... + Assert.assertEquals("Kalle", property.getValue()); + // Assert that old value is the original value... + Assert.assertEquals("Ville", property.getOldValue()); + } + } diff --git a/tests/server-side/com/vaadin/data/util/sqlcontainer/query/TableQueryTest.java b/tests/server-side/com/vaadin/data/util/sqlcontainer/query/TableQueryTest.java index 657f06ae5e..e135894013 100644 --- a/tests/server-side/com/vaadin/data/util/sqlcontainer/query/TableQueryTest.java +++ b/tests/server-side/com/vaadin/data/util/sqlcontainer/query/TableQueryTest.java @@ -18,15 +18,13 @@ import com.vaadin.data.Container.Filter; import com.vaadin.data.util.filter.Compare.Equal; import com.vaadin.data.util.filter.Like; import com.vaadin.data.util.sqlcontainer.AllTests; +import com.vaadin.data.util.sqlcontainer.AllTests.DB; import com.vaadin.data.util.sqlcontainer.DataGenerator; import com.vaadin.data.util.sqlcontainer.OptimisticLockException; import com.vaadin.data.util.sqlcontainer.RowItem; import com.vaadin.data.util.sqlcontainer.SQLContainer; -import com.vaadin.data.util.sqlcontainer.AllTests.DB; import com.vaadin.data.util.sqlcontainer.connection.JDBCConnectionPool; import com.vaadin.data.util.sqlcontainer.connection.SimpleJDBCConnectionPool; -import com.vaadin.data.util.sqlcontainer.query.OrderBy; -import com.vaadin.data.util.sqlcontainer.query.TableQuery; import com.vaadin.data.util.sqlcontainer.query.generator.DefaultSQLGenerator; public class TableQueryTest { @@ -281,7 +279,9 @@ public class TableQueryTest { AllTests.sqlGen); try { tQuery.containsRowWithKey(new Object[] { null }); - } catch (SQLException e) { + org.junit.Assert + .fail("null should throw an IllegalArgumentException from StatementHelper"); + } catch (IllegalArgumentException e) { // We should now be able to reserve two connections connectionPool.reserveConnection(); connectionPool.reserveConnection(); diff --git a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.html b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.html index 64fe8e2952..2783ed2aa3 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.html +++ b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.html @@ -24,7 +24,7 @@ <tr> <td>screenCapture</td> <td></td> - <td></td> + <td>popup1-01-2011</td> </tr> <tr> <td>mouseClick</td> @@ -34,7 +34,7 @@ <tr> <td>screenCapture</td> <td></td> - <td></td> + <td>popup1-12-2010</td> </tr> <tr> <td>mouseClick</td> @@ -44,7 +44,7 @@ <tr> <td>screenCapture</td> <td></td> - <td></td> + <td>popup1-12-2009</td> </tr> <tr> <td>mouseClick</td> @@ -64,7 +64,7 @@ <tr> <td>screenCapture</td> <td></td> - <td></td> + <td>popup2-02-2010</td> </tr> <tr> <td>pressSpecialKey</td> @@ -79,7 +79,7 @@ <tr> <td>screenCapture</td> <td></td> - <td></td> + <td>popup2-03-2010</td> </tr> <tr> <td>pressSpecialKey</td> @@ -94,7 +94,7 @@ <tr> <td>screenCapture</td> <td></td> - <td></td> + <td>popup2-02-2010-again</td> </tr> <tr> <td>mouseClick</td> @@ -114,7 +114,7 @@ <tr> <td>screenCapture</td> <td></td> - <td></td> + <td>popup3-01-2010</td> </tr> <tr> <td>pressSpecialKey</td> @@ -124,14 +124,13 @@ <tr> <td>screenCapture</td> <td></td> - <td></td> + <td>popup3-01-2009</td> </tr> <tr> <td>mouseClick</td> <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VPopupCalendar[0]#popupButton</td> <td>10,8</td> </tr> - </tbody></table> </body> </html> diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedApplet.html b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedApplet.html new file mode 100644 index 0000000000..d8fb0593d1 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedApplet.html @@ -0,0 +1,36 @@ +<?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>EmbeddedClickListenerRelativeCoordinates</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">EmbeddedClickListenerRelativeCoordinates</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.embedded.EmbeddedApplet?restartApplication</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>with-applet</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedApplet::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>without-applet</td> +</tr> +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedApplet.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedApplet.java new file mode 100644 index 0000000000..1bb3e7abe2 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedApplet.java @@ -0,0 +1,43 @@ +package com.vaadin.tests.components.embedded; + +import com.vaadin.terminal.ExternalResource; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Embedded; +import com.vaadin.ui.Label; +import com.vaadin.ui.Window; + +public class EmbeddedApplet extends TestBase { + + @Override + protected String getDescription() { + return "The sub window should be shown on top of the embedded applet"; + } + + @Override + protected Integer getTicketNumber() { + return 8399; + } + + @Override + public void setup() { + final Embedded applet = new Embedded(); + applet.setType(Embedded.TYPE_BROWSER); + applet.setWidth("400px"); + applet.setHeight("300px"); + applet.setSource(new ExternalResource("/statictestfiles/applet.html")); + addComponent(applet); + + addComponent(new Button("Remove applet", new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + removeComponent(applet); + } + })); + + Window window = new Window("Testwindow"); + window.addComponent(new Label("I am inside the window")); + applet.getRoot().addWindow(window); + } +} diff --git a/tests/testbench/com/vaadin/tests/components/embedded/TestApplet.java b/tests/testbench/com/vaadin/tests/components/embedded/TestApplet.java new file mode 100644 index 0000000000..3cf7cf888b --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/embedded/TestApplet.java @@ -0,0 +1,11 @@ +package com.vaadin.tests.components.embedded; + +import java.applet.Applet; +import java.awt.Graphics; + +public class TestApplet extends Applet { + @Override + public void paint(Graphics g) { + g.drawString("Hello, I am an applet! Look at me!", 10, 20); + } +} diff --git a/tests/testbench/com/vaadin/tests/components/notification/CloseErrorNotificationWithEscape.html b/tests/testbench/com/vaadin/tests/components/notification/CloseErrorNotificationWithEscape.html index 288fd65c66..1ab75e1176 100644 --- a/tests/testbench/com/vaadin/tests/components/notification/CloseErrorNotificationWithEscape.html +++ b/tests/testbench/com/vaadin/tests/components/notification/CloseErrorNotificationWithEscape.html @@ -34,7 +34,7 @@ <tr> <td>keyDown</td> <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::Root/VNotification[0]/HTML[0]/domChild[0]</td> - <td>\\27</td> + <td>\27</td> </tr> <!-- Fade delay is 400 ms by default - VNotification --> <tr> diff --git a/tests/testbench/com/vaadin/tests/components/notification/SemiTransparentNotification.java b/tests/testbench/com/vaadin/tests/components/notification/SemiTransparentNotification.java new file mode 100755 index 0000000000..8fefac16a1 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/notification/SemiTransparentNotification.java @@ -0,0 +1,31 @@ +package com.vaadin.tests.components.notification; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.tests.util.LoremIpsum; +import com.vaadin.ui.Label; +import com.vaadin.ui.Notification; + +public class SemiTransparentNotification extends TestBase { + + @Override + protected void setup() { + Label l = new Label(LoremIpsum.get(10000)); + getLayout().setSizeFull(); + addComponent(l); + Notification.show(" This should be a <br/><b>SEMI-TRANSPARENT</b><br/> notification", + Notification.TYPE_WARNING_MESSAGE); + } + + @Override + protected String getDescription() { + // TODO Auto-generated method stub + return null; + } + + @Override + protected Integer getTicketNumber() { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/tests/testbench/com/vaadin/tests/components/notification/SemitransparentNotification.html b/tests/testbench/com/vaadin/tests/components/notification/SemitransparentNotification.html new file mode 100755 index 0000000000..f125b98ee1 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/notification/SemitransparentNotification.html @@ -0,0 +1,27 @@ +<?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>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.notification.SemiTransparentNotification</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>semitransparent-warning</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewClickShortcut.html b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewClickShortcut.html new file mode 100644 index 0000000000..c52bfa634d --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewClickShortcut.html @@ -0,0 +1,152 @@ +<?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:8068/" /> +<title>PopupViewClickShortcut</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">PopupViewClickShortcut</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.popupview.PopupViewClickShortcut?restartApplication=</td> + <td></td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::</td> + <td>ctrl alt M</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[5]/domChild[0]/domChild[0]</td> + <td>added 5</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::PID_SLog_row_0</td> + <td>1. Submitted from Main window</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VPopupView[0]</td> + <td>57,6</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::</td> + <td>ctrl alt P</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VPopupView[0]/VPopupView$CustomPopup[0]/VCaptionWrapper[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]</td> + <td>159,142</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VPopupView[0]/VPopupView$CustomPopup[0]/VCaptionWrapper[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]</td> + <td>ctrl alt P</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VPopupView[0]/VPopupView$CustomPopup[0]/VCaptionWrapper[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[6]/domChild[0]/domChild[0]</td> + <td>added 6</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::PID_SLog_row_1</td> + <td>2. Submitted from Popup</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::PID_SLog_row_0</td> + <td>3. Submitted from Popup</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]</td> + <td>83,151</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]</td> + <td>ctrl alt S</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[5]/domChild[0]/domChild[0]</td> + <td>added 5</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::PID_SLog_row_0</td> + <td>4. Submitted from Subwindow</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VPopupView[0]</td> + <td>76,4</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::/VWindow[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[0]</td> + <td>ctrl alt U</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VPopupView[0]/VPopupView$CustomPopup[0]/VCaptionWrapper[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[5]/domChild[0]/domChild[0]</td> + <td>132,11</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VPopupView[0]/VPopupView$CustomPopup[0]/VCaptionWrapper[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]</td> + <td>ctrl alt U</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VPopupView[0]/VPopupView$CustomPopup[0]/VCaptionWrapper[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[6]/domChild[0]/domChild[0]</td> + <td>added 6</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::PID_SLog_row_1</td> + <td>5. Submitted from Subwindow popup</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::PID_SLog_row_0</td> + <td>6. Submitted from Subwindow popup</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::/VVerticalLayout[0]/domChild[0]/domChild[1]</td> + <td>279,482</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::</td> + <td>ctrl alt P</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::</td> + <td>ctrl alt U</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::</td> + <td>ctrl alt S</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentspopupviewPopupViewClickShortcut::PID_SLog_row_0</td> + <td>6. Submitted from Subwindow popup</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewClickShortcut.java b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewClickShortcut.java index 6461d10277..ba4fe93b68 100644 --- a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewClickShortcut.java +++ b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewClickShortcut.java @@ -46,17 +46,17 @@ public class PopupViewClickShortcut extends TestBase { l.setWidth(null); Button b = new Button("Submit " + caption + " (Ctrl+Alt+" - + String.valueOf(Character.toChars(keyCode)) + ")", - new Button.ClickListener() { - private int i = 5; + + (char) keyCode + ")", new Button.ClickListener() { + private int i = 5; + + @Override + public void buttonClick(ClickEvent event) { + log.log("Submitted from " + + event.getButton().getParent().getCaption()); + t.addItem(new String[] { "added " + i++ }, i); + } + }); - @Override - public void buttonClick(ClickEvent event) { - log.log("Submitted from " - + event.getButton().getParent().getCaption()); - t.addItem(new String[] { "added " + i++ }, i); - } - }); b.setClickShortcut(keyCode, ModifierKey.CTRL, ModifierKey.ALT); l.addComponent(t); diff --git a/tests/testbench/com/vaadin/tests/components/table/EmptyTable.html b/tests/testbench/com/vaadin/tests/components/table/EmptyTable.html index 58f26cf607..7196771f56 100644 --- a/tests/testbench/com/vaadin/tests/components/table/EmptyTable.html +++ b/tests/testbench/com/vaadin/tests/components/table/EmptyTable.html @@ -65,7 +65,7 @@ <tr> <td>screenCapture</td> <td></td> - <td>empty-table</td> + <td>empty-table-after-reload</td> </tr> </tbody></table> </body> diff --git a/tests/testbench/com/vaadin/tests/components/table/HorizontalScrollWithNoRows.html b/tests/testbench/com/vaadin/tests/components/table/HorizontalScrollWithNoRows.html new file mode 100644 index 0000000000..98629252d9 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/HorizontalScrollWithNoRows.html @@ -0,0 +1,86 @@ +<?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>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.table.Tables?restartApplication</td> + <td></td> +</tr> +<!--Remove all rows--> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td> + <td>23,8</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item5</td> + <td>33,5</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[1]/VMenuBar[0]#item1</td> + <td>50,8</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[2]/VMenuBar[0]#item0</td> + <td>54,10</td> +</tr> +<!--Remove log--> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item1</td> + <td>28,9</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item0</td> + <td>29,5</td> +</tr> +<!--Resize column, should get scrollbar--> +<tr> + <td>drag</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>0,7</td> +</tr> +<tr> + <td>drop</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>150,7</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>1-wide-header</td> +</tr> +<!--Resize back, scrollbar should disappear--> +<tr> + <td>drag</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>0,7</td> +</tr> +<!-- Overcompensate by 2px because of off-by-one bug in testbench --> +<tr> + <td>drop</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>-152,7</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>2-narrow-header</td> +</tr> +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/textarea/TextAreaMaxLength.html b/tests/testbench/com/vaadin/tests/components/textarea/TextAreaMaxLength.html new file mode 100755 index 0000000000..5fe43b7b7a --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/textarea/TextAreaMaxLength.html @@ -0,0 +1,53 @@ +<?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://arturwin.office.itmill.com:9999/" /> +<title>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.textarea.TextAreaTest?debug&restartApplication</td> + <td></td> +</tr> +<!--max length 5--> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstextareaTextAreaTest::PID_Smenu#item0</td> + <td>20,9</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstextareaTextAreaTest::Root/VOverlay[0]/VMenuBar[0]#item5</td> + <td>43,8</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstextareaTextAreaTest::Root/VOverlay[1]/VMenuBar[0]#item2</td> + <td>70,13</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstextareaTextAreaTest::Root/VOverlay[2]/VMenuBar[0]#item5</td> + <td>40,9</td> +</tr> +<tr> + <td>enterCharacter</td> + <td>vaadin=runcomvaadintestscomponentstextareaTextAreaTest::PID_StestComponent</td> + <td>0123456789</td> +</tr> +<tr> + <td>assertValue</td> + <td>vaadin=runcomvaadintestscomponentstextareaTextAreaTest::PID_StestComponent</td> + <td>01234</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeItemClickAndValueChange.html b/tests/testbench/com/vaadin/tests/components/tree/TreeItemClickAndValueChange.html new file mode 100644 index 0000000000..bf83a1acdb --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/tree/TreeItemClickAndValueChange.html @@ -0,0 +1,82 @@ +<?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>TreeItemClickAndValueChange</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">TreeItemClickAndValueChange</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/Trees?restartApplication</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runTrees::PID_Smenu#item0</td> + <td>19,8</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runTrees::Root/VOverlay[0]/VMenuBar[0]#item3</td> + <td>23,7</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runTrees::Root/VOverlay[1]/VMenuBar[0]#item0</td> + <td>38,6</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runTrees::PID_Smenu#item0</td> + <td>52,12</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runTrees::Root/VOverlay[0]/VMenuBar[0]#item3</td> + <td>53,12</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runTrees::Root/VOverlay[1]/VMenuBar[0]#item4</td> + <td>50,4</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runTrees::PID_StestComponent#n[0]</td> + <td>22,9</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runTrees::PID_StestComponent#n[1]</td> + <td>20,6</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runTrees::PID_SLog_row_0</td> + <td>5. ValueChangeEvent, new value: '[Item 2]'</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runTrees::PID_SLog_row_1</td> + <td>4. left click on source: [Item 1], client: [*];, relative: [-1,-1], itemId: Item 2, propertyId: null</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runTrees::PID_SLog_row_2</td> + <td>3. ValueChangeEvent, new value: '[Item 1]'</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runTrees::PID_SLog_row_3</td> + <td>2. left click on source: [], client: [*];, relative: [-1,-1], itemId: Item 1, propertyId: null</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/treetable/AddItemToEmptyTreeTable.html b/tests/testbench/com/vaadin/tests/components/treetable/AddItemToEmptyTreeTable.html new file mode 100755 index 0000000000..15dc0e074d --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/treetable/AddItemToEmptyTreeTable.html @@ -0,0 +1,72 @@ +<?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>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.treetable.TreeTableTest?restartApplication</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_Smenu#item0</td> + <td>38,10</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[0]/VMenuBar[0]#item5</td> + <td>52,6</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[1]/VMenuBar[0]#item1</td> + <td>68,8</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[2]/VMenuBar[0]#item0</td> + <td>12,4</td> +</tr> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.treetable.TreeTableTest</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_Smenu#item0</td> + <td>33,7</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[0]/VMenuBar[0]#item5</td> + <td>52,9</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[1]/VMenuBar[0]#item1</td> + <td>39,5</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[2]/VMenuBar[0]#item1</td> + <td>23,3</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>item-added-to-empty-treetable</td> +</tr> + +</tbody></table> +</body> +</html> |