diff options
author | Sun Zhe <31067185+ZheSun88@users.noreply.github.com> | 2018-12-20 17:00:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-20 17:00:57 +0200 |
commit | 0cfbee6ed5663d928a31def30d111733eae93731 (patch) | |
tree | 0737483b3ca66322f9c7f4a06c2824c2d00bd26e /server/src/test/java | |
parent | 353ba29cfdefddb032122cbeae5f02f6d9de76ba (diff) | |
download | vaadin-framework-0cfbee6ed5663d928a31def30d111733eae93731.tar.gz vaadin-framework-0cfbee6ed5663d928a31def30d111733eae93731.zip |
Update release note and since tag (#11386)
* Some formatting changes
Diffstat (limited to 'server/src/test/java')
-rw-r--r-- | server/src/test/java/com/vaadin/ui/CheckBoxTest.java | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/server/src/test/java/com/vaadin/ui/CheckBoxTest.java b/server/src/test/java/com/vaadin/ui/CheckBoxTest.java index 0fbd6fa694..c9c8b84465 100644 --- a/server/src/test/java/com/vaadin/ui/CheckBoxTest.java +++ b/server/src/test/java/com/vaadin/ui/CheckBoxTest.java @@ -1,10 +1,5 @@ package com.vaadin.ui; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - import java.util.concurrent.atomic.AtomicBoolean; import org.junit.Ignore; @@ -15,6 +10,11 @@ import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.checkbox.CheckBoxServerRpc; import com.vaadin.tests.util.MockUI; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + public class CheckBoxTest { @Test public void initiallyFalse() { @@ -74,32 +74,36 @@ public class CheckBoxTest { @Test public void getComboBoxInput() { CheckBox cb = new CheckBox(); - assertNotNull("getInputElement should always return a element", cb.getInputElement()); + assertNotNull("getInputElement should always return a element", + cb.getInputElement()); assertHasStyleNames(cb.getInputElement()); } @Test public void getCheckBoxLabel() { CheckBox cb = new CheckBox(); - assertNotNull("getLabelElement should always return a element", cb.getLabelElement()); + assertNotNull("getLabelElement should always return a element", + cb.getLabelElement()); assertHasStyleNames(cb.getLabelElement()); } @Test @Ignore("Component#setStyleName(null, false) should not throw a NPE") public void setStyleName_null_false_throws_NPE() { - // FIXME? - Currently it throws a NPE like the implementation in Component.java - // waiting for other ticket that fixes the behaviour in Component.java before + // FIXME? - Currently it throws a NPE like the implementation in + // Component.java + // waiting for other ticket that fixes the behaviour in Component.java + // before CheckBox cb = new CheckBox(); cb.getLabelElement().addStyleName("first"); cb.getLabelElement().setStyleName(null, false); - assertEquals("Removing a null style should be ignored", - "first", cb.getLabelElement().getStyleName()); + assertEquals("Removing a null style should be ignored", "first", + cb.getLabelElement().getStyleName()); } private void assertHasStyleNames(HasStyleNames hasStyleNames) { - assertEquals("Given element should not have a default style name", - "", hasStyleNames.getStyleName()); + assertEquals("Given element should not have a default style name", "", + hasStyleNames.getStyleName()); hasStyleNames.addStyleName("first"); assertEquals("first", hasStyleNames.getStyleName()); @@ -109,8 +113,8 @@ public class CheckBoxTest { "first", hasStyleNames.getStyleName()); hasStyleNames.addStyleName(null); - assertEquals("Adding null as style should be ignored", - "first", hasStyleNames.getStyleName()); + assertEquals("Adding null as style should be ignored", "first", + hasStyleNames.getStyleName()); hasStyleNames.addStyleName(""); assertEquals("Adding an empty string as style should be ignored", @@ -131,19 +135,19 @@ public class CheckBoxTest { hasStyleNames.addStyleNames("third", "fourth"); assertEquals("first second third fourth", hasStyleNames.getStyleName()); - hasStyleNames.removeStyleNames("second", "fourth"); + hasStyleNames.removeStyleNames("second", "fourth"); assertEquals("first third", hasStyleNames.getStyleName()); hasStyleNames.setStyleName(null); - assertEquals("Setting null as style should reset them", - "", hasStyleNames.getStyleName()); + assertEquals("Setting null as style should reset them", "", + hasStyleNames.getStyleName()); hasStyleNames.setStyleName("set-style"); assertEquals("set-style", hasStyleNames.getStyleName()); hasStyleNames.setStyleName(""); - assertEquals("Setting an empty string as style should reset them", - "", hasStyleNames.getStyleName()); + assertEquals("Setting an empty string as style should reset them", "", + hasStyleNames.getStyleName()); hasStyleNames.setStyleName("set-style multiple values"); assertEquals("set-style multiple values", hasStyleNames.getStyleName()); @@ -160,11 +164,12 @@ public class CheckBoxTest { "multiple values", hasStyleNames.getStyleName()); hasStyleNames.setStyleName(null, true); - assertEquals("Adding a null style should be ignored", - "multiple values", hasStyleNames.getStyleName()); + assertEquals("Adding a null style should be ignored", "multiple values", + hasStyleNames.getStyleName()); hasStyleNames.setStyleName("multiple values", false); - assertEquals("Removing all set style names should result in an empty style name", + assertEquals( + "Removing all set style names should result in an empty style name", "", hasStyleNames.getStyleName()); hasStyleNames.setStyleName("set-style", true); |