diff options
author | Denis Anisimov <denis@vaadin.com> | 2015-01-08 16:33:40 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-01-08 14:59:17 +0000 |
commit | 441472f311ef9f38af233705d2480766c50e51d1 (patch) | |
tree | 1af0b0f0bd825c2acfb7b08dae5734df9569eae2 /uitest/src/com/vaadin/tests/serialization/SerializerTest.java | |
parent | 57d1b87d7f3a1beb100cd7cd3cc50ef124224057 (diff) | |
download | vaadin-framework-441472f311ef9f38af233705d2480766c50e51d1.tar.gz vaadin-framework-441472f311ef9f38af233705d2480766c50e51d1.zip |
Use sorted list instead of set in serialized log string (#15534).
Change-Id: I9a4904fc433e06443a2a68480361df8b2c1f68c9
Diffstat (limited to 'uitest/src/com/vaadin/tests/serialization/SerializerTest.java')
-rw-r--r-- | uitest/src/com/vaadin/tests/serialization/SerializerTest.java | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/uitest/src/com/vaadin/tests/serialization/SerializerTest.java b/uitest/src/com/vaadin/tests/serialization/SerializerTest.java index 333964e9bf..bb8b34d462 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; @@ -377,9 +379,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 @@ -466,4 +476,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()); + } + } } |