@Test
public void testMultipleElements() throws Exception
{
Bundle b = Skeleton.newMock(new BundleMock("org.apache.aries.tx", new Properties()), Bundle.class);
BundleContext ctx = b.getBundleContext();
NamespaceHandlerRegistry nhri = new NamespaceHandlerRegistryImpl(ctx);
TransactionManager tm = Skeleton.newMock(TransactionManager.class);
TxComponentMetaDataHelperImpl txenhancer = new TxComponentMetaDataHelperImpl();
TxInterceptorImpl txinterceptor = new TxInterceptorImpl();
txinterceptor.setTransactionManager(tm);
txinterceptor.setTxMetaDataHelper(txenhancer);
TxElementHandler namespaceHandler = new TxElementHandler();
namespaceHandler.setTransactionInterceptor(txinterceptor);
namespaceHandler.setTxMetaDataHelper(txenhancer);
Properties props = new Properties();
props.put("osgi.service.blueprint.namespace", "http://aries.apache.org/xmlns/transactions/v1.0.0");
ctx.registerService(NamespaceHandler.class.getName(), namespaceHandler, props);
Parser p = new Parser();
URL bpxml = this.getClass().getResource("aries.xml");
List<URL> bpxmlList = new LinkedList<URL>();
bpxmlList.add(bpxml);
p.parse(bpxmlList);
Set<URI> nsuris = p.getNamespaces();
NamespaceHandlerSet nshandlers = nhri.getNamespaceHandlers(nsuris, b);
p.validate(nshandlers.getSchema());
ComponentDefinitionRegistry cdr = new ComponentDefinitionRegistryImpl();
p.populate(nshandlers, cdr);