Package org.strecks.bind.handler.impl

Examples of org.strecks.bind.handler.impl.BindableBean


    handler.setBeanPropertyName("integerProperty");
    handler.setConverter(new StandardBeanUtilsConverter());
    handler.setConversionHandler(new DefaultConversionHandler());

    // needed for binding outwards
    PropertyDescriptor propertyDescriptor = PropertyUtils.getPropertyDescriptor(new BindableBean(), "intProperty");
    handler.setPropertyDescriptor(propertyDescriptor);

  }
View Full Code Here


    // make sure converter does not get called for conversion
    converter.setTargetClass(Integer.class);
    replay(converter);

    BindableBean form = new BindableBean();

    TargetBean targetBean = new TargetBean();
    form.setTargetBean(targetBean);

    handler.bindInwards(form, form, 4);
    Assert.assertEquals(targetBean.getIntegerProperty().intValue(), 4);

    verify(converter);
View Full Code Here

  @Test
  public void testTargetBindOutwards()
  {

    BindableBean form = new BindableBean();

    TargetBean targetBean = new TargetBean();
    form.setTargetBean(targetBean);

    targetBean.setIntegerProperty(4);
    handler.bindOutwards(form, form);
    Assert.assertEquals(form.getIntProperty(), "4");

  }
View Full Code Here

  }

  @Test
  public void testNullTargetBindOutwards()
  {
    BindableBean form = new BindableBean();
    handler.bindOutwards(form, form);
    Assert.assertEquals(form.getIntProperty(), null);
  }
View Full Code Here

  @Test
  public void testTargetBindInwards()
  {

    BindableBean form = new BindableBean();

    TargetBean targetBean = new TargetBean();
    form.setTargetBean(targetBean);

    form.setIntProperty("4");
    handler.bindInwards(form, form, null);
    Assert.assertEquals(targetBean.getIntegerProperty().intValue(), 4);

  }
View Full Code Here

  }

  @Test
  public void testNullTargetBindInwards()
  {
    BindableBean form = new BindableBean();
    form.setIntProperty("4");
    handler.bindInwards(form, form, null);
  }
View Full Code Here

 
  public void testInwardDuffProperty()
  {
    handler.setBeanPropertyName("duffProperty");

    BindableBean form = new BindableBean();

    TargetBean targetBean = new TargetBean();
    form.setTargetBean(targetBean);

    form.setIntProperty("4");
    handler.bindInwards(form, form, null);
  }
View Full Code Here

  @Test(expectedExceptions=ApplicationRuntimeException.class)
  public void testOutwardDuffProperty()
  {
    handler.setBeanPropertyName("duffProperty");

    BindableBean form = new BindableBean();

    TargetBean targetBean = new TargetBean();
    form.setTargetBean(targetBean);

    targetBean.setIntegerProperty(4);
    handler.bindOutwards(form, form);
  }
View Full Code Here

    Converter converter = new StandardBeanUtilsConverter();
    handler.setConverter(converter);
    converter.setTargetClass(Integer.class);

    // needed for binding outwards
    PropertyDescriptor propertyDescriptor = PropertyUtils.getPropertyDescriptor(new BindableBean(), "selectedId");
    handler.setPropertyDescriptor(propertyDescriptor);

  }
View Full Code Here

    handler.setConverter(converter);

    // make sure converter does not get called for conversion
    replay(converter);

    BindableBean form = new BindableBean();

    TargetBean targetBean = new TargetBean();
    form.setTargetBean(targetBean);

    handler.bindInwards(form, form, 4);

    verify(converter);
    reset(converter);
View Full Code Here

TOP

Related Classes of org.strecks.bind.handler.impl.BindableBean

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.