Package org.jboss.test.xml.pojoserver.deployment

Examples of org.jboss.test.xml.pojoserver.deployment.AbstractKernelDeployment


      }
   }

   public void testStaticFactoryDependency() throws Exception
   {
      AbstractKernelDeployment deployment = unmarshal();

      assertNotNull(deployment);
      assertNotNull(deployment.getBeans());
      assertEquals(2, deployment.getBeans().size());

      AbstractBeanMetaData bean = (AbstractBeanMetaData)deployment.getBeans().get(0);
      assertEquals("SimpleBean1", bean.getName());
      assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanImpl", bean.getBean());
      assertNotNull(bean.getConstructor());
      ConstructorMetaData ctor = bean.getConstructor();
      assertEquals("org.jboss.test.kernel.xml.support.SimpleBeanFactory", ctor.getFactoryClass());
      assertEquals("staticCreateSimpleBean", ctor.getFactoryMethod());
      assertNotNull(ctor.getParameters());
      assertEquals(1, ctor.getParameters().size());
      AbstractParameterMetaData param = (AbstractParameterMetaData)ctor.getParameters().get(0);
      assertNotNull(param);
      assertEquals("org.jboss.test.kernel.xml.support.SimpleBean", param.getType());
      assertNotNull(param.getValue());
      assertTrue(param.getValue() instanceof AbstractDependencyValueMetaData);
      AbstractDependencyValueMetaData dependency = (AbstractDependencyValueMetaData)param.getValue();
      assertEquals("SimpleBean2", dependency.getValue());

      bean = (AbstractBeanMetaData)deployment.getBeans().get(1);
      assertEquals("SimpleBean2", bean.getName());
      assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanImpl", bean.getBean());
   }
View Full Code Here


      TypeBinding deploymentType = schemaBinding.getType(deploymentTypeQName);
      deploymentType.setHandler(new DefaultElementHandler()
      {
         public Object startElement(Object parent, QName name, ElementBinding element)
         {
            return new AbstractKernelDeployment();
         }
      });

      // deployment has a list beans
      deploymentType.pushInterceptor(beanQName, new DefaultElementInterceptor()
      {
         public void add(Object parent, Object child, QName name)
         {
            AbstractKernelDeployment deployment = (AbstractKernelDeployment) parent;
            AbstractBeanMetaData bean = (AbstractBeanMetaData) child;
            List beans = deployment.getBeans();
            if (beans == null)
            {
               beans = new ArrayList();
               deployment.setBeans(beans);
            }
            beans.add(bean);
         }
      });

      // deployment has a list beanfactorys
      deploymentType.pushInterceptor(beanFactoryQName, new DefaultElementInterceptor()
      {
         public void add(Object parent, Object child, QName name)
         {
            AbstractKernelDeployment deployment = (AbstractKernelDeployment) parent;
            AbstractBeanMetaData bean = (AbstractBeanMetaData) child;
            List beans = deployment.getBeans();
            if (beans == null)
            {
               beans = new ArrayList();
               deployment.setBeans(beans);
            }
            beans.add(bean);
         }
      });
View Full Code Here

   }
   */

   public void testAttributeDependency() throws Exception
   {
      AbstractKernelDeployment deployment = unmarshal();

      assertNotNull(deployment.getBeans());
      assertEquals(2, deployment.getBeans().size());

      AbstractBeanMetaData bean = deployment.getBeans().get(0);
      assertEquals("SimpleBean1", bean.getName());
      assertEquals("org.jboss.test.kernel.xml.support.SimpleBeanImpl", bean.getBean());
      assertNotNull(bean.getProperties());
      assertEquals(1, bean.getProperties().size());
      AbstractPropertyMetaData prop = bean.getProperties().iterator().next();
      assertNotNull(prop);
      assertEquals("other", prop.getName());
      assertTrue(prop.getValue() instanceof AbstractDependencyValueMetaData);
      AbstractDependencyValueMetaData dependency = (AbstractDependencyValueMetaData)prop.getValue();
      assertEquals("SimpleBean2", dependency.getValue());

      bean = deployment.getBeans().get(1);
      assertEquals("SimpleBean2", bean.getName());
      assertEquals("org.jboss.test.kernel.xml.support.SimpleBeanImpl", bean.getBean());
      assertNotNull(bean.getConstructor());
      ConstructorMetaData ctor = bean.getConstructor();
      assertNotNull(ctor.getParameters());
View Full Code Here

      assertEquals("Bean2", param.getValue().getUnderlyingValue());
   }

   public void testAttributeDependencyDependentState() throws Exception
   {
      AbstractKernelDeployment deployment = unmarshal();

      assertNotNull(deployment.getBeans());
      assertEquals(2, deployment.getBeans().size());

      AbstractBeanMetaData bean = deployment.getBeans().get(0);
      assertEquals("SimpleBean1", bean.getName());
      assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanImpl", bean.getBean());
      assertNotNull(bean.getProperties());
      assertEquals(1, bean.getProperties().size());
      AbstractPropertyMetaData prop = bean.getProperties().iterator().next();
      assertNotNull(prop);
      assertEquals("other", prop.getName());
      assertTrue(prop.getValue() instanceof AbstractDependencyValueMetaData);
      AbstractDependencyValueMetaData dependency = (AbstractDependencyValueMetaData)prop.getValue();
      assertEquals("SimpleBean2", dependency.getValue());

      bean = deployment.getBeans().get(1);
      assertEquals("SimpleBean2", bean.getName());
      assertEquals("org.jboss.test.kernel.xml.support.SimpleBeanImpl", bean.getBean());
      assertNotNull(bean.getConstructor());
      ConstructorMetaData ctor = bean.getConstructor();
      assertNotNull(ctor.getParameters());
View Full Code Here

      assertEquals("Bean2", param.getValue().getUnderlyingValue());
   }

   public void testConfigure() throws Exception
   {
      AbstractKernelDeployment deployment = unmarshal();

      assertNotNull(deployment.getBeans());
      assertEquals(1, deployment.getBeans().size());

      AbstractBeanMetaData bean = deployment.getBeans().get(0);
      assertEquals("SimpleBean1", bean.getName());
      assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanImpl", bean.getBean());
      assertNotNull(bean.getProperties());
      assertEquals(18, bean.getProperties().size());
View Full Code Here

      }
   }

   public void testConfigureNested() throws Exception
   {
      AbstractKernelDeployment deployment = unmarshal();

      assertNotNull(deployment.getBeans());
      assertEquals(1, deployment.getBeans().size());

      AbstractBeanMetaData bean = deployment.getBeans().get(0);
      assertEquals("SimpleBean1", bean.getName());
      assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanImpl", bean.getBean());
      assertNotNull(bean.getProperties());
      assertEquals(19, bean.getProperties().size());
View Full Code Here

      }
   }

   public void testConstructorDependency() throws Exception
   {
      AbstractKernelDeployment deployment = unmarshal();

      assertNotNull(deployment.getBeans());
      assertEquals(2, deployment.getBeans().size());

      AbstractBeanMetaData bean = deployment.getBeans().get(0);
      assertEquals("SimpleBean1", bean.getName());
      assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanImpl", bean.getBean());
      assertNotNull(bean.getConstructor());
      ConstructorMetaData ctor = bean.getConstructor();
      assertNotNull(ctor.getParameters());
      assertEquals(1, ctor.getParameters().size());
      Object obj = ctor.getParameters().get(0);
      assertNotNull(obj);
      assertTrue(obj instanceof AbstractParameterMetaData);
      AbstractParameterMetaData param = (AbstractParameterMetaData) obj;
      assertEquals("org.jboss.test.kernel.xml.support.SimpleBean", param.getType());
      assertTrue(param.getValue() instanceof AbstractDependencyValueMetaData);
      AbstractDependencyValueMetaData dependency = (AbstractDependencyValueMetaData)param.getValue();
      assertEquals("SimpleBean2", dependency.getValue());

      bean = deployment.getBeans().get(1);
      assertEquals("SimpleBean2", bean.getName());
      assertEquals("org.jboss.test.kernel.xml.support.SimpleBeanImpl", bean.getBean());
   }
View Full Code Here

   }
   */

   public void testFactoryDependency() throws Exception
   {
      AbstractKernelDeployment deployment = unmarshal();

      assertNotNull(deployment);
      assertNotNull(deployment.getBeans());
      assertEquals(3, deployment.getBeans().size());

      AbstractBeanMetaData bean = deployment.getBeans().get(0);
      assertEquals("SimpleBean1", bean.getName());
      assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanImpl", bean.getBean());
      assertNotNull(bean.getConstructor());
      ConstructorMetaData ctor = bean.getConstructor();
      assertEquals("createSimpleBean", ctor.getFactoryMethod());
      assertNotNull(ctor.getFactory());
      assertEquals("SimpleBeanFactory", ctor.getFactory().getUnderlyingValue());
      assertNotNull(ctor.getParameters());
      assertEquals(1, ctor.getParameters().size());
      AbstractParameterMetaData param = ctor.getParameters().get(0);
      assertEquals("org.jboss.test.xml.pojoserver.SimpleBean", param.getType());
      assertTrue(param.getValue() instanceof AbstractDependencyValueMetaData);
      AbstractDependencyValueMetaData dependency = (AbstractDependencyValueMetaData)param.getValue();
      assertEquals("SimpleBean2", dependency.getValue());

      bean = deployment.getBeans().get(1);
      assertEquals("SimpleBean2", bean.getName());
      assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanImpl", bean.getBean());

      bean = deployment.getBeans().get(2);
      assertEquals("SimpleBeanFactory", bean.getName());
      assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanFactory", bean.getBean());
   }
View Full Code Here

   }
   */

   public void testStaticFactoryDependency() throws Exception
   {
      AbstractKernelDeployment deployment = unmarshal();

      assertNotNull(deployment);
      assertNotNull(deployment.getBeans());
      assertEquals(2, deployment.getBeans().size());

      AbstractBeanMetaData bean = deployment.getBeans().get(0);
      assertEquals("SimpleBean1", bean.getName());
      assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanImpl", bean.getBean());
      assertNotNull(bean.getConstructor());
      ConstructorMetaData ctor = bean.getConstructor();
      assertEquals("org.jboss.test.kernel.xml.support.SimpleBeanFactory", ctor.getFactoryClass());
      assertEquals("staticCreateSimpleBean", ctor.getFactoryMethod());
      assertNotNull(ctor.getParameters());
      assertEquals(1, ctor.getParameters().size());
      AbstractParameterMetaData param = ctor.getParameters().get(0);
      assertNotNull(param);
      assertEquals("org.jboss.test.kernel.xml.support.SimpleBean", param.getType());
      assertNotNull(param.getValue());
      assertTrue(param.getValue() instanceof AbstractDependencyValueMetaData);
      AbstractDependencyValueMetaData dependency = (AbstractDependencyValueMetaData)param.getValue();
      assertEquals("SimpleBean2", dependency.getValue());

      bean = deployment.getBeans().get(1);
      assertEquals("SimpleBean2", bean.getName());
      assertEquals("org.jboss.test.xml.pojoserver.SimpleBeanImpl", bean.getBean());
   }
View Full Code Here

      TypeBinding deploymentType = schemaBinding.getType(deploymentTypeQName);
      deploymentType.setHandler(new DefaultElementHandler()
      {
         public Object startElement(Object parent, QName name, ElementBinding element)
         {
            return new AbstractKernelDeployment();
         }
      });

      // deployment has a list beans
      deploymentType.pushInterceptor(beanQName, new DefaultElementInterceptor()
      {
         public void add(Object parent, Object child, QName name)
         {
            AbstractKernelDeployment deployment = (AbstractKernelDeployment) parent;
            AbstractBeanMetaData bean = (AbstractBeanMetaData) child;
            List<AbstractBeanMetaData> beans = deployment.getBeans();
            if (beans == null)
            {
               beans = new ArrayList<AbstractBeanMetaData>();
               deployment.setBeans(beans);
            }
            beans.add(bean);
         }
      });

      // deployment has a list beanfactorys
      deploymentType.pushInterceptor(beanFactoryQName, new DefaultElementInterceptor()
      {
         public void add(Object parent, Object child, QName name)
         {
            AbstractKernelDeployment deployment = (AbstractKernelDeployment) parent;
            AbstractBeanMetaData bean = (AbstractBeanMetaData) child;
            List<AbstractBeanMetaData> beans = deployment.getBeans();
            if (beans == null)
            {
               beans = new ArrayList<AbstractBeanMetaData>();
               deployment.setBeans(beans);
            }
            beans.add(bean);
         }
      });
View Full Code Here

TOP

Related Classes of org.jboss.test.xml.pojoserver.deployment.AbstractKernelDeployment

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.