diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-09-17 09:44:03 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-09-17 09:44:03 +0300 |
commit | 800efdee9d891fb07343b18bca7cd543ffebb615 (patch) | |
tree | c4a097ec5d8e6a5a8bc726f1e69f11fc533c8660 /uitest | |
parent | 7353c3698181bd4ccd0d5d890745ad13ff544ee6 (diff) | |
download | vaadin-framework-800efdee9d891fb07343b18bca7cd543ffebb615.tar.gz vaadin-framework-800efdee9d891fb07343b18bca7cd543ffebb615.zip |
Include getWidget return type even if createWidget is defined (#9561)
Diffstat (limited to 'uitest')
5 files changed, 152 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/serialization/DelegateWithoutStateClass.html b/uitest/src/com/vaadin/tests/serialization/DelegateWithoutStateClass.html new file mode 100644 index 0000000000..2ee77b2d9f --- /dev/null +++ b/uitest/src/com/vaadin/tests/serialization/DelegateWithoutStateClass.html @@ -0,0 +1,26 @@ +<?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://192.168.2.41:8888/" /> +<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.serialization.DelegateWithoutStateClassTest?restartApplication</td> + <td></td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestsserializationDelegateWithoutStateClassTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VExtendedTextArea[0]@rows</td> + <td>10</td> +</tr> +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/serialization/DelegateWithoutStateClassTest.java b/uitest/src/com/vaadin/tests/serialization/DelegateWithoutStateClassTest.java new file mode 100644 index 0000000000..29975dda91 --- /dev/null +++ b/uitest/src/com/vaadin/tests/serialization/DelegateWithoutStateClassTest.java @@ -0,0 +1,45 @@ +/* + * Copyright 2011 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.serialization; + +import com.vaadin.annotations.Widgetset; +import com.vaadin.server.WrappedRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.tests.widgetset.TestingWidgetSet; +import com.vaadin.tests.widgetset.server.DelegateWithoutStateClassComponent; + +@Widgetset(TestingWidgetSet.NAME) +public class DelegateWithoutStateClassTest extends AbstractTestUI { + + @Override + protected void setup(WrappedRequest request) { + DelegateWithoutStateClassComponent c = new DelegateWithoutStateClassComponent(); + c.setRows(10); + addComponent(c); + } + + @Override + protected String getTestDescription() { + return "The height of the text area should be 10 rows if @DelegateToWidget works properly for widget subclasses even if there is no state subclass."; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(9561); + } + +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/DelegateWithoutStateClassConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/DelegateWithoutStateClassConnector.java new file mode 100644 index 0000000000..647e84f059 --- /dev/null +++ b/uitest/src/com/vaadin/tests/widgetset/client/DelegateWithoutStateClassConnector.java @@ -0,0 +1,35 @@ +/* + * Copyright 2011 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.widgetset.client; + +import com.google.gwt.core.shared.GWT; +import com.vaadin.client.ui.textarea.TextAreaConnector; +import com.vaadin.shared.ui.Connect; +import com.vaadin.tests.widgetset.server.DelegateWithoutStateClassComponent; + +@Connect(DelegateWithoutStateClassComponent.class) +public class DelegateWithoutStateClassConnector extends TextAreaConnector { + @Override + public VExtendedTextArea getWidget() { + return (VExtendedTextArea) super.getWidget(); + } + + @Override + protected VExtendedTextArea createWidget() { + return GWT.create(VExtendedTextArea.class); + } +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/VExtendedTextArea.java b/uitest/src/com/vaadin/tests/widgetset/client/VExtendedTextArea.java new file mode 100644 index 0000000000..704b9cc6d9 --- /dev/null +++ b/uitest/src/com/vaadin/tests/widgetset/client/VExtendedTextArea.java @@ -0,0 +1,23 @@ +/* + * Copyright 2011 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.widgetset.client; + +import com.vaadin.client.ui.textarea.VTextArea; + +public class VExtendedTextArea extends VTextArea { + +} diff --git a/uitest/src/com/vaadin/tests/widgetset/server/DelegateWithoutStateClassComponent.java b/uitest/src/com/vaadin/tests/widgetset/server/DelegateWithoutStateClassComponent.java new file mode 100644 index 0000000000..a0609e5a31 --- /dev/null +++ b/uitest/src/com/vaadin/tests/widgetset/server/DelegateWithoutStateClassComponent.java @@ -0,0 +1,23 @@ +/* + * Copyright 2011 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.widgetset.server; + +import com.vaadin.ui.TextArea; + +public class DelegateWithoutStateClassComponent extends TextArea { + +} |