]> source.dussan.org Git - vaadin-framework.git/commitdiff
[merge from 6.7] Backported test changes from Vaadin 7
authorAutomerge <automerge@vaadin.com>
Fri, 23 Mar 2012 10:01:07 +0000 (10:01 +0000)
committerAutomerge <automerge@vaadin.com>
Fri, 23 Mar 2012 10:01:07 +0000 (10:01 +0000)
svn changeset:23299/svn branch:6.8

tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.html
tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.java

index fbb6f4c7f90b46577ba59b061cb61e8b49de49d6..8874cc91afee48a70ec5d993be98b449e2de198e 100644 (file)
@@ -27,9 +27,9 @@
        <td></td>
 </tr>
 <tr>
-       <td>verifyTextPresent</td>
-       <td>exact:1: Size 200x200 pixels</td>
-       <td></td>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::PID_SLog_row_0</td>
+       <td>1. Size 200x200 pixels</td>
 </tr>
 <tr>
        <td>screenCapture</td>
@@ -42,9 +42,9 @@
        <td></td>
 </tr>
 <tr>
-       <td>verifyTextPresent</td>
-       <td>exact:2: Size 600x200 pixels<br />1: Size 200x200 pixels</td>
-       <td></td>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::PID_SLog_row_0</td>
+       <td>2. Size 600x200 pixels</td>
 </tr>
 <tr>
        <td>screenCapture</td>
@@ -57,9 +57,9 @@
        <td></td>
 </tr>
 <tr>
-       <td>verifyTextPresent</td>
-       <td>exact:3: Size undefined<br />2: Size 600x200 pixels<br />1: Size 200x200 pixels</td>
-       <td></td>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::PID_SLog_row_0</td>
+       <td>3. Size undefined</td>
 </tr>
 <tr>
        <td>select</td>
@@ -67,9 +67,9 @@
        <td>label=4</td>
 </tr>
 <tr>
-       <td>verifyTextPresent</td>
-       <td>exact:4: Page length: 4<br />3: Size undefined<br />2: Size 600x200 pixels<br />1: Size 200x200 pixels</td>
-       <td></td>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::PID_SLog_row_0</td>
+       <td>4. Page length: 4</td>
 </tr>
 <tr>
        <td>screenCapture</td>
        <td>3,6</td>
 </tr>
 <tr>
-       <td>verifyTextPresent</td>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]</td>
        <td>Column 2</td>
-       <td></td>
 </tr>
 <tr>
-       <td>verifyTextPresent</td>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[2]</td>
        <td>Column 3</td>
-       <td></td>
 </tr>
 <tr>
        <td>screenCapture</td>
        <td></td>
        <td>AllColumnsShown</td>
 </tr>
-
 </tbody></table>
 </body>
 </html>
index 2b3204953bff3521453d6fc52a1a12af98ab44de..73b80f62f4290a40946f199758211657f3661341 100644 (file)
@@ -5,22 +5,20 @@ import java.util.Arrays;
 import com.vaadin.data.Container;
 import com.vaadin.data.Property;
 import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
 import com.vaadin.data.util.IndexedContainer;
-import com.vaadin.data.util.ObjectProperty;
 import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Log;
 import com.vaadin.ui.Button;
 import com.vaadin.ui.Button.ClickEvent;
 import com.vaadin.ui.CheckBox;
 import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Label;
 import com.vaadin.ui.NativeSelect;
 import com.vaadin.ui.Table;
 
 public class TableUndefinedSize extends TestBase {
 
-    private ObjectProperty<String> output = new ObjectProperty<String>("");
-
-    private int counter = 1;
+    private Log log;
 
     @Override
     protected void setup() {
@@ -37,17 +35,14 @@ public class TableUndefinedSize extends TestBase {
         tbl.setImmediate(true);
         tbl.setColumnCollapsingAllowed(true);
 
-        Label output = new Label(this.output);
-        output.setWidth("400px");
-        output.setHeight("100px");
-        output.setContentMode(Label.CONTENT_XHTML);
+        log = new Log(5);
 
         controls.addComponent(new Button("Fixed size (200x200)",
                 new Button.ClickListener() {
                     public void buttonClick(ClickEvent event) {
                         tbl.setWidth("200px");
                         tbl.setHeight("200px");
-                        print("Size 200x200 pixels");
+                        log.log("Size 200x200 pixels");
                     }
                 }));
 
@@ -56,7 +51,7 @@ public class TableUndefinedSize extends TestBase {
                     public void buttonClick(ClickEvent event) {
                         tbl.setWidth("600px");
                         tbl.setHeight("200px");
-                        print("Size 600x200 pixels");
+                        log.log("Size 600x200 pixels");
                     }
                 }));
 
@@ -64,7 +59,7 @@ public class TableUndefinedSize extends TestBase {
                 new Button.ClickListener() {
                     public void buttonClick(ClickEvent event) {
                         tbl.setSizeUndefined();
-                        print("Size undefined");
+                        log.log("Size undefined");
                     }
                 }));
 
@@ -77,68 +72,70 @@ public class TableUndefinedSize extends TestBase {
                 int pageLength = Integer.valueOf(event.getProperty().getValue()
                         .toString());
                 tbl.setPageLength(pageLength);
-                print("Page length: " + pageLength);
+                log.log("Page length: " + pageLength);
             }
         });
         controls.addComponent(pageLength);
 
-        CheckBox cb = new CheckBox("Column 1", new Button.ClickListener() {
-            public void buttonClick(ClickEvent event) {
-                tbl.setColumnCollapsed("Column 1", !event.getButton()
-                                .booleanValue());
-                if (event.getButton().booleanValue()) {
-                    print("Column 1 visible");
+        CheckBox cb = new CheckBox("Column 1");
+        cb.setValue(true);
+        cb.addListener(new ValueChangeListener() {
+
+            public void valueChange(ValueChangeEvent event) {
+                Boolean value = (Boolean) event.getProperty().getValue();
+                tbl.setColumnCollapsed("Column 1", !value);
+                if (value) {
+                    log.log("Column 1 visible");
                 } else {
-                    print("Column 1 hidden");
+                    log.log("Column 1 hidden");
                 }
-                    }
+            }
         });
         cb.setImmediate(true);
-        cb.setValue(true);
         visibilities.addComponent(cb);
 
-        cb = new CheckBox("Column 2", new Button.ClickListener() {
-            public void buttonClick(ClickEvent event) {
-                tbl.setColumnCollapsed("Column 2", !event.getButton()
-                        .booleanValue());
+        cb = new CheckBox("Column 2");
+        cb.setValue(true);
+        cb.addListener(new ValueChangeListener() {
+
+            public void valueChange(ValueChangeEvent event) {
+                Boolean value = (Boolean) event.getProperty().getValue();
+                tbl.setColumnCollapsed("Column 2", !value);
 
-                if (event.getButton().booleanValue()) {
-                    print("Column 2 visible");
+                if (value) {
+                    log.log("Column 2 visible");
                 } else {
-                    print("Column 2 hidden");
+                    log.log("Column 2 hidden");
                 }
             }
         });
         cb.setImmediate(true);
-        cb.setValue(true);
         visibilities.addComponent(cb);
 
-        cb = new CheckBox("Column 3", new Button.ClickListener() {
-            public void buttonClick(ClickEvent event) {
-                tbl.setColumnCollapsed("Column 3", !event.getButton()
-                        .booleanValue());
+        cb = new CheckBox("Column 3");
+        cb.setValue(true);
+        cb.addListener(new ValueChangeListener() {
+
+            public void valueChange(ValueChangeEvent event) {
+                Boolean value = (Boolean) event.getProperty().getValue();
 
-                if (event.getButton().booleanValue()) {
-                    print("Column 3 visible");
+                tbl.setColumnCollapsed("Column 3", !value);
+
+                if (value) {
+                    log.log("Column 3 visible");
                 } else {
-                    print("Column 3 hidden");
+                    log.log("Column 3 hidden");
                 }
             }
         });
         cb.setImmediate(true);
-        cb.setValue(true);
         visibilities.addComponent(cb);
 
-        addComponent(output);
+        addComponent(log);
         addComponent(tbl);
 
     }
 
-    protected void print(String message) {
-        output.setValue(counter + ": " + message + "<br/>" + output.getValue());
-        counter++;
-    }
-
     protected Container createDataSource() {
         IndexedContainer c = new IndexedContainer();
         c.addContainerProperty("Column 1", String.class, "Column 1");