summaryrefslogtreecommitdiffstats
path: root/tests/testbench/com
diff options
context:
space:
mode:
authorJouni Koivuviita <jouni@vaadin.com>2012-08-20 11:54:09 +0300
committerJouni Koivuviita <jouni@vaadin.com>2012-08-20 11:54:09 +0300
commit00d45c6036c876686eb3c1305aa07f748ebc8365 (patch)
tree023e2e085e036927ae41158a9a2a2300e650f4a1 /tests/testbench/com
parent450e62cb68aa9d16851cedbc87c3c4769cf2a820 (diff)
parentc9689846a8ba1254fb51c164cee6c3c157740eac (diff)
downloadvaadin-framework-00d45c6036c876686eb3c1305aa07f748ebc8365.tar.gz
vaadin-framework-00d45c6036c876686eb3c1305aa07f748ebc8365.zip
Merge master
Diffstat (limited to 'tests/testbench/com')
-rw-r--r--tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java44
-rw-r--r--tests/testbench/com/vaadin/tests/serialization/SerializerTest.html40
-rw-r--r--tests/testbench/com/vaadin/tests/serialization/SerializerTest.java12
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/DummyLabelConnector.java50
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/LabelState.java41
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/SerializerTestConnector.java11
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/SerializerTestRpc.java3
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/server/DummyLabel.java38
8 files changed, 221 insertions, 18 deletions
diff --git a/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java b/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java
new file mode 100644
index 0000000000..6a873a6be3
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java
@@ -0,0 +1,44 @@
+/*
+ * 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.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.tests.widgetset.server.DummyLabel;
+import com.vaadin.ui.Label;
+
+@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
+public class SerializerNamespaceTest extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ addComponent(new Label("The real label"));
+ addComponent(new DummyLabel("The dummy label"));
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Using connectors with different state classes having the same simple name should not cause any clietn-side exceptions";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(8683);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/serialization/SerializerTest.html b/tests/testbench/com/vaadin/tests/serialization/SerializerTest.html
index 3d52356cab..4417fabf14 100644
--- a/tests/testbench/com/vaadin/tests/serialization/SerializerTest.html
+++ b/tests/testbench/com/vaadin/tests/serialization/SerializerTest.html
@@ -18,90 +18,94 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[16]</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[17]</td>
<td>1. sendBoolean: false, false, [false, false, true, false, true, true]</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[15]</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[16]</td>
<td>2. sendByte: 5, -12, [3, 1, 2]</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[14]</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[15]</td>
<td>3. sendChar: Å, ∫, [a, b, c, d]</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[13]</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[14]</td>
<td>4. sendInt: 2, 5, [2147483647, 0]</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[12]</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[13]</td>
<td>5. sendLong: -57841235865, 577431841358, [57, 0]</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[11]</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[12]</td>
<td>6. sendFloat: 1.0000001, 3.14159, [-12.0, 0.0, 57.0]</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[10]</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[11]</td>
<td>7. sendDouble: 0.423310825130748, 5.859874482048838, [2.0, 1.7976931348623157E308, 4.9E-324]</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[9]</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[10]</td>
<td>8. sendString: Taegghiiiinnrsssstt‡</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[8]</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[9]</td>
<td>9. sendConnector: com.vaadin.tests.widgetset.server.SerializerTestExtension</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[7]</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[8]</td>
<td>10. sendBean: ComplexTestBean [innerBean1=SimpleTestBean(1), innerBean2=SimpleTestBean(3), innerBeanCollection=[SimpleTestBean(6), SimpleTestBean(0)], privimite=6], SimpleTestBean(0), [SimpleTestBean(7)]</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[6]</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[7]</td>
<td>11. sendNull: null, Not null</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[5]</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[6]</td>
<td>12. sendNestedArray: [[7, 5]], [[SimpleTestBean(2)], [SimpleTestBean(4)]]</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[4]</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[5]</td>
<td>13. sendList: [-234, 5, 8], class com.vaadin.tests.widgetset.server.SerializerTestExtension, class com.vaadin.tests.serialization.SerializerTest, [SimpleTestBean(-568), SimpleTestBean(234)]</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[3]</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[4]</td>
<td>14. sendArrayList: [[2], [2]], [[2, 1], [2, 3]], [[SimpleTestBean(7)]]</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[2]</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[3]</td>
<td>15. sendSet: [-12, -7, -4], class com.vaadin.tests.serialization.SerializerTest, [SimpleTestBean(2), SimpleTestBean(3)]</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[1]</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[2]</td>
<td>16. sendMap: {a=null}, [com.vaadin.tests.widgetset.server.SerializerTestExtension=false], [2=com.vaadin.tests.widgetset.server.SerializerTestExtension], {SimpleTestBean(4)=SimpleTestBean(-4), SimpleTestBean(-5)=SimpleTestBean(5)}</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[1]</td>
<td>17. sendWrappedGenerics: {[SimpleTestBean(1)]={1=[SimpleTestBean(42)]}}</td>
</tr>
-
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]</td>
+ <td>18. sendEnum: PREFORMATTED, [XHTML, RAW], [PREFORMATTED, XML]</td>
+</tr>
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java b/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java
index da4b5dd7d9..a301ecf828 100644
--- a/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java
+++ b/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java
@@ -28,6 +28,7 @@ import java.util.Set;
import com.vaadin.annotations.Widgetset;
import com.vaadin.shared.Connector;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.WrappedRequest;
import com.vaadin.tests.components.AbstractTestRoot;
import com.vaadin.tests.util.Log;
@@ -122,6 +123,10 @@ public class SerializerTest extends AbstractTestRoot {
}
});
+ rpc.sendEnum(ContentMode.TEXT, new ContentMode[] {
+ ContentMode.PREFORMATTED, ContentMode.XML },
+ Arrays.asList(ContentMode.XHTML, ContentMode.RAW));
+
testExtension.registerRpc(new SerializerTestRpc() {
@Override
public void sendBoolean(boolean value, Boolean boxedValue,
@@ -288,6 +293,13 @@ public class SerializerTest extends AbstractTestRoot {
log.log("sendWrappedGenerics: " + generics.toString());
}
+ @Override
+ public void sendEnum(ContentMode contentMode, ContentMode[] array,
+ List<ContentMode> list) {
+ log.log("sendEnum: " + contentMode + ", "
+ + Arrays.toString(array) + ", " + list);
+ }
+
});
}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/DummyLabelConnector.java b/tests/testbench/com/vaadin/tests/widgetset/client/DummyLabelConnector.java
new file mode 100644
index 0000000000..bf3a472b33
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/DummyLabelConnector.java
@@ -0,0 +1,50 @@
+/*
+ * 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.shared.ui.Connect;
+import com.vaadin.terminal.gwt.client.communication.StateChangeEvent;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
+import com.vaadin.terminal.gwt.client.ui.label.VLabel;
+import com.vaadin.tests.widgetset.server.DummyLabel;
+
+/**
+ * Dummy connector just to cause {@link LabelState} to be used to test #8683
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+@Connect(DummyLabel.class)
+public class DummyLabelConnector extends AbstractComponentConnector {
+ @Override
+ public LabelState getState() {
+ return (LabelState) super.getState();
+ }
+
+ @Override
+ public void onStateChanged(StateChangeEvent stateChangeEvent) {
+ super.onStateChanged(stateChangeEvent);
+
+ getWidget().setText(getState().getText());
+ }
+
+ @Override
+ public VLabel getWidget() {
+ return (VLabel) super.getWidget();
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/LabelState.java b/tests/testbench/com/vaadin/tests/widgetset/client/LabelState.java
new file mode 100644
index 0000000000..91a269e33f
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/LabelState.java
@@ -0,0 +1,41 @@
+/*
+ * 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.shared.ComponentState;
+
+/**
+ * State class with the same simple name as
+ * {@link com.vaadin.shared.ui.label.LabelState} to test #8683
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+public class LabelState extends ComponentState {
+
+ private String text;
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/SerializerTestConnector.java b/tests/testbench/com/vaadin/tests/widgetset/client/SerializerTestConnector.java
index 3977ff7f71..9fb6807bb7 100644
--- a/tests/testbench/com/vaadin/tests/widgetset/client/SerializerTestConnector.java
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/SerializerTestConnector.java
@@ -28,6 +28,7 @@ import java.util.Set;
import com.vaadin.shared.Connector;
import com.vaadin.shared.ui.Connect;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.gwt.client.communication.RpcProxy;
import com.vaadin.terminal.gwt.client.communication.StateChangeEvent;
import com.vaadin.terminal.gwt.client.extensions.AbstractExtensionConnector;
@@ -231,6 +232,16 @@ public class SerializerTestConnector extends AbstractExtensionConnector {
objectListArray[0] }, new List[] { Collections
.singletonList(beanListArray[0].get(0)) });
}
+
+ @Override
+ public void sendEnum(ContentMode contentMode, ContentMode[] array,
+ List<ContentMode> list) {
+ ContentMode nextContentMode = ContentMode.values()[contentMode
+ .ordinal() + 1];
+ rpc.sendEnum(nextContentMode,
+ list.toArray(new ContentMode[list.size()]),
+ Arrays.asList(array));
+ }
});
}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/SerializerTestRpc.java b/tests/testbench/com/vaadin/tests/widgetset/client/SerializerTestRpc.java
index 47a26b7408..eb3a20e90e 100644
--- a/tests/testbench/com/vaadin/tests/widgetset/client/SerializerTestRpc.java
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/SerializerTestRpc.java
@@ -23,6 +23,7 @@ import java.util.Set;
import com.vaadin.shared.Connector;
import com.vaadin.shared.communication.ClientRpc;
import com.vaadin.shared.communication.ServerRpc;
+import com.vaadin.shared.ui.label.ContentMode;
@SuppressWarnings("javadoc")
public interface SerializerTestRpc extends ServerRpc, ClientRpc {
@@ -73,4 +74,6 @@ public interface SerializerTestRpc extends ServerRpc, ClientRpc {
public void sendWrappedGenerics(
Map<Set<SimpleTestBean>, Map<Integer, List<SimpleTestBean>>> generics);
+ public void sendEnum(ContentMode contentMode, ContentMode[] array, List<ContentMode> list);
+
}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/server/DummyLabel.java b/tests/testbench/com/vaadin/tests/widgetset/server/DummyLabel.java
new file mode 100644
index 0000000000..bda36d64a8
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/server/DummyLabel.java
@@ -0,0 +1,38 @@
+/*
+ * 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.tests.widgetset.client.LabelState;
+import com.vaadin.ui.AbstractComponent;
+
+/**
+ * Dummy component to cause {@link LabelState} to be used to test #8683
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+public class DummyLabel extends AbstractComponent {
+ public DummyLabel(String text) {
+ getState().setText(text);
+ }
+
+ @Override
+ public LabelState getState() {
+ return (LabelState) super.getState();
+ }
+}