Package org.springframework.binding.support

Examples of org.springframework.binding.support.TestBean


   * not be dirty.
   * </p>
   */
  public void testFormModelSetFormObjectNotDirty() {
    String someString = "someString";
    FormModel model = getFormModel(new ValueHolder(new TestBean()), false);
    ValueModel valueModel = model.getValueModel("simpleProperty");

    assertEquals("Initial check, formmodel not dirty.", false, model.isDirty());

    valueModel.setValue(someString);
    assertEquals("Value changed, model should be dirty.", true, model.isDirty());

    TestBean newFormObject = new TestBean();
    newFormObject.setSimpleProperty(someString);
    model.setFormObject(newFormObject);
    assertEquals("New formObject is set, model should not be dirty.", false, model.isDirty());
  }
View Full Code Here


   * <li>if parent is disabled: should override child's enabled state</li>
   * </ul>
   * </p>
   */
  public void testParentChildEnabledState() {
    TestBean formObject = new TestBean();
    AbstractFormModel parent = getFormModel(formObject);
    AbstractFormModel child = getFormModel(formObject);
    BooleanStatelistener listener = new BooleanStatelistener(FormModel.ENABLED_PROPERTY);
    listener.state = child.isEnabled();
    child.addPropertyChangeListener(FormModel.ENABLED_PROPERTY, listener);
View Full Code Here

   * <li>if parent isn't readOnly: child can handle it's own state</li>
   * </ul>
   * </p>
   */
  public void testParentChildReadOnlyState() {
    TestBean formObject = new TestBean();
    AbstractFormModel parent = getFormModel(formObject);
    AbstractFormModel child = getFormModel(formObject);
    BooleanStatelistener listener = new BooleanStatelistener(FormModel.READONLY_PROPERTY);
    listener.state = child.isReadOnly();
    child.addPropertyChangeListener(FormModel.READONLY_PROPERTY, listener);
View Full Code Here

   * <li>if child is dirty then parent MUST be dirty</li>
   * <li>if child isn't dirty then parent CAN be dirty</li>
   * </ul>
   */
  public void testParentChildDirtyState() {
    TestBean formObject = new TestBean();
    AbstractFormModel parent = getFormModel(formObject);
    ValueModel parentValueModel = parent.getValueModel("simpleProperty");
    AbstractFormModel child = getFormModel(formObject);
    ValueModel childValueModel = child.getValueModel("booleanProperty");
    BooleanStatelistener listener = new BooleanStatelistener(FormModel.DIRTY_PROPERTY);
View Full Code Here

        // XXX: fails
//        testTwoFormModelsInHierarchyShareSameFormObjectHolder(false);
    }
   
    public void testTwoFormModelsInHierarchyShareSameFormObjectHolder(boolean buffered) {
        ValueHolder vm = new ValueHolder(new TestBean());
        AbstractFormModel fm1 = getFormModel(vm, buffered);
        AbstractFormModel fm2 = getFormModel(vm, buffered);
        TestPropertyChangeListener pcl = new TestPropertyChangeListener(ValueModel.VALUE_PROPERTY);
        fm2.getValueModel("simpleProperty").addValueChangeListener(pcl);
        fm1.addChild(fm2);
View Full Code Here

public class SwingBindingFactoryTests extends SpringRichTestCase {

    private SwingBindingFactory sbf;

    public void doSetUp() {
        sbf = new SwingBindingFactory(FormModelHelper.createFormModel(new TestBean()));
        sbf.setBinderSelectionStrategy(new TestingBinderSelectionStrategy());
    }
View Full Code Here

TOP

Related Classes of org.springframework.binding.support.TestBean

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.