]> source.dussan.org Git - vaadin-framework.git/commitdiff
Action layout was added after the test components and not before..
authorArtur Signell <artur.signell@itmill.com>
Fri, 17 Sep 2010 15:05:04 +0000 (15:05 +0000)
committerArtur Signell <artur.signell@itmill.com>
Fri, 17 Sep 2010 15:05:04 +0000 (15:05 +0000)
svn changeset:15005/svn branch:6.4

tests/src/com/vaadin/tests/components/ComponentTestCase.java

index d92753c978e7741368c326aa81aaa1f3fa9aa6a2..68f925d7270faaf4eb0a3b23c621eb6e418864f4 100644 (file)
@@ -24,6 +24,7 @@ public abstract class ComponentTestCase<T extends AbstractComponent> extends
 
     private List<T> testComponents = new ArrayList<T>();
     private Class<T> componentClass;
+    private HorizontalLayout actionLayout;
 
     abstract protected Class<T> getTestClass();
 
@@ -33,12 +34,23 @@ public abstract class ComponentTestCase<T extends AbstractComponent> extends
     protected final void setup() {
         ((SpacingHandler) getLayout()).setSpacing(true);
 
+        // Create action layout so it appears before the components
+        actionLayout = createActionLayout();
+        addComponent(actionLayout);
+
         // Create Components
         componentClass = getTestClass();
         initializeComponents();
 
         // Create actions and add to layout
-        addComponent(createActionLayout());
+        populateActionLayout();
+    }
+
+    private void populateActionLayout() {
+        for (Component c : createActions()) {
+            actionLayout.addComponent(c);
+            actionLayout.setComponentAlignment(c, Alignment.BOTTOM_LEFT);
+        }
 
     }
 
@@ -79,15 +91,11 @@ public abstract class ComponentTestCase<T extends AbstractComponent> extends
         return actions;
     }
 
-    private Component createActionLayout() {
+    private HorizontalLayout createActionLayout() {
         HorizontalLayout actionLayout = new HorizontalLayout();
         actionLayout.setSpacing(true);
         actionLayout.setMargin(true);
-        for (Component c : createActions()) {
-            actionLayout.addComponent(c);
-            actionLayout.setComponentAlignment(c, Alignment.BOTTOM_LEFT);
-        }
-        addComponent(actionLayout);
+
         return actionLayout;
     }