From 0e99ee6a24abb693fc1ed721d50fb973830e0146 Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Thu, 29 May 2008 14:11:28 +0000 Subject: [PATCH] fixed test still. Now does not depend on how many times application run on same servlet container svn changeset:4706/svn branch:trunk --- .../itmill/toolkit/automatedtests/ComponentsInTable.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/com/itmill/toolkit/automatedtests/ComponentsInTable.java b/src/com/itmill/toolkit/automatedtests/ComponentsInTable.java index 8345cae8e9..1aabdfea71 100644 --- a/src/com/itmill/toolkit/automatedtests/ComponentsInTable.java +++ b/src/com/itmill/toolkit/automatedtests/ComponentsInTable.java @@ -16,8 +16,6 @@ import com.itmill.toolkit.ui.Button.ClickEvent; public class ComponentsInTable extends CustomComponent { - static final Random rnd = new Random(1); - public ComponentsInTable(int cols, int rows) { final OrderedLayout main = new OrderedLayout(); setCompositionRoot(main); @@ -26,6 +24,8 @@ public class ComponentsInTable extends CustomComponent { } public static Table getTestTable(int cols, int rows) { + Random rnd = new Random(1); + final Table t = new Table(); t.setColumnCollapsingAllowed(true); for (int i = 0; i < cols; i++) { @@ -35,7 +35,7 @@ public class ComponentsInTable extends CustomComponent { for (int i = 0; i < rows; i++) { final Vector content = new Vector(); for (int j = 0; j < cols; j++) { - content.add(rndString()); + content.add(rndString(rnd)); } content.add(new Button("b" + i, new Button.ClickListener() { @@ -70,7 +70,7 @@ public class ComponentsInTable extends CustomComponent { "Jesse", "Devin", "Seth", "Antonio", "Richard", "Miguel", "Colin", "Cody", "Alejandro", "Caden", "Blake", "Carson" }; - public static String rndString() { + public static String rndString(Random rnd) { return testString[(int) (rnd.nextDouble() * testString.length)]; } -- 2.39.5