diff options
author | Sauli Tähkäpää <sauli@vaadin.com> | 2014-03-19 11:23:38 +0200 |
---|---|---|
committer | Sauli Tähkäpää <sauli@vaadin.com> | 2014-03-19 11:23:38 +0200 |
commit | 23891f2519410d174e9e923e2ca5842c78c8e757 (patch) | |
tree | fd4c8bb04be78c31ad5182ab279b267ddf8770bf | |
parent | cca2172654699f9e2f79e8b36c70700c248da8f2 (diff) | |
download | vaadin-framework-23891f2519410d174e9e923e2ca5842c78c8e757.tar.gz vaadin-framework-23891f2519410d174e9e923e2ca5842c78c8e757.zip |
Refactored failing test for OptionGroup.
Change-Id: Ia7cc646649dd3e98822ace82e1eefac3f2ba2a5e
2 files changed, 32 insertions, 26 deletions
diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractselect/OptionGroupTests.java b/server/tests/src/com/vaadin/tests/server/component/abstractselect/OptionGroupTests.java new file mode 100644 index 0000000000..c4a3d73652 --- /dev/null +++ b/server/tests/src/com/vaadin/tests/server/component/abstractselect/OptionGroupTests.java @@ -0,0 +1,32 @@ +package com.vaadin.tests.server.component.abstractselect; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.Collection; + +import org.junit.Before; +import org.junit.Test; + +import com.vaadin.ui.OptionGroup; + +public class OptionGroupTests { + + private OptionGroup optionGroup; + + @Before + public void setup() { + optionGroup = new OptionGroup(); + } + + @Test + public void itemsAreAdded() { + optionGroup.addItems("foo", "bar"); + + Collection<?> itemIds = optionGroup.getItemIds(); + + assertEquals(2, itemIds.size()); + assertTrue(itemIds.contains("foo")); + assertTrue(itemIds.contains("bar")); + } +} diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractselect/TestVarargsItemAddition.java b/server/tests/src/com/vaadin/tests/server/component/abstractselect/TestVarargsItemAddition.java deleted file mode 100644 index 5575b8fd3d..0000000000 --- a/server/tests/src/com/vaadin/tests/server/component/abstractselect/TestVarargsItemAddition.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.vaadin.tests.server.component.abstractselect; - -import java.util.Collection; - -import junit.framework.TestCase; - -import org.junit.Assert; - -import com.vaadin.ui.OptionGroup; - -public class TestVarargsItemAddition extends TestCase { - - public void itemAddition() throws Exception { - - OptionGroup optionGroup = new OptionGroup(); - - optionGroup.addItems("foo", "bar", "car"); - - Collection<?> itemIds = optionGroup.getItemIds(); - Assert.assertEquals(3, itemIds.size()); - Assert.assertTrue(itemIds.contains("foo")); - Assert.assertTrue(itemIds.contains("bar")); - Assert.assertTrue(itemIds.contains("car")); - - } -} |