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.

AddComponentsTest.java 713B

123456789101112131415161718192021222324252627
  1. package com.vaadin.tests.server.component.absolutelayout;
  2. import static org.junit.Assert.assertEquals;
  3. import org.junit.Test;
  4. import com.vaadin.ui.AbsoluteLayout;
  5. import com.vaadin.ui.Button;
  6. /**
  7. * Tests adding of components to {@link AbsoluteLayout}
  8. *
  9. * @author Vaadin Ltd
  10. */
  11. public class AddComponentsTest {
  12. @Test
  13. public void testAddExistingWithDifferentPosition() {
  14. AbsoluteLayout layout = new AbsoluteLayout();
  15. Button b1 = new Button("OK");
  16. layout.addComponent(b1, "top: 100px; left: 0px;");
  17. assertEquals(1, layout.getComponentCount());
  18. layout.addComponent(b1, "bottom: 0px; right: 0px;");
  19. assertEquals(1, layout.getComponentCount());
  20. }
  21. }