Package org.apache.aries.itest

Examples of org.apache.aries.itest.RichBundleContext


            Bundle blueprintBundle = context().getBundleByName("org.apache.aries.blueprint");
            blueprintBundle.start();
            Thread.sleep(2000);

            // do the test
            Helper.testBlueprintContainer(new RichBundleContext(compositeBundleContext), bundle);
           
            // unget the service
            bundleContext.ungetService(sr);
        }
    }
View Full Code Here


            // start the composite bundle then the blueprint sample
            cb.start();
            bundle.start();

            // do the test
            Helper.testBlueprintContainer(new RichBundleContext(compositeBundleContext), bundle);
           
            // unget the service
            bundleContext.ungetService(sr);
           
        }
View Full Code Here

     * @throws Exception
     */
    @Test
    public void validatePostResolveTransform() throws Exception {
       
        RichBundleContext ctx = new RichBundleContext(bundleContext);
        PostResolveTransformer transformer = ctx.getService(PostResolveTransformer.class);
        Assert.assertNotNull("Unable to locate transformer", transformer);
       
        /**
         * Try processing deployed content that doesn't have any import for the
         * org.osgi.service.cm package, the resultant imports should be unaffected.
View Full Code Here

     * @throws Exception
     */
    @Before
    public void constructApplications() throws Exception {   
       
        Assert.assertNotNull("Could not find Maven URL handler", (new RichBundleContext(context())).getService(URLStreamHandlerService.class, "url.handler.protocol=mvn", 300000));
        MavenArtifactProvisionOption configAdminProvisionOption = mavenBundleInTest(getClass().getClassLoader(), "org.apache.felix", "org.apache.felix.configadmin");
        Assert.assertNotNull("Unable to lookup config admin maven bundle", configAdminProvisionOption);
        URL configAdminUrl = new URL(configAdminProvisionOption.getURL());
       
        ZipFixture helloWorldBluePrintEba = ArchiveFixture
View Full Code Here

       
        //assert we have the ManagedService exposed
        Assert.assertNotNull("Missing the Managed service", ctx.getService(ManagedService.class, "(" + Constants.SERVICE_PID + "=" + pid + ")"));
        //now just make sure we can see it through the context of our config admin bundle context (should be in the same scope)
        ServiceReference ref = ctx.getServiceReference(ConfigurationAdmin.class.getName());
        Assert.assertNotNull("Couldn't find the ManagedService using the ConfigAdmin bundle context", new RichBundleContext(ref.getBundle().getBundleContext()).getService(ManagedService.class, "(" + Constants.SERVICE_PID + "=" + pid + ")"));
       
        //make sure we have the helloworld service registered
        HelloWorld helloWorldBluePrint = IsolationTestUtils.findHelloWorldService(ctx);
        Assert.assertNotNull("Missing the HelloWorld service", helloWorldBluePrint);       
    }
View Full Code Here

        private AriesApplicationContext applicationContext;
        private RichBundleContext bundleContext;
       
        public Context(AriesApplicationContext applicationContext, BundleContext bundleContext) {
            this.applicationContext = applicationContext;
            this.bundleContext = new RichBundleContext(bundleContext);
        }
View Full Code Here

            Bundle blueprintBundle = context().getBundleByName("org.apache.aries.blueprint");
            blueprintBundle.start();
            Thread.sleep(2000);

            // do the test
            Helper.testBlueprintContainer(new RichBundleContext(compositeBundleContext), bundle);
           
            // unget the service
            bundleContext.ungetService(sr);
        }
    }
View Full Code Here

        return configAdminBundle;
    }
   
    protected void applyCommonConfiguration(BundleContext ctx) throws Exception {

        ConfigurationAdmin ca = (new RichBundleContext(ctx)).getService(ConfigurationAdmin.class);       
        Configuration cf = ca.getConfiguration("blueprint-sample-placeholder", null);
        Hashtable props = new Hashtable();
        props.put("key.b", "10");
        cf.update(props);
    }
View Full Code Here

            configAdminBundle.start();
            applyCommonConfiguration(compositeBundleContext);
            bundle.start();

            // do the test
            Helper.testBlueprintContainer(new RichBundleContext(compositeBundleContext), bundle);
           
            // unget the service
            bundleContext.ungetService(sr);
           
        }
View Full Code Here

TOP

Related Classes of org.apache.aries.itest.RichBundleContext

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.