diff options
author | Pekka Hyvönen <pekka@vaadin.com> | 2016-08-23 10:40:20 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-08-23 08:26:10 +0000 |
commit | a6147df13f54ef64118269fdc035aea670e55de8 (patch) | |
tree | b8f7cc7d4e11b59127a4f286d79841fa785f813d | |
parent | 03a0c328577d0758a6dd0decaa28ed957ae54871 (diff) | |
download | vaadin-framework-a6147df13f54ef64118269fdc035aea670e55de8.tar.gz vaadin-framework-a6147df13f54ef64118269fdc035aea670e55de8.zip |
Remove duplicate tests and rename tests BinderTest
BinderTest had duplicate tests which are now removed.
Remaining Binding tests are renamed.
Change-Id: I1b572dcdf40a8d6b4e7e0ce8caa943f8aaaf8320
-rw-r--r-- | server/src/test/java/com/vaadin/data/BinderTest.java | 78 |
1 files changed, 6 insertions, 72 deletions
diff --git a/server/src/test/java/com/vaadin/data/BinderTest.java b/server/src/test/java/com/vaadin/data/BinderTest.java index f2c166f6ce..a93916f729 100644 --- a/server/src/test/java/com/vaadin/data/BinderTest.java +++ b/server/src/test/java/com/vaadin/data/BinderTest.java @@ -406,7 +406,7 @@ public class BinderTest { } @Test - public void withStatusChangeHandler_handlerGetsEvents() { + public void bindingWithStatusChangeHandler_handlerGetsEvents() { AtomicReference<ValidationStatusChangeEvent> event = new AtomicReference<>(); Binding<Person, String, String> binding = binder.forField(nameField) .withValidator(notEmpty).withStatusChangeHandler(evt -> { @@ -442,25 +442,6 @@ public class BinderTest { } @Test - public void withStatusChangeHandler_defaultStatusChangeHandlerIsReplaced() { - Binding<Person, String, String> binding = binder.forField(nameField) - .withValidator(notEmpty).withStatusChangeHandler(evt -> { - }); - binding.bind(Person::getFirstName, Person::setLastName); - - Assert.assertNull(nameField.getComponentError()); - - nameField.setValue(""); - - // First validation fails => should be event with ERROR status and - // message - binder.validate(); - - // default behavior should update component error for the nameField - Assert.assertNull(nameField.getComponentError()); - } - - @Test public void bindingWithStatusChangeHandler_defaultStatusChangeHandlerIsReplaced() { Binding<Person, String, String> binding = binder.forField(nameField) .withValidator(notEmpty).withStatusChangeHandler(evt -> { @@ -480,33 +461,6 @@ public class BinderTest { } @Test - public void withStatusLabel_labelIsUpdatedAccordingStatus() { - Label label = new Label(); - - Binding<Person, String, String> binding = binder.forField(nameField) - .withValidator(notEmpty).withStatusLabel(label); - binding.bind(Person::getFirstName, Person::setLastName); - - nameField.setValue(""); - - // First validation fails => should be event with ERROR status and - // message - binder.validate(); - - Assert.assertTrue(label.isVisible()); - Assert.assertEquals("Value cannot be empty", label.getValue()); - - nameField.setValue("foo"); - - // Second validation succeeds => should be event with OK status and - // no message - binder.validate(); - - Assert.assertFalse(label.isVisible()); - Assert.assertEquals("", label.getValue()); - } - - @Test public void bindingWithStatusLabel_labelIsUpdatedAccordingStatus() { Label label = new Label(); @@ -534,26 +488,6 @@ public class BinderTest { } @Test - public void withStatusLabel_defaultStatusChangeHandlerIsReplaced() { - Label label = new Label(); - - Binding<Person, String, String> binding = binder.forField(nameField) - .withValidator(notEmpty).withStatusLabel(label); - binding.bind(Person::getFirstName, Person::setLastName); - - Assert.assertNull(nameField.getComponentError()); - - nameField.setValue(""); - - // First validation fails => should be event with ERROR status and - // message - binder.validate(); - - // default behavior should update component error for the nameField - Assert.assertNull(nameField.getComponentError()); - } - - @Test public void bindingWithStatusLabel_defaultStatusChangeHandlerIsReplaced() { Label label = new Label(); @@ -574,7 +508,7 @@ public class BinderTest { } @Test(expected = IllegalStateException.class) - public void withStatusChangeHandler_addAfterBound() { + public void bindingWithStatusChangeHandler_addAfterBound() { Binding<Person, String, String> binding = binder.forField(nameField) .withValidator(notEmpty); binding.bind(Person::getFirstName, Person::setLastName); @@ -583,7 +517,7 @@ public class BinderTest { } @Test(expected = IllegalStateException.class) - public void withStatusLabel_addAfterBound() { + public void bindingWithStatusLabel_addAfterBound() { Label label = new Label(); Binding<Person, String, String> binding = binder.forField(nameField) @@ -594,7 +528,7 @@ public class BinderTest { } @Test(expected = IllegalStateException.class) - public void withStatusLabel_setAfterHandler() { + public void bindingWithStatusLabel_setAfterHandler() { Label label = new Label(); Binding<Person, String, String> binding = binder.forField(nameField); @@ -607,7 +541,7 @@ public class BinderTest { } @Test(expected = IllegalStateException.class) - public void withStatusChangeHandler_setAfterLabel() { + public void bindingWithStatusChangeHandler_setAfterLabel() { Label label = new Label(); Binding<Person, String, String> binding = binder.forField(nameField); @@ -620,7 +554,7 @@ public class BinderTest { } @Test(expected = IllegalStateException.class) - public void withStatusChangeHandler_setAfterOtherHandler() { + public void bingingWithStatusChangeHandler_setAfterOtherHandler() { Binding<Person, String, String> binding = binder.forField(nameField); binding.bind(Person::getFirstName, Person::setLastName); |