}
@Test
public void testIndexedArgs_110() {
Element e = getTestElement("withIndexedUnitArg", root_110);
BeanMetadata input = new BeanMetadataImpl();
Object output = sut.decorate(e, input, parserCtx);
assertEquals("Wrong number of arguments",
1 ,input.getArguments().size());
assertEquals("Wrong class type", "javax.persistence.EntityManagerFactory",
((BeanArgument)input.getArguments().get(0)).getValueType());
assertEquals("Wrong index", 0,
((BeanArgument)input.getArguments().get(0)).getIndex());
ReferenceMetadata reference = (ReferenceMetadata) ((BeanArgument)input.getArguments().get(0)).getValue();
assertEquals(EntityManagerFactory.class.getName(), reference.getInterface());
assertEquals("(&(!(org.apache.aries.jpa.proxy.factory=*))(osgi.unit.name=myUnit))", reference.getFilter());
Skeleton.getSkeleton(manager).assertSkeletonNotCalled();
assertTrue(registeredComponents.isEmpty());
e = getTestElement("withIndexedContextArg", root_110);
input = new BeanMetadataImpl();
output = sut.decorate(e, input, parserCtx);
assertEquals("Wrong number of arguments",
1 ,input.getArguments().size());
assertEquals("Wrong type", "javax.persistence.EntityManager",
((BeanArgument)input.getArguments().get(0)).getValueType());
assertEquals("Wrong index", 1,
((BeanArgument)input.getArguments().get(0)).getIndex());
BeanMetadata innerBean = (BeanMetadata) ((BeanArgument)input.getArguments().get(0)).getValue();
assertEquals("createEntityManager", innerBean.getFactoryMethod());
assertEquals("internalClose", innerBean.getDestroyMethod());
assertEquals(1, registeredComponents.size());
reference = (ReferenceMetadata) registeredComponents.get(0);
assertEquals(EntityManagerFactory.class.getName(), reference.getInterface());