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

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


      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());
   }

   public void genericBeanFactoryDependencyCorrectOrder()
View Full Code Here


      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

         assertEquals(beanCL, bean.getClass().getClassLoader());
         bean = getBean("NotConfiguredClassLoader");
         assertEquals(getClass().getClassLoader(), bean.getClass().getClassLoader());
        
         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");
View Full Code Here

        
         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

         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

   }

   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

      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

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.