Package org.jboss.beans.metadata.spi.factory

Examples of org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData$PropertyMap


      buildMetaData();
   }

   protected void buildMetaData()
   {
      GenericBeanFactoryMetaData metaData1 = new GenericBeanFactoryMetaData("Name1", SimpleBeanImpl.class.getName());
      metaData1.setMode(ControllerMode.ON_DEMAND);
      addBeanProperty(metaData1, new AbstractPropertyMetaData("string", "String1"));

      GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanWithDependencyImpl.class.getName());
      addBeanProperty(metaData2, new AbstractPropertyMetaData("string", "String2"));
      addBeanProperty(metaData2, new AbstractPropertyMetaData("factory", new AbstractDependencyValueMetaData("Name1")));

      setBeanMetaDatas(new BeanMetaData[] { getBeanMetaData(metaData1), getBeanMetaData(metaData2) });
   }
View Full Code Here


      assertEquals(expected, bean1.getBeans());
   }

   protected void setupBeanMetaDatas() throws Throwable
   {
      GenericBeanFactoryMetaData metaData1 = new GenericBeanFactoryMetaData("Name1", SimpleBeanImpl.class.getName());
      metaData1.setFactoryClass(GenericBeanFactoryRepositoryBF.class.getName());

      ArrayList<CallbackMetaData> installs = new ArrayList<CallbackMetaData>();
      AbstractCallbackMetaData install = new InstallCallbackMetaData();
      install.setMethodName("addGenericBeanFactory");
      installs.add(install);
      metaData1.setInstallCallbacks(installs);

      ArrayList<CallbackMetaData> uninstalls = new ArrayList<CallbackMetaData>();
      AbstractCallbackMetaData uninstall = new UninstallCallbackMetaData();
      uninstall.setMethodName("removeGenericBeanFactory");
      uninstalls.add(uninstall);
      metaData1.setUninstallCallbacks(uninstalls);

      AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanImpl.class.getName());
      setBeanMetaDatas(new BeanMetaData[] { getBeanMetaData(metaData1), metaData2 });
   }
View Full Code Here

      assertEquals(cl, object.getClass().getClassLoader());
   }

   public void testUnPrivilegedBean() throws Throwable
   {
      GenericBeanFactoryMetaData gbfmd = new GenericBeanFactoryMetaData();
      gbfmd.setName("NonPrivileged");
      gbfmd.setBean(PrivilegedBean.class.getName());
     
      AbstractKernelDeployment deployment = new AbstractKernelDeployment();
      deployment.setName("test");
      deployment.setBeanFactories(Collections.singletonList((BeanMetaDataFactory) gbfmd));
      deploy(deployment);
View Full Code Here

      }
   }

   public void testAliasAndBeanFactory() throws Exception
   {
      GenericBeanFactoryMetaData bean = unmarshalBeanFactory("AliasWithBeanFactory.xml");
      Set<AliasMetaData> aliases = bean.getAliases();
      assertNotNull(aliases);
      assertFalse(aliases.isEmpty());
      assertEquals("SimpleAliasWithBF", aliases.iterator().next().getAliasValue());
   }
View Full Code Here

      assertEquals("SimpleAliasWithBF", aliases.iterator().next().getAliasValue());
   }

   public void testAliasAndBeanFactoryJavaBean() throws Exception
   {
      GenericBeanFactoryMetaData bean = unmarshalBeanFactory("AliasWithBeanFactoryJavaBean.xml");
      Set<AliasMetaData> aliases = bean.getAliases();
      assertNotNull(aliases);
      assertFalse(aliases.isEmpty());
      assertInstanceOf(aliases.iterator().next().getAliasValue(), ArrayList.class);
   }
View Full Code Here

   protected void buildMetaData()
   {
      AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanWithLifecycle.class.getName());

      GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanWithLifecycle.class.getName());
      HashSet<DependencyMetaData> depends = new HashSet<DependencyMetaData>();
      depends.add(new AbstractDependencyMetaData("Name1"));
      metaData2.setDepends(depends);

      setBeanMetaDatas(new BeanMetaData[] { metaData1, getBeanMetaData(metaData2) });
   }
View Full Code Here

      buildMetaData();
   }

   protected void buildMetaData()
   {
      GenericBeanFactoryMetaData metaData1 = new GenericBeanFactoryMetaData("Name1", SimpleBeanImpl.class.getName());
      addBeanProperty(metaData1, new AbstractPropertyMetaData("string", "String1"));
      HashSet<SupplyMetaData> supplies = new HashSet<SupplyMetaData>();
      supplies.add(new AbstractSupplyMetaData("WhatIWant"));
      metaData1.setSupplies(supplies);

      GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanImpl.class.getName());
      addBeanProperty(metaData2, new AbstractPropertyMetaData("string", "String2"));
      HashSet<DemandMetaData> demands = new HashSet<DemandMetaData>();
      demands.add(new AbstractDemandMetaData("WhatIWant"));
      metaData2.setDemands(demands);

      setBeanMetaDatas(new BeanMetaData[] { getBeanMetaData(metaData1), getBeanMetaData(metaData2) });
   }
View Full Code Here

*/
public class BeanFactoryTestCase extends AbstractXMLTest
{
   public void testBeanFactoryWithName() throws Exception
   {
      GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithName.xml");
      assertEquals("Name1", factory.getName());
      assertEquals("Dummy", factory.getBean());
      assertNull(factory.getMode());
      assertNull(factory.getFactoryClass());
      assertNull(factory.getAccessMode());
      assertNull(factory.getAnnotations());
      assertNull(factory.getClassLoader());
      assertNull(factory.getConstructor());
      assertNull(factory.getProperties());
      assertNull(factory.getCreate());
      assertNull(factory.getStart());
      assertNull(factory.getDemands());
      assertNull(factory.getSupplies());
      assertNull(factory.getInstalls());
      assertNull(factory.getUninstalls());
      assertNull(factory.getInstallCallbacks());
      assertNull(factory.getUninstallCallbacks());
   }
View Full Code Here

      assertNull(factory.getUninstallCallbacks());
   }

   public void testBeanFactoryWithClass() throws Exception
   {
      GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithClass.xml");
      assertNull(factory.getName());
      assertEquals(Object.class.getName(), factory.getBean());
      assertNull(factory.getMode());
      assertNull(factory.getFactoryClass());
      assertNull(factory.getAccessMode());
      assertNull(factory.getAnnotations());
      assertNull(factory.getClassLoader());
      assertNull(factory.getConstructor());
      assertNull(factory.getProperties());
      assertNull(factory.getCreate());
      assertNull(factory.getStart());
      assertNull(factory.getDemands());
      assertNull(factory.getSupplies());
      assertNull(factory.getInstalls());
      assertNull(factory.getUninstalls());
      assertNull(factory.getInstallCallbacks());
      assertNull(factory.getUninstallCallbacks());
   }
View Full Code Here

      assertNull(factory.getUninstallCallbacks());
   }

   public void testBeanFactoryWithFactoryClass() throws Exception
   {
      GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithFactoryClass.xml");
      assertNull(factory.getName());
      assertEquals("Dummy", factory.getBean());
      assertNull(factory.getMode());
      assertEquals("MyFactory", factory.getFactoryClass());
      assertNull(factory.getAccessMode());
      assertNull(factory.getAnnotations());
      assertNull(factory.getClassLoader());
      assertNull(factory.getConstructor());
      assertNull(factory.getProperties());
      assertNull(factory.getCreate());
      assertNull(factory.getStart());
      assertNull(factory.getDemands());
      assertNull(factory.getSupplies());
      assertNull(factory.getInstalls());
      assertNull(factory.getUninstalls());
      assertNull(factory.getInstallCallbacks());
      assertNull(factory.getUninstallCallbacks());
   }
View Full Code Here

TOP

Related Classes of org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData$PropertyMap

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.