You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ComboBoxStateTest.java 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package com.vaadin.v7.tests.server.component.combobox;
  2. import static org.junit.Assert.assertEquals;
  3. import org.junit.Test;
  4. import com.vaadin.v7.shared.ui.combobox.ComboBoxState;
  5. import com.vaadin.v7.ui.ComboBox;
  6. /**
  7. * Tests for ComboBox state.
  8. *
  9. */
  10. public class ComboBoxStateTest {
  11. @Test
  12. public void getState_comboboxHasCustomState() {
  13. TestComboBox combobox = new TestComboBox();
  14. ComboBoxState state = combobox.getState();
  15. assertEquals("Unexpected state class", ComboBoxState.class,
  16. state.getClass());
  17. }
  18. @Test
  19. public void getPrimaryStyleName_comboboxHasCustomPrimaryStyleName() {
  20. ComboBox combobox = new ComboBox();
  21. ComboBoxState state = new ComboBoxState();
  22. assertEquals("Unexpected primary style name", state.primaryStyleName,
  23. combobox.getPrimaryStyleName());
  24. }
  25. @Test
  26. public void comboboxStateHasCustomPrimaryStyleName() {
  27. ComboBoxState state = new ComboBoxState();
  28. assertEquals("Unexpected primary style name", "v-filterselect",
  29. state.primaryStyleName);
  30. }
  31. private static class TestComboBox extends ComboBox {
  32. @Override
  33. public ComboBoxState getState() {
  34. return super.getState();
  35. }
  36. }
  37. }