diff options
author | Marko Grönroos <magi@iki.fi> | 2008-06-23 13:33:46 +0000 |
---|---|---|
committer | Marko Grönroos <magi@iki.fi> | 2008-06-23 13:33:46 +0000 |
commit | efa5c7affd2e0767abb95ee891b86fc220ab220f (patch) | |
tree | 9aa2ce96ddd9177e4aa3b1ee1213fd057011d1e2 | |
parent | c1d3db5858b189545e09fa44f2134e11a2991010 (diff) | |
download | vaadin-framework-efa5c7affd2e0767abb95ee891b86fc220ab220f.tar.gz vaadin-framework-efa5c7affd2e0767abb95ee891b86fc220ab220f.zip |
Order selected items in Tables example because the return type is a Set and we need to always have them in the same order for testing purposes.
svn changeset:4940/svn branch:trunk
-rw-r--r-- | src/com/itmill/toolkit/automatedtests/featurebrowser/TableExample.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/com/itmill/toolkit/automatedtests/featurebrowser/TableExample.java b/src/com/itmill/toolkit/automatedtests/featurebrowser/TableExample.java index 83f9ca1b76..a53f024904 100644 --- a/src/com/itmill/toolkit/automatedtests/featurebrowser/TableExample.java +++ b/src/com/itmill/toolkit/automatedtests/featurebrowser/TableExample.java @@ -5,6 +5,8 @@ package com.itmill.toolkit.automatedtests.featurebrowser;
import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Random;
import java.util.Set;
@@ -232,7 +234,15 @@ public class TableExample extends CustomComponent implements Action.Handler, // loop each selected and copy to "saved" table
final Set selected = (Set) source.getValue();
int s = 0;
- for (final Iterator it = selected.iterator(); it.hasNext();) {
+
+ // The set can return the items in quite any order, but
+ // for testing purposes they always have to be in the
+ // same order.
+ List ordered = new LinkedList(selected);
+ java.util.Collections.sort(ordered);
+
+ // Now move the items to the other table
+ for (final Iterator it = ordered.iterator(); it.hasNext();) {
final Object id = it.next();
if (!saved.containsId(id)) {
final Item item = source.getItem(id);
|