Package com.google.gwt.editor.client.SimpleBeanEditorTest

Examples of com.google.gwt.editor.client.SimpleBeanEditorTest.PersonEditorWithDelegateDriver


    assertTrue(driver.isDirty());
  }

  public void testDirtyWithDelegate() {
    PersonEditorWithDelegate editor = new PersonEditorWithDelegate();
    PersonEditorWithDelegateDriver driver = GWT.create(PersonEditorWithDelegateDriver.class);
    driver.initialize(editor);
    driver.edit(person);

    // Freshly-initialized should not be dirty
    assertFalse(driver.isDirty());

    // Use the delegate to toggle the state
    editor.delegate.setDirty(true);
    assertTrue(driver.isDirty());

    // Use the delegate to clear the state
    editor.delegate.setDirty(false);
    assertFalse(driver.isDirty());

    // Check that the delegate has no influence over values
    editor.addressEditor.city.setValue("edited");
    assertTrue(driver.isDirty());
    editor.delegate.setDirty(false);
    assertTrue(driver.isDirty());
    editor.delegate.setDirty(true);
    assertTrue(driver.isDirty());
  }
View Full Code Here


    assertFalse(driver.isDirty());
  }

  public void testEditResetsDirty() {
    PersonEditorWithDelegate editor = new PersonEditorWithDelegate();
    PersonEditorWithDelegateDriver driver = GWT.create(PersonEditorWithDelegateDriver.class);
    driver.initialize(editor);
    driver.edit(person);

    // Freshly-initialized should not be dirty
    assertFalse(driver.isDirty());

    editor.addressEditor.city.setValue("blah");
    assertTrue(driver.isDirty());

    driver.edit(person);
    assertFalse(driver.isDirty());

    editor.delegate.setDirty(true);
    assertTrue(driver.isDirty());
    driver.edit(person);
    assertFalse(driver.isDirty());
  }
View Full Code Here

  public void testEditResetsDirtyReplacement() {
    Person person2 = new Person();
    person2.setName("Pod");

    PersonEditorWithDelegate editor = new PersonEditorWithDelegate();
    PersonEditorWithDelegateDriver driver = GWT.create(PersonEditorWithDelegateDriver.class);
    driver.initialize(editor);
    driver.edit(person);

    editor.addressEditor.street.setValue("blah");
    assertTrue(driver.isDirty());

    driver.edit(person2);
    assertFalse(driver.isDirty());
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.editor.client.SimpleBeanEditorTest.PersonEditorWithDelegateDriver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.