summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/components
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-09-18 17:40:12 +0300
committerArtur Signell <artur@vaadin.com>2012-09-18 18:09:54 +0300
commit21bf33e29323d65b3e7c3b7ecdfba39db69d8e00 (patch)
treef0e28d6ae02603798fa8e1469cf6e8cc36187bec /uitest/src/com/vaadin/tests/components
parent3fa3f434f2627adee9ba5883a34c6c4bca4c9949 (diff)
downloadvaadin-framework-21bf33e29323d65b3e7c3b7ecdfba39db69d8e00.tar.gz
vaadin-framework-21bf33e29323d65b3e7c3b7ecdfba39db69d8e00.zip
Ensure propertyDataSource can be set back to null (#9618)
Added additional tests for Label with a data source. Note that the locale dependent tests still fail because of #8192
Diffstat (limited to 'uitest/src/com/vaadin/tests/components')
-rw-r--r--uitest/src/com/vaadin/tests/components/label/LabelPropertySourceValue.html51
-rw-r--r--uitest/src/com/vaadin/tests/components/label/LabelPropertySourceValue.java35
2 files changed, 75 insertions, 11 deletions
diff --git a/uitest/src/com/vaadin/tests/components/label/LabelPropertySourceValue.html b/uitest/src/com/vaadin/tests/components/label/LabelPropertySourceValue.html
index bda4403b2b..e62ef4bba1 100644
--- a/uitest/src/com/vaadin/tests/components/label/LabelPropertySourceValue.html
+++ b/uitest/src/com/vaadin/tests/components/label/LabelPropertySourceValue.html
@@ -21,6 +21,7 @@
<td>//div[@id='runLabelPropertySourceValue-596713704']/div/div[2]/div[2]/div/div/div</td>
<td>Hello Vaadin user</td>
</tr>
+<!--set data source-->
<tr>
<td>click</td>
<td>vaadin=runLabelPropertySourceValue::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]</td>
@@ -31,7 +32,55 @@
<td>vaadin=runLabelPropertySourceValue::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VLabel[0]</td>
<td>This text should appear on the label after clicking the button.</td>
</tr>
-
+<!--remove data source-->
+<tr>
+ <td>click</td>
+ <td>vaadin=runLabelPropertySourceValue::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runLabelPropertySourceValue::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VLabel[0]</td>
+ <td>This text should appear on the label after clicking the button.</td>
+</tr>
+<!--set value to foo-->
+<tr>
+ <td>click</td>
+ <td>vaadin=runLabelPropertySourceValue::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runLabelPropertySourceValue::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VLabel[0]</td>
+ <td>foo</td>
+</tr>
+<!--set data source-->
+<tr>
+ <td>click</td>
+ <td>vaadin=runLabelPropertySourceValue::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runLabelPropertySourceValue::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VLabel[0]</td>
+ <td>This text should appear on the label after clicking the button.</td>
+</tr>
+<!--set value to foo (should fail)-->
+<tr>
+ <td>click</td>
+ <td>vaadin=runLabelPropertySourceValue::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runLabelPropertySourceValue::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VLabel[0]</td>
+ <td>This text should appear on the label after clicking the button.</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runLabelPropertySourceValue::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>v-errorindicator</td>
+</tr>
</tbody></table>
</body>
</html>
diff --git a/uitest/src/com/vaadin/tests/components/label/LabelPropertySourceValue.java b/uitest/src/com/vaadin/tests/components/label/LabelPropertySourceValue.java
index fdbb3caddb..c3d0d9cccd 100644
--- a/uitest/src/com/vaadin/tests/components/label/LabelPropertySourceValue.java
+++ b/uitest/src/com/vaadin/tests/components/label/LabelPropertySourceValue.java
@@ -5,28 +5,43 @@ import com.vaadin.server.WrappedRequest;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Label;
-public class LabelPropertySourceValue extends AbstractTestUI implements
- Button.ClickListener {
+public class LabelPropertySourceValue extends AbstractTestUI {
private Label label;
@Override
public void setup(WrappedRequest request) {
label = new Label("Hello Vaadin user");
+ addComponent(label);
Button button = new Button("Give label a new property data source...");
- button.addClickListener(this);
+ button.addClickListener(new ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ ObjectProperty<String> p = new ObjectProperty<String>(
+ "This text should appear on the label after clicking the button.");
+
+ label.setPropertyDataSource(p);
+ }
+ });
+ addComponent(button);
+ button = new Button("Remove data source", new ClickListener() {
- addComponent(label);
+ @Override
+ public void buttonClick(ClickEvent event) {
+ label.setPropertyDataSource(null);
+ }
+ });
addComponent(button);
- }
- public void buttonClick(ClickEvent event) {
- ObjectProperty<String> p = new ObjectProperty<String>(
- "This text should appear on the label after clicking the button.");
+ button = new Button("Set label value to 'foo'", new ClickListener() {
- label.setPropertyDataSource(p);
- //
+ @Override
+ public void buttonClick(ClickEvent event) {
+ label.setValue("foo");
+ }
+ });
+ addComponent(button);
}
@Override