diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-01-12 11:28:55 +0200 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-01-12 11:28:55 +0200 |
commit | 2286f9871f7f77dea6139d0cd1dfc6754b1946d5 (patch) | |
tree | c8a978d77dff74788b5a290f6c7928e39932b8a5 /uitest/src/com/vaadin/tests/serialization | |
parent | 35d91245de3218283c8f4c733a3aa72ea395fb1c (diff) | |
parent | 3f27e02f121c0a39b217532afcf9530bfd2caba7 (diff) | |
download | vaadin-framework-2286f9871f7f77dea6139d0cd1dfc6754b1946d5.tar.gz vaadin-framework-2286f9871f7f77dea6139d0cd1dfc6754b1946d5.zip |
Merge remote-tracking branch 'origin/master' into grid
Change-Id: Ic6b667ea6ceff43a609ce2037f656c6274871fb7
Diffstat (limited to 'uitest/src/com/vaadin/tests/serialization')
-rw-r--r-- | uitest/src/com/vaadin/tests/serialization/SerializerTest.java | 31 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java | 6 |
2 files changed, 32 insertions, 5 deletions
diff --git a/uitest/src/com/vaadin/tests/serialization/SerializerTest.java b/uitest/src/com/vaadin/tests/serialization/SerializerTest.java index df37601f23..2ac10c161d 100644 --- a/uitest/src/com/vaadin/tests/serialization/SerializerTest.java +++ b/uitest/src/com/vaadin/tests/serialization/SerializerTest.java @@ -17,9 +17,11 @@ package com.vaadin.tests.serialization; import java.text.DateFormat; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.HashSet; @@ -387,9 +389,17 @@ public class SerializerTest extends AbstractTestUI { @Override public void sendSet(Set<Integer> intSet, Set<Connector> connectorSet, Set<SimpleTestBean> beanSet) { - log.log("sendSet: " + intSet + ", " - + connectorCollectionToString(connectorSet) + ", " - + beanSet); + List<Integer> intList = new ArrayList<Integer>(intSet); + Collections.sort(intList); + List<Connector> connectorList = new ArrayList<Connector>( + connectorSet); + Collections.sort(connectorList, new ConnectorComparator()); + List<SimpleTestBean> beanList = new ArrayList<SimpleTestBean>( + beanSet); + Collections.sort(beanList, new SimpleBeanComparator()); + log.log("sendSet: " + intList + ", " + + connectorCollectionToString(connectorList) + ", " + + beanList); } @Override @@ -483,4 +493,19 @@ public class SerializerTest extends AbstractTestUI { return Integer.valueOf(8655); } + private static class ConnectorComparator implements Comparator<Connector> { + + @Override + public int compare(Connector o1, Connector o2) { + return o1.getConnectorId().compareTo(o2.getConnectorId()); + } + } + + private static class SimpleBeanComparator implements + Comparator<SimpleTestBean> { + @Override + public int compare(SimpleTestBean o1, SimpleTestBean o2) { + return Integer.valueOf(o1.getValue()).compareTo(o2.getValue()); + } + } } diff --git a/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java b/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java index a5216546b3..23af74c78b 100644 --- a/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java +++ b/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java @@ -92,8 +92,10 @@ public class SerializerTestTest extends MultiBrowserTest { getLogRow(logRow++)); Assert.assertEquals("state.floatArray: [57, 0, -12]", getLogRow(logRow++)); - Assert.assertTrue(getLogRow(logRow++).startsWith("state.floatObjectValue: 1.0000001")); - Assert.assertTrue(getLogRow(logRow++).startsWith("state.floatValue: 3.14159")); + Assert.assertTrue(getLogRow(logRow++).startsWith( + "state.floatObjectValue: 1.0000001")); + Assert.assertTrue(getLogRow(logRow++).startsWith( + "state.floatValue: 3.14159")); Assert.assertEquals("state.longArray: [-57841235865, 57]", getLogRow(logRow++)); Assert.assertEquals("state.longObjectValue: 577431841360", |