Package org.apache.aries.blueprint.container

Examples of org.apache.aries.blueprint.container.NamespaceHandlerRegistry


    @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);
     
View Full Code Here


  static ModellingManager _modellingManager;
 
  @BeforeClass
  public static void setup() {
    BundleContext mockCtx = Skeleton.newMock(new BundleContextMock(), BundleContext.class);
    NamespaceHandlerRegistry nhri = new NamespaceHandlerRegistryImpl (mockCtx);
    ParserService parserService = new ParserServiceImpl(nhri);
    mockCtx.registerService(ParserService.class.getName(), parserService, new Hashtable<String, String>());
    _parserProxy = new ParserProxyImpl();
    ((ParserProxyImpl)_parserProxy).setParserService(parserService);
    ((ParserProxyImpl)_parserProxy).setBundleContext(mockCtx);
View Full Code Here

TOP

Related Classes of org.apache.aries.blueprint.container.NamespaceHandlerRegistry

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.