Examples of NestedBean


Examples of org.jboss.test.beaninfo.support.NestedBean

      checkNestedSetFail(SubPrivateSetterNestedBean.class, BeanAccessMode.ALL);
   }

   public void testNestedPropertyInfo() throws Throwable
   {
      NestedBean grandchild = new NestedBean();
      NestedBean child = new NestedBean();
      child.doSetHook(grandchild);
      NestedBean parent = new NestedBean();
      parent.doSetHook(child);
      BeanInfo beanInfo = getBeanInfo(NestedBean.class);
      PropertyInfo propertyInfo = beanInfo.getProperty("string");
      PropertyInfo nestedPropertyInfo = BeanInfoUtil.getPropertyInfo(beanInfo, parent, "bean.otherBean.string");
      assertEquals(propertyInfo, nestedPropertyInfo);
   }
View Full Code Here

Examples of org.jboss.test.beaninfo.support.NestedBean

   public void testNestedPropertyInfoFail() throws Throwable
   {
      try
      {
         NestedBean child = new NestedBean();
         NestedBean parent = new NestedBean();
         parent.doSetHook(child);
         BeanInfo beanInfo = getBeanInfo(NestedBean.class);
         BeanInfoUtil.getPropertyInfo(beanInfo, parent, "bean.differentGetter.string");
         fail("Should not be here.");
      }
      catch (Throwable t)
View Full Code Here

Examples of org.jboss.test.kernel.dependency.support.NestedBean

      ControllerContext context = assertInstall(0, "NestedBean");
      Object target = context.getTarget();
      assertNotNull(target);
      assertInstanceOf(target, NestedBean.class);
      NestedBean root = (NestedBean)target;
      NestedBean lev1 = root.getBean();
      assertNotNull(lev1);
      NestedBean lev2 = lev1.getBean();
      assertNotNull(lev2);
      assertEquals("String12", lev2.getString());
   }
View Full Code Here

Examples of org.jboss.test.kernel.dependency.support.NestedBean

      ControllerContext context = assertInstall(1, "NestedBean");
      Object target = context.getTarget();
      assertNotNull(target);
      assertInstanceOf(target, NestedBean.class);
      NestedBean root = (NestedBean)target;
      NestedBean lev1 = root.getBean();
      assertNotNull(lev1);
      NestedBean lev2 = lev1.getBean();
      assertNotNull(lev2);
      assertEquals("String1234", lev2.getString());

      ControllerContext injecteeCC = assertInstall(0, "InjecteeBean");
      Object injectee = injecteeCC.getTarget();
      assertNotNull(injectee);
      assertInstanceOf(injectee, NestedBean.class);
      NestedBean injecteeBean = (NestedBean)injectee;
      assertEquals("String1234", injecteeBean.getString());
   }
View Full Code Here

Examples of org.strecks.form.impl.NestedBean

  @Test
  public void testBindingToTarget()
  {

    NestedBean nestedBean = new NestedBean();
    form.setNestedBean(nestedBean);

    form.setIntegerValue("3");
    form.setLongValue("11");

    delegator.bindInwards(null);

    assert nestedBean.getTargetIntegerValue() == 3;
    assert form.getTargetLongValue() == 11;

  }
View Full Code Here

Examples of org.strecks.form.impl.NestedBean

  @Test
  public void testBindingFromTarget()
  {

    NestedBean nestedBean = new NestedBean();
    form.setNestedBean(nestedBean);

    nestedBean.setTargetIntegerValue(3);
    form.setTargetLongValue(11L);

    delegator.bindOutwards(null);

    assert form.getIntegerValue().equals("3");
View Full Code Here

Examples of org.strecks.form.impl.NestedBean

  @Test
  public void testBindingToTarget()
  {

    NestedBean nestedBean = new NestedBean();
    form.setNestedBean(nestedBean);

    form.setIntegerValue("3");
    form.setLongValue("11");

    delegator.bindInwards(null);

    assert nestedBean.getTargetIntegerValue() == 3;
    assert form.getTargetLongValue() == 11;

  }
View Full Code Here

Examples of org.strecks.form.impl.NestedBean

  @Test
  public void testBindingFromTarget()
  {

    NestedBean nestedBean = new NestedBean();
    form.setNestedBean(nestedBean);

    nestedBean.setTargetIntegerValue(3);
    form.setTargetLongValue(11L);

    delegator.bindOutwards(null);

    assert form.getIntegerValue().equals("3");
View Full Code Here

Examples of rocket.beans.rebind.NestedBean

    final BeanTag tag = new BeanTag();
    tag.setElement(element);

    tag.setPlaceHolderResolver(this.getPlaceHolderResolver());

    final NestedBean bean = new NestedBean();
    bean.setFilename(this.getFilename());
    bean.setEagerLoaded(tag.isEagerLoaded());
    bean.setSingleton(tag.isSingleton());
    bean.setTypeName(tag.getClassName());
    bean.setFactoryMethod(tag.getFactoryMethod());
    bean.setInitMethod(tag.getInitMethod());
    bean.setDestroyMethod(tag.getDestroyMethod());

    if (tag.getElement().hasAttribute(Constants.BEAN_ID_ATTRIBUTE)) {
      this.throwNestedBeansMustNotHaveIds(bean);
    }

    bean.setId(this.buildNestedBeanName());

    this.addBean(bean);

    this.addNestedBean();
    this.setParentBean(bean);

    bean.setConstructorValues(this.visitConstructorValues(tag.getConstructorValues()));
    bean.setProperties(this.visitProperties(tag.getProperties()));

    this.removeParentBean();

    return bean;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.