]> source.dussan.org Git - vaadin-framework.git/commitdiff
Test HorizontalLayout also as it behaves differently than VerticalLayout
authorArtur Signell <artur.signell@itmill.com>
Fri, 27 Aug 2010 13:39:43 +0000 (13:39 +0000)
committerArtur Signell <artur.signell@itmill.com>
Fri, 27 Aug 2010 13:39:43 +0000 (13:39 +0000)
Added another TextField to cover more cases

svn changeset:14645/svn branch:6.4

tests/src/com/vaadin/tests/layouts/CaptionsInLayouts.java

index 6e02666f6287ccffebbf0254febdbb32bb8050b4..131c724f2705709e6a3483a48586ee77cb73fa1c 100644 (file)
@@ -34,6 +34,7 @@ public class CaptionsInLayouts extends TestBase {
     private NativeSelect layoutSelect;\r
     private Layout layout;\r
     private VerticalLayout verticalLayout;\r
+    private HorizontalLayout horizontalLayout;\r
     private GridLayout gridLayout;\r
     private FormLayout formLayout;\r
     private List<AbstractField> components = new ArrayList<AbstractField>();\r
@@ -145,13 +146,18 @@ public class CaptionsInLayouts extends TestBase {
 \r
     private void createComponents() {\r
         TextField tfUndefWide = new TextField(\r
-                "Undefined wide text field with a very long caption, longer than the field and the layout.");\r
+                "Undefined wide text field with a very long caption, longer than the field and the layout. Lorem ipsum dolor sit amet.");\r
         TextField tf100pxWide = new TextField(\r
                 "100 px wide text field with a very long caption, longer than 100px.");\r
         tf100pxWide.setWidth("100px");\r
 \r
+        TextField tf500pxWide = new TextField(\r
+                "500 px wide text field with a very long caption, longer than 500px. Lorem ipsum dolor sit amet, consectetur adipiscing elit.");\r
+        tf500pxWide.setWidth("500px");\r
+\r
         components.add(tfUndefWide);\r
         components.add(tf100pxWide);\r
+        components.add(tf500pxWide);\r
 \r
     }\r
 \r
@@ -179,6 +185,12 @@ public class CaptionsInLayouts extends TestBase {
                 verticalLayout.setStyleName("borders");\r
             }\r
             l = verticalLayout;\r
+        } else if (layoutClass == HorizontalLayout.class) {\r
+            if (horizontalLayout == null) {\r
+                horizontalLayout = new HorizontalLayout();\r
+                horizontalLayout.setStyleName("borders");\r
+            }\r
+            l = horizontalLayout;\r
         } else if (layoutClass == GridLayout.class) {\r
             if (gridLayout == null) {\r
                 gridLayout = new GridLayout();\r
@@ -221,8 +233,9 @@ public class CaptionsInLayouts extends TestBase {
         layoutSelect.setItemCaptionPropertyId(CAPTION);\r
         layoutSelect.setNullSelectionAllowed(false);\r
 \r
-        for (Class cls : new Class[] { VerticalLayout.class, GridLayout.class,\r
-                CssLayout.class, FormLayout.class }) {\r
+        for (Class<?> cls : new Class[] { HorizontalLayout.class,\r
+                VerticalLayout.class, GridLayout.class, CssLayout.class,\r
+                FormLayout.class }) {\r
             for (String width : new String[] { "400px", "auto" }) {\r
                 Object id = layoutSelect.addItem();\r
                 Item i = layoutSelect.getItem(id);\r