Package org.strecks.bind.handler.impl

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


    handler.setBeanPropertyName("domainClass");
    handler.setBeanPropertyClass(Integer.class);

    BindableBean form = new BindableBean();
    Collection collection = new ArrayList();
    collection.add(new DomainClass(1));
    collection.add(new DomainClass(3));
    collection.add(new DomainClass(4));
    Map map = handler.getPropertyAsMap(collection);
    form.setLookupMap(map);

    TargetBean targetBean = new TargetBean();
    form.setTargetBean(targetBean);
    targetBean.setDomainClass(new DomainClass(4));

    handler.bindOutwards(form, form);

    Assert.assertEquals(form.getSelectedId(), "4");
View Full Code Here


    Map map = handler.getPropertyAsMap(new HashMap());
    form.setLookupMap(map);

    TargetBean targetBean = new TargetBean();
    form.setTargetBean(targetBean);
    targetBean.setDomainClass(new DomainClass(4));

    handler.bindOutwards(form, form);

    Assert.assertEquals(form.getSelectedId(), "4");
View Full Code Here

  public void testNullTargetBindOutwards()
  {

    BindableBean form = new BindableBean();
    Collection collection = new ArrayList();
    collection.add(new DomainClass(1));
    collection.add(new DomainClass(3));
    collection.add(new DomainClass(4));
    Map map = handler.getPropertyAsMap(collection);
    form.setLookupMap(map);

    TargetBean targetBean = new TargetBean();
    // form.setTargetBean(targetBean);
    targetBean.setDomainClass(new DomainClass(4));

    handler.bindOutwards(form, form);

    Assert.assertEquals(form.getSelectedId(), null);
View Full Code Here

    BindableBean form = new BindableBean();
    form.setLookupMap(null);

    TargetBean targetBean = new TargetBean();
    form.setTargetBean(targetBean);
    targetBean.setDomainClass(new DomainClass(4));

    handler.bindOutwards(form, form);

    Assert.assertEquals(form.getSelectedId(), "4");
View Full Code Here

  public void testTargetBindInwards()
  {

    BindableBean form = new BindableBean();
    Collection collection = new ArrayList();
    collection.add(new DomainClass(1));
    collection.add(new DomainClass(3));
    collection.add(new DomainClass(4));
    Map map = handler.getPropertyAsMap(collection);
    form.setLookupMap(map);

    TargetBean targetBean = new TargetBean();
    form.setTargetBean(targetBean);
View Full Code Here

  public void testNullTargetBindInwards()
  {

    BindableBean form = new BindableBean();
    Collection collection = new ArrayList();
    collection.add(new DomainClass(1));
    collection.add(new DomainClass(3));
    collection.add(new DomainClass(4));
    Map map = handler.getPropertyAsMap(collection);
    form.setLookupMap(map);

    TargetBean targetBean = new TargetBean();
    // form.setTargetBean(targetBean);
View Full Code Here

  public void testInvalidIdBindInwards()
  {

    BindableBean form = new BindableBean();
    Collection collection = new ArrayList();
    collection.add(new DomainClass(1));
    collection.add(new DomainClass(3));
    collection.add(new DomainClass(4));
    Map map = handler.getPropertyAsMap(collection);
    form.setLookupMap(map);

    TargetBean targetBean = new TargetBean();
    form.setTargetBean(targetBean);
View Full Code Here

    BindSelectHandler handler = new BindSelectHandler();
    handler.setBeanPropertyIdName("id");

    Collection collection = new ArrayList();
    collection.add(new DomainClass(1));
    collection.add(new DomainClass(3));
    collection.add(new DomainClass(4));

    Map map = handler.createMap(collection);
    assert map instanceof HashMap;

    Object firstKey = map.keySet().iterator().next();
View Full Code Here

    BindSelectHandler handler = new BindSelectHandler();
    handler.setBeanPropertyIdName("id");

    // create domain class instances with no id
    Collection collection = new ArrayList();
    collection.add(new DomainClass());
    collection.add(new DomainClass());
    collection.add(new DomainClass());

    Map map = handler.createMap(collection);
    assert map.size() == 1;
    assert map.keySet().iterator().next().equals(0);
  }
View Full Code Here

    BindSelectHandler handler = new BindSelectHandler();
    handler.setBeanPropertyIdName("id");

    Collection collection = new ArrayList();
    collection.add(new DomainClass(1));
    collection.add(new DomainClass(3));
    collection.add(new DomainClass(4));
    Map map = handler.getPropertyAsMap(collection);

    assert map.size() == 3;
    assert map instanceof HashMap;
View Full Code Here

TOP

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

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.