Package org.jboss.beans.metadata.plugins.factory

Examples of org.jboss.beans.metadata.plugins.factory.GenericBeanFactory.createBean()


      ControllerContext context2 = assertInstall(1, "aspect", ControllerState.INSTANTIATED);
      assertInstall(0, "simple");
      assertEquals(ControllerState.INSTALLED, context2.getState());

      GenericBeanFactory factory = (GenericBeanFactory) context2.getTarget();
      SimpleBeanWithDependency bean = (SimpleBeanWithDependency) factory.createBean();
      assertEquals("factory", bean.getString());
      assertEquals("String1", bean.getSimpleBean().getString());
   }

   public void genericBeanFactoryDependencyWrongOrder()
View Full Code Here


      ControllerContext context1 = assertInstall(0, "simple");
      ControllerContext context2 = assertInstall(1, "aspect");

      GenericBeanFactory factory = (GenericBeanFactory) context2.getTarget();
      SimpleBeanWithDependency bean = (SimpleBeanWithDependency) factory.createBean();
      assertEquals("factory", bean.getString());
      assertEquals("String1", bean.getSimpleBean().getString());
     
      assertUninstall("simple");
      assertEquals(ControllerState.ERROR, context1.getState());
View Full Code Here

     
      context1 = assertInstall(0, "simple");
      assertEquals(ControllerState.INSTALLED, context2.getState());

      factory = (GenericBeanFactory) context2.getTarget();
      bean = (SimpleBeanWithDependency) factory.createBean();
      assertEquals("factory", bean.getString());
      assertEquals("String1", bean.getSimpleBean().getString());
     
      assertUninstall("aspect");
      assertEquals(ControllerState.INSTALLED, context1.getState());
View Full Code Here

      assertEquals(ControllerState.ERROR, context2.getState());
     
      context2 = assertInstall(1, "aspect");

      factory = (GenericBeanFactory) context2.getTarget();
      bean = (SimpleBeanWithDependency) factory.createBean();
      assertEquals("factory", bean.getString());
      assertEquals("String1", bean.getSimpleBean().getString());
   }

   public void genericBeanFactoryDependencyReinstall()
View Full Code Here

      ControllerContext context1 = assertInstall(0, "Name1", ControllerState.DESCRIBED);
      ControllerContext context2 = assertInstall(1, "Name2");
      assertContext("Name1");
     
      GenericBeanFactory factory1 = (GenericBeanFactory) context1.getTarget();
      SimpleBean bean1 = (SimpleBean) factory1.createBean();
      assertNotNull(bean1);
      assertEquals("String1", bean1.getString());
     
      GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget();
      SimpleBeanWithDependency bean2 = (SimpleBeanWithDependency) factory2.createBean();
View Full Code Here

      SimpleBean bean1 = (SimpleBean) factory1.createBean();
      assertNotNull(bean1);
      assertEquals("String1", bean1.getString());
     
      GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget();
      SimpleBeanWithDependency bean2 = (SimpleBeanWithDependency) factory2.createBean();
      assertNotNull(bean2);
      assertEquals("String2", bean2.getString());
      assertEquals(factory1, bean2.getFactory());
   }
View Full Code Here

      ControllerContext context2 = assertInstall(1, "Name2", ControllerState.INSTANTIATED);
      ControllerContext context1 = assertInstall(0, "Name1");
      assertEquals(ControllerState.INSTALLED, context2.getState());
     
      GenericBeanFactory factory1 = (GenericBeanFactory) context1.getTarget();
      SimpleBean bean1 = (SimpleBean) factory1.createBean();
      assertNotNull(bean1);
      assertEquals("String1", bean1.getString());
     
      GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget();
      SimpleBeanWithDependency bean2 = (SimpleBeanWithDependency) factory2.createBean();
View Full Code Here

      SimpleBean bean1 = (SimpleBean) factory1.createBean();
      assertNotNull(bean1);
      assertEquals("String1", bean1.getString());
     
      GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget();
      SimpleBeanWithDependency bean2 = (SimpleBeanWithDependency) factory2.createBean();
      assertNotNull(bean2);
      assertEquals("String2", bean2.getString());
      assertEquals(factory1, bean2.getFactory());
   }
View Full Code Here

      ControllerContext context1 = assertInstall(0, "Name1", ControllerState.DESCRIBED);
      ControllerContext context2 = assertInstall(1, "Name2");
      assertContext("Name1");
     
      GenericBeanFactory factory1 = (GenericBeanFactory) context1.getTarget();
      SimpleBean bean1 = (SimpleBean) factory1.createBean();
      assertNotNull(bean1);
      assertEquals("String1", bean1.getString());
     
      GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget();
      SimpleBeanWithDependency bean2 = (SimpleBeanWithDependency) factory2.createBean();
View Full Code Here

      SimpleBean bean1 = (SimpleBean) factory1.createBean();
      assertNotNull(bean1);
      assertEquals("String1", bean1.getString());
     
      GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget();
      SimpleBeanWithDependency bean2 = (SimpleBeanWithDependency) factory2.createBean();
      assertNotNull(bean2);
      assertEquals("String2", bean2.getString());
      assertEquals(factory1, bean2.getFactory());

      assertUninstall("Name1");
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.