summaryrefslogtreecommitdiffstats
path: root/tests/server-side/com/vaadin
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2012-06-11 17:49:03 +0300
committerJohannes Dahlström <johannesd@vaadin.com>2012-06-11 17:49:03 +0300
commit526be540d463b64248edf4ca205a0dab5ad5945f (patch)
tree78baf752f9552ea21479acc72f356ad936f1e65a /tests/server-side/com/vaadin
parent7bcbc18f9b4faf8c6b2ab15416ed4efbd56efe7d (diff)
parent8e5b52a1bd24de51f9a08ebbe6618094400078d2 (diff)
downloadvaadin-framework-526be540d463b64248edf4ca205a0dab5ad5945f.tar.gz
vaadin-framework-526be540d463b64248edf4ca205a0dab5ad5945f.zip
Merge commit '8e5b5'
Conflicts: src/com/vaadin/terminal/gwt/client/ui/tabsheet/VTabsheet.java
Diffstat (limited to 'tests/server-side/com/vaadin')
-rw-r--r--tests/server-side/com/vaadin/tests/server/component/table/TableSerialization.java24
-rw-r--r--tests/server-side/com/vaadin/tests/util/UniqueSerializableTest.java33
2 files changed, 57 insertions, 0 deletions
diff --git a/tests/server-side/com/vaadin/tests/server/component/table/TableSerialization.java b/tests/server-side/com/vaadin/tests/server/component/table/TableSerialization.java
new file mode 100644
index 0000000000..44dcd60fa5
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/server/component/table/TableSerialization.java
@@ -0,0 +1,24 @@
+package com.vaadin.tests.server.component.table;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.lang.SerializationUtils;
+
+import com.vaadin.ui.Table;
+
+public class TableSerialization extends TestCase {
+
+ public void testSerialization() {
+ Table t = new Table();
+ byte[] ser = SerializationUtils.serialize(t);
+ Table t2 = (Table) SerializationUtils.deserialize(ser);
+
+ }
+ public void testSerializationWithRowHeaders() {
+ Table t = new Table();
+ t.setRowHeaderMode(Table.ROW_HEADER_MODE_EXPLICIT);
+ t.setColumnWidth(null, 100);
+ byte[] ser = SerializationUtils.serialize(t);
+ Table t2 = (Table) SerializationUtils.deserialize(ser);
+ }
+}
diff --git a/tests/server-side/com/vaadin/tests/util/UniqueSerializableTest.java b/tests/server-side/com/vaadin/tests/util/UniqueSerializableTest.java
new file mode 100644
index 0000000000..578d983c4d
--- /dev/null
+++ b/tests/server-side/com/vaadin/tests/util/UniqueSerializableTest.java
@@ -0,0 +1,33 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.util;
+
+import java.io.Serializable;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.lang.SerializationUtils;
+
+import com.vaadin.ui.UniqueSerializable;
+
+public class UniqueSerializableTest extends TestCase implements Serializable {
+
+ public void testUniqueness() {
+ UniqueSerializable o1 = new UniqueSerializable() {
+ };
+ UniqueSerializable o2 = new UniqueSerializable() {
+ };
+ assertFalse(o1 == o2);
+ assertFalse(o1.equals(o2));
+ }
+
+ public void testSerialization() {
+ UniqueSerializable o1 = new UniqueSerializable() {
+ };
+ UniqueSerializable d1 = (UniqueSerializable) SerializationUtils
+ .deserialize(SerializationUtils.serialize(o1));
+ assertTrue(d1.equals(o1));
+ }
+
+}