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.

TableStateTest.java 1.2KB

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