summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorIlia Motornyi <elmot@vaadin.com>2016-05-04 08:31:22 +0000
committerVaadin Code Review <review@vaadin.com>2016-05-04 09:54:02 +0000
commitef306c16f5a9cb8edae44fc8ce47cf3dc1964625 (patch)
treeb357ee318075a9c6ba9d2ef29a3f82e73a527d51 /uitest
parentf2b013e8d6908c6605acb2b7e89a400a6a0f0391 (diff)
downloadvaadin-framework-ef306c16f5a9cb8edae44fc8ce47cf3dc1964625.tar.gz
vaadin-framework-ef306c16f5a9cb8edae44fc8ce47cf3dc1964625.zip
Revert "Better default for nullRepresentation (#13221, #12877)"feature/standard-sass
This reverts commit 85870ccd9f93cebd839d22d2bd63ec817bb90a3d. Change-Id: Ifb9bbac0ee36e71d2251c31b936a12f1f3ea7315
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/textfield/NullRepresentationLegacyMode.java84
-rw-r--r--uitest/src/main/java/com/vaadin/tests/fieldgroup/MultipleValidationErrors.java10
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/textfield/NullRepresentationLegacyModeTest.java21
3 files changed, 1 insertions, 114 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/textfield/NullRepresentationLegacyMode.java b/uitest/src/main/java/com/vaadin/tests/components/textfield/NullRepresentationLegacyMode.java
deleted file mode 100644
index ab0bc6e534..0000000000
--- a/uitest/src/main/java/com/vaadin/tests/components/textfield/NullRepresentationLegacyMode.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2000-2014 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.tests.components.textfield;
-
-import com.vaadin.annotations.Theme;
-import com.vaadin.data.fieldgroup.BeanFieldGroup;
-import com.vaadin.server.VaadinRequest;
-import com.vaadin.tests.components.AbstractTestUI;
-import com.vaadin.ui.AbstractTextField;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-@Theme("valo")
-public class NullRepresentationLegacyMode extends AbstractTestUI {
-
- public static class Entity {
-
- private String value;
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- }
-
- public static class Form extends VerticalLayout {
- TextField value = new TextField();
-
- public Form() {
- setMargin(true);
- setSpacing(true);
- addComponent(value);
- }
- }
-
- @Override
- protected void setup(VaadinRequest request) {
- Form formWithoutNulls = new Form();
- formWithoutNulls.setCaption("No 'null's here please");
- formWithoutNulls.setId("without");
- BeanFieldGroup.bindFieldsUnbuffered(new Entity(), formWithoutNulls);
-
- // Use the legacy default
- AbstractTextField.setNullRepresentationDefault("null");
-
- Form formWithNulls = new Form();
- formWithNulls.setCaption("'null's please");
- formWithNulls.setId("with");
- BeanFieldGroup.bindFieldsUnbuffered(new Entity(), formWithNulls);
- AbstractTextField.setNullRepresentationDefault("");
-
- addComponents(formWithoutNulls, formWithNulls);
- }
-
- @Override
- protected String getTestDescription() {
- return "Text field must not truncate underscores in modal dialogs.";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return 12974;
- }
-
-}
diff --git a/uitest/src/main/java/com/vaadin/tests/fieldgroup/MultipleValidationErrors.java b/uitest/src/main/java/com/vaadin/tests/fieldgroup/MultipleValidationErrors.java
index f09b32d5c7..58f2292f84 100644
--- a/uitest/src/main/java/com/vaadin/tests/fieldgroup/MultipleValidationErrors.java
+++ b/uitest/src/main/java/com/vaadin/tests/fieldgroup/MultipleValidationErrors.java
@@ -1,7 +1,5 @@
package com.vaadin.tests.fieldgroup;
-import org.apache.commons.lang.StringEscapeUtils;
-
import com.vaadin.data.Validator;
import com.vaadin.data.fieldgroup.FieldGroup;
import com.vaadin.data.util.BeanItem;
@@ -9,10 +7,10 @@ import com.vaadin.data.validator.BeanValidator;
import com.vaadin.server.AbstractErrorMessage;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
-import com.vaadin.ui.AbstractTextField;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
import com.vaadin.ui.TextField;
+import org.apache.commons.lang.StringEscapeUtils;
public class MultipleValidationErrors extends AbstractTestUI {
@@ -27,15 +25,9 @@ public class MultipleValidationErrors extends AbstractTestUI {
new PersonBeanWithValidationAnnotations());
final FieldGroup fieldGroup = new FieldGroup(item);
- // use old default that this test depends on
- AbstractTextField.setNullRepresentationDefault("null");
-
bindTextField(item, fieldGroup, "First Name", "firstName");
bindTextField(item, fieldGroup, "Last Name", "lastName");
- // Revert to new
- AbstractTextField.setNullRepresentationDefault("");
-
final Label validationErrors = new Label();
validationErrors.setId("validationErrors");
addComponent(validationErrors);
diff --git a/uitest/src/test/java/com/vaadin/tests/components/textfield/NullRepresentationLegacyModeTest.java b/uitest/src/test/java/com/vaadin/tests/components/textfield/NullRepresentationLegacyModeTest.java
deleted file mode 100644
index c303e8e9f1..0000000000
--- a/uitest/src/test/java/com/vaadin/tests/components/textfield/NullRepresentationLegacyModeTest.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.vaadin.tests.components.textfield;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.openqa.selenium.By;
-
-import com.vaadin.tests.tb3.MultiBrowserTest;
-
-public class NullRepresentationLegacyModeTest extends MultiBrowserTest {
-
- @Test
- public void testWindowRepositioning() throws Exception {
- openTestURL();
- String without = getDriver().findElement(
- By.xpath("//div[@id='without']//input")).getAttribute("value");
- String with = getDriver().findElement(
- By.xpath("//div[@id='with']//input")).getAttribute("value");
- Assert.assertEquals("null", with);
- Assert.assertEquals("", without);
- }
-}