Package org.apache.karaf.features.internal.service

Examples of org.apache.karaf.features.internal.service.FeaturesServiceImpl.addRepository()


                + "  <feature name='f2' version='0.1'><bundle>bundle1</bundle></feature>"
                + "  <feature name='f2' version='0.2'><bundle>bundle2</bundle></feature>"
                + "</features>");

        FeaturesServiceImpl svc = new FeaturesServiceImpl(null, null, new Storage(), null, null, null, null, null, null, null, null, null);
        svc.addRepository(uri);

        assertEquals(feature("f2", "0.2"), svc.getFeature("f2", "[0.1,0.3)"));
        assertEquals(feature("f2", "0.2"), svc.getFeature("f2", "0.0.0"));
        assertEquals(feature("f2", "0.2"), svc.getFeature("f2", "0.2"));
        assertNull(svc.getFeature("f2", "0.3"));
View Full Code Here


        expect(fsl.getInitialBundleStartLevel()).andReturn(50);
        expect(fsl.getStartLevel()).andReturn(100);
        replay(bundleContext, bundle, fsl);

        FeaturesServiceImpl svc = new FeaturesServiceImpl(null, bundleContext, new Storage(), null, null, null, null, null, null, null, null, null);
        svc.addRepository(uri);
        try {
            List<String> features = new ArrayList<String>();
            for (Feature feature : svc.listFeatures()) {
                features.add(feature.getId());
            }
View Full Code Here

        URI uri = createTempRepo("<features name='test' xmlns='http://karaf.apache.org/xmlns/features/v1.0.0'>"
                + "  <featur><bundle>somebundle</bundle></featur></features>");

        FeaturesServiceImpl svc = new FeaturesServiceImpl(null, null, new Storage(), null, null, null, null, null, null, null, null, null);
        try {
            svc.addRepository(uri);
            fail("exception expected");
        } catch (Exception e) {
            assertTrue(e.getMessage().contains("Unable to validate"));
        }
    }
View Full Code Here

        URI uri = createTempRepo("<features name='test' xmlns='http://karaf.apache.org/xmlns/features/v1.0.0'>"
                + "  <feature name='f1'><bundle>file:bundle1</bundle><bundle>file:bundle2</bundle></feature>"
                + "</features>");

        FeaturesServiceImpl svc = new FeaturesServiceImpl(null, null, new Storage(), null, null, null, null, null, null, null, null, null);
        svc.addRepository(uri);
        Feature feature = svc.getFeature("f1");
        Assert.assertNotNull("No feature named fi found", feature);       
        List<BundleInfo> bundles = feature.getBundles();
        Assert.assertEquals(2, bundles.size());
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.