Examples of createBean()


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

        
         GenericBeanFactory factory = (GenericBeanFactory) getBean("FactoryDeploymentConfiguredClassLoader");
         bean = factory.createBean();
         assertEquals(deploymentCL, bean.getClass().getClassLoader());
         factory = (GenericBeanFactory) getBean("FactoryBeanConfiguredClassLoader");
         bean = factory.createBean();
         assertEquals(beanCL, bean.getClass().getClassLoader());
         factory = (GenericBeanFactory) getBean("FactoryNotConfiguredClassLoader");
         bean = factory.createBean();
         assertEquals(getClass().getClassLoader(), bean.getClass().getClassLoader());
      }
View Full Code Here

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

         assertEquals(deploymentCL, bean.getClass().getClassLoader());
         factory = (GenericBeanFactory) getBean("FactoryBeanConfiguredClassLoader");
         bean = factory.createBean();
         assertEquals(beanCL, bean.getClass().getClassLoader());
         factory = (GenericBeanFactory) getBean("FactoryNotConfiguredClassLoader");
         bean = factory.createBean();
         assertEquals(getClass().getClassLoader(), bean.getClass().getClassLoader());
      }
      finally
      {
         undeploy(deployment);
View Full Code Here

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

   }

   public void testGenericBeanFactoryLifecycle() throws Throwable
   {
      GenericBeanFactory factory = (GenericBeanFactory) getBean("Name1");
      SimpleBeanWithLifecycle bean = (SimpleBeanWithLifecycle) factory.createBean();
      assertTrue(bean.createInvoked);
      assertTrue(bean.startInvoked);
      assertFalse(bean.notCreateInvoked);
      assertFalse(bean.notStartInvoked);
      factory = (GenericBeanFactory) getBean("Name2");
View Full Code Here

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

      assertTrue(bean.createInvoked);
      assertTrue(bean.startInvoked);
      assertFalse(bean.notCreateInvoked);
      assertFalse(bean.notStartInvoked);
      factory = (GenericBeanFactory) getBean("Name2");
      bean = (SimpleBeanWithLifecycle) factory.createBean();
      assertFalse(bean.createInvoked);
      assertFalse(bean.startInvoked);
      assertTrue(bean.notCreateInvoked);
      assertTrue(bean.notStartInvoked);
   }
View Full Code Here

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

      ControllerContext context1 = assertInstall(0, "Name1", ControllerState.NOT_INSTALLED);
      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

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

      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

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

      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

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

      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

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

      ControllerContext context1 = assertInstall(0, "Name1", ControllerState.NOT_INSTALLED);
      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

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

      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.