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