diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2016-04-15 11:06:18 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2016-04-15 14:00:58 +0300 |
commit | 6b8412033e680ce6e5c7827ac504adf132305726 (patch) | |
tree | 0df05d16c324b285610af8910c126b58f4c490c5 /uitest/src/com/vaadin/tests/tickets/Ticket1900.java | |
parent | 9192b0bb5e5e699b506b3d3e7df4cf295fbea44a (diff) | |
download | vaadin-framework-6b8412033e680ce6e5c7827ac504adf132305726.tar.gz vaadin-framework-6b8412033e680ce6e5c7827ac504adf132305726.zip |
Build uitest war with maven
Change-Id: I32625901ca27a282253df44c6e776cf9632bacda
Diffstat (limited to 'uitest/src/com/vaadin/tests/tickets/Ticket1900.java')
-rw-r--r-- | uitest/src/com/vaadin/tests/tickets/Ticket1900.java | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1900.java b/uitest/src/com/vaadin/tests/tickets/Ticket1900.java deleted file mode 100644 index 35b7adc7b3..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1900.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Validator; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; - -public class Ticket1900 extends LegacyApplication { - - TextField f[] = new TextField[5]; - LegacyWindow main = new LegacyWindow("#1900 test"); - - @Override - public void init() { - - setMainWindow(main); - - for (int i = 0; i < 5; i++) { - final int j = i; - f[i] = new TextField("Testcase " + i); - f[i].setImmediate(true); - f[i].setRequired(true); - main.addComponent(f[i]); - f[i].addListener(new Property.ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - main.showNotification("Validity test", "Testcase " + j - + " is " + (f[j].isValid() ? "valid" : "invalid")); - } - }); - f[i].addValidator(new ContainsValidator("1")); - f[i].addValidator(new ContainsValidator("2")); - - } - - f[0].setDescription("Field is empty, requiredError(null): *"); - - f[1].setDescription("Field is empty, requiredError(\"foo\"): * (popup shows the validation error)"); - f[1].setRequiredError("The field must not be empty"); - - f[2].setDescription("Field is non-empty, validators do not give validation error: *"); - f[2].setValue("valid 12"); - - f[3].setDescription("Field is non-empty, requiredError(null), validators " - + "give validation error: * ! (popup shows the validation error)"); - f[3].setValue("invalid"); - - f[4].setDescription("Field is non-empty, requiredError(\"foo\"), validators " - + "give validation error: * ! (popup shows the validation error)"); - f[4].setValue("invalid"); - f[4].setRequiredError("The field must not be empty"); - - } - - static class ContainsValidator implements Validator { - private final String c; - - public ContainsValidator(String c) { - this.c = c; - } - - @Override - public void validate(Object value) throws InvalidValueException { - if (value == null || !value.toString().contains(c)) { - throw new InvalidValueException("Value does not contain " + c); - } - - } - - } - -} |