Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

ComboBoxStateTest.java 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright 2000-2016 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.v7.tests.server.component.combobox;
  17. import static org.junit.Assert.assertEquals;
  18. import org.junit.Test;
  19. import com.vaadin.v7.shared.ui.combobox.ComboBoxState;
  20. import com.vaadin.v7.ui.ComboBox;
  21. /**
  22. * Tests for ComboBox state.
  23. *
  24. */
  25. public class ComboBoxStateTest {
  26. @Test
  27. public void getState_comboboxHasCustomState() {
  28. TestComboBox combobox = new TestComboBox();
  29. ComboBoxState state = combobox.getState();
  30. assertEquals("Unexpected state class", ComboBoxState.class,
  31. state.getClass());
  32. }
  33. @Test
  34. public void getPrimaryStyleName_comboboxHasCustomPrimaryStyleName() {
  35. ComboBox combobox = new ComboBox();
  36. ComboBoxState state = new ComboBoxState();
  37. assertEquals("Unexpected primary style name", state.primaryStyleName,
  38. combobox.getPrimaryStyleName());
  39. }
  40. @Test
  41. public void comboboxStateHasCustomPrimaryStyleName() {
  42. ComboBoxState state = new ComboBoxState();
  43. assertEquals("Unexpected primary style name", "v-filterselect",
  44. state.primaryStyleName);
  45. }
  46. private static class TestComboBox extends ComboBox {
  47. @Override
  48. public ComboBoxState getState() {
  49. return super.getState();
  50. }
  51. }
  52. }