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());
assertEquals("(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=myUnit))", reference.getFilter());
Map<String,Object> props = new HashMap<String, Object>();
props.put(PersistenceContextProvider.PERSISTENCE_CONTEXT_TYPE, PersistenceContextType.TRANSACTION);
Skeleton.getSkeleton(manager).assertCalled(
new MethodCall(PersistenceContextProvider.class, "registerContext", "myUnit", clientBundle, Map.class));