]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixed test still. Now does not depend on how many times application run on same servl...
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 29 May 2008 14:11:28 +0000 (14:11 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 29 May 2008 14:11:28 +0000 (14:11 +0000)
svn changeset:4706/svn branch:trunk

src/com/itmill/toolkit/automatedtests/ComponentsInTable.java

index 8345cae8e9130b02e3c14785a48e9ce827115028..1aabdfea71797889d0939a2bb110d45079c8dac4 100644 (file)
@@ -16,8 +16,6 @@ import com.itmill.toolkit.ui.Button.ClickEvent;
 \r
 public class ComponentsInTable extends CustomComponent {\r
 \r
-    static final Random rnd = new Random(1);\r
-\r
     public ComponentsInTable(int cols, int rows) {\r
         final OrderedLayout main = new OrderedLayout();\r
         setCompositionRoot(main);\r
@@ -26,6 +24,8 @@ public class ComponentsInTable extends CustomComponent {
     }\r
 \r
     public static Table getTestTable(int cols, int rows) {\r
+        Random rnd = new Random(1);\r
+\r
         final Table t = new Table();\r
         t.setColumnCollapsingAllowed(true);\r
         for (int i = 0; i < cols; i++) {\r
@@ -35,7 +35,7 @@ public class ComponentsInTable extends CustomComponent {
         for (int i = 0; i < rows; i++) {\r
             final Vector content = new Vector();\r
             for (int j = 0; j < cols; j++) {\r
-                content.add(rndString());\r
+                content.add(rndString(rnd));\r
             }\r
             content.add(new Button("b" + i, new Button.ClickListener() {\r
 \r
@@ -70,7 +70,7 @@ public class ComponentsInTable extends CustomComponent {
             "Jesse", "Devin", "Seth", "Antonio", "Richard", "Miguel", "Colin",\r
             "Cody", "Alejandro", "Caden", "Blake", "Carson" };\r
 \r
-    public static String rndString() {\r
+    public static String rndString(Random rnd) {\r
         return testString[(int) (rnd.nextDouble() * testString.length)];\r
     }\r
 \r