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.

TextFieldTest.java 846B

123456789101112131415161718192021222324252627282930313233343536
  1. package com.vaadin.v7.tests.server.component.textfield;
  2. import static org.junit.Assert.assertFalse;
  3. import static org.junit.Assert.assertTrue;
  4. import org.junit.Test;
  5. import com.vaadin.v7.data.util.ObjectProperty;
  6. import com.vaadin.v7.ui.TextField;
  7. public class TextFieldTest {
  8. @Test
  9. public void initiallyEmpty() {
  10. TextField tf = new TextField();
  11. assertTrue(tf.isEmpty());
  12. }
  13. @Test
  14. public void emptyAfterClearUsingPDS() {
  15. TextField tf = new TextField(new ObjectProperty<String>("foo"));
  16. assertFalse(tf.isEmpty());
  17. tf.clear();
  18. assertTrue(tf.isEmpty());
  19. }
  20. @Test
  21. public void emptyAfterClear() {
  22. TextField tf = new TextField();
  23. tf.setValue("foobar");
  24. assertFalse(tf.isEmpty());
  25. tf.clear();
  26. assertTrue(tf.isEmpty());
  27. }
  28. }