aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From timothyjw...@apache.org
Subject svn commit: r1198699 - in /aries/trunk/blueprint: blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/ blueprint-cm/src/main/resources/OSGI-INF/blueprint/ blueprint-core/src/main/java/org/apache/aries/blueprint/container/ blueprint-ites...
Date Mon, 07 Nov 2011 10:53:01 GMT
Author: timothyjward
Date: Mon Nov  7 10:53:01 2011
New Revision: 1198699

URL: http://svn.apache.org/viewvc?rev=1198699&view=rev
Log:
ARIES-773: Blueprint changes for isolated config admin

Added:
    aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BaseBlueprintContainerBTCustomizerTest.java
Modified:
    aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmNamespaceHandler.java
    aries/trunk/blueprint/blueprint-cm/src/main/resources/OSGI-INF/blueprint/blueprint-cm.xml
    aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
    aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintContainer2BTCustomizerTest.java
    aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintContainerBTCustomizerTest.java

Modified: aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmNamespaceHandler.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmNamespaceHandler.java?rev=1198699&r1=1198698&r2=1198699&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmNamespaceHandler.java
(original)
+++ aries/trunk/blueprint/blueprint-cm/src/main/java/org/apache/aries/blueprint/compendium/cm/CmNamespaceHandler.java
Mon Nov  7 10:53:01 2011
@@ -42,9 +42,12 @@ import org.apache.aries.blueprint.mutabl
 import org.apache.aries.blueprint.mutable.MutableIdRefMetadata;
 import org.apache.aries.blueprint.mutable.MutableMapMetadata;
 import org.apache.aries.blueprint.mutable.MutableRefMetadata;
+import org.apache.aries.blueprint.mutable.MutableReferenceMetadata;
 import org.apache.aries.blueprint.mutable.MutableValueMetadata;
+import org.apache.aries.blueprint.reflect.PassThroughMetadataImpl;
 import org.apache.aries.blueprint.utils.PlaceholdersUtils;
 import org.apache.aries.blueprint.utils.ServiceListener;
+import org.osgi.framework.BundleContext;
 import org.osgi.service.blueprint.container.ComponentDefinitionException;
 import org.osgi.service.blueprint.reflect.BeanMetadata;
 import org.osgi.service.blueprint.reflect.BeanProperty;
@@ -54,6 +57,7 @@ import org.osgi.service.blueprint.reflec
 import org.osgi.service.blueprint.reflect.MapMetadata;
 import org.osgi.service.blueprint.reflect.Metadata;
 import org.osgi.service.blueprint.reflect.RefMetadata;
+import org.osgi.service.blueprint.reflect.ReferenceMetadata;
 import org.osgi.service.blueprint.reflect.RegistrationListener;
 import org.osgi.service.blueprint.reflect.ServiceMetadata;
 import org.osgi.service.blueprint.reflect.ValueMetadata;
@@ -202,7 +206,7 @@ public class CmNamespaceHandler implemen
         metadata.setInitMethod("init");
         metadata.setDestroyMethod("destroy");
         metadata.addProperty("blueprintContainer", createRef(context, "blueprintContainer"));
-        metadata.addProperty("configAdmin", createConfigAdminProxy(context));
+        metadata.addProperty("configAdmin", createConfigurationAdminRef(context));
         metadata.addProperty("persistentId", createValue(context, element.getAttribute(PERSISTENT_ID_ATTRIBUTE)));
         String prefix = element.hasAttribute(PLACEHOLDER_PREFIX_ATTRIBUTE)
                                     ? element.getAttribute(PLACEHOLDER_PREFIX_ATTRIBUTE)
@@ -318,7 +322,7 @@ public class CmNamespaceHandler implemen
         factoryMetadata.setRuntimeClass(CmManagedServiceFactory.class);
         factoryMetadata.setInitMethod("init");
         factoryMetadata.setDestroyMethod("destroy");
-        factoryMetadata.addProperty("configAdmin", createConfigAdminProxy(context));
+        factoryMetadata.addProperty("configAdmin", createConfigurationAdminRef(context));
         factoryMetadata.addProperty("blueprintContainer", createRef(context, "blueprintContainer"));
         factoryMetadata.addProperty("factoryPid", createValue(context, element.getAttribute(FACTORY_PID_ATTRIBUTE)));
         String autoExport = element.hasAttribute(AUTO_EXPORT_ATTRIBUTE) ? element.getAttribute(AUTO_EXPORT_ATTRIBUTE)
: AUTO_EXPORT_DEFAULT;
@@ -422,7 +426,7 @@ public class CmNamespaceHandler implemen
             metadata.setDestroyMethod("destroy");
         }
         metadata.addProperty("blueprintContainer", createRef(context, "blueprintContainer"));
-        metadata.addProperty("configAdmin", createConfigAdminProxy(context));
+        metadata.addProperty("configAdmin", createConfigurationAdminRef(context));
         metadata.addProperty("managedObjectManager", createRef(context, MANAGED_OBJECT_MANAGER_NAME));
         metadata.addProperty("persistentId", createValue(context, persistentId));
         if (element.hasAttribute(UPDATE_ATTRIBUTE)) {
@@ -451,7 +455,7 @@ public class CmNamespaceHandler implemen
             metadata.setDestroyMethod("destroy");
         }
         metadata.addProperty("blueprintContainer", createRef(context, "blueprintContainer"));
-        metadata.addProperty("configAdmin", createConfigAdminProxy(context));
+        metadata.addProperty("configAdmin", createConfigurationAdminRef(context));
         metadata.addProperty("managedObjectManager", createRef(context, MANAGED_OBJECT_MANAGER_NAME));
         metadata.addProperty("persistentId", createValue(context, persistentId));
         String updateStrategy = element.getAttribute(UPDATE_STRATEGY_ATTRIBUTE);
@@ -468,22 +472,6 @@ public class CmNamespaceHandler implemen
         return component;
     }
 
-    /**
-     * Create a reference to the ConfigurationAdmin service if not already done
-     * and add it to the registry.
-     *
-     * @param context the parser context
-     * @return a metadata pointing to the config admin
-     */
-    private Metadata createConfigAdminProxy(ParserContext context) {
-        MutableBeanMetadata bean = context.createMetadata(MutableBeanMetadata.class);
-        bean.setRuntimeClass(CmNamespaceHandler.class);
-        bean.setFactoryMethod("getConfigAdmin");
-        bean.setActivation(MutableBeanMetadata.ACTIVATION_LAZY);
-        bean.setScope(MutableBeanMetadata.SCOPE_PROTOTYPE);
-        return bean;
-    }
-
     private void registerManagedObjectManager(ParserContext context, ComponentDefinitionRegistry
registry) {
         if (registry.getComponentDefinition(MANAGED_OBJECT_MANAGER_NAME) == null) {
             MutableBeanMetadata beanMetadata = context.createMetadata(MutableBeanMetadata.class);
@@ -494,6 +482,10 @@ public class CmNamespaceHandler implemen
         }
     }
     
+    private MutableReferenceMetadata createConfigurationAdminRef(ParserContext context) {
+        return createServiceRef(getBlueprintBundleContext(context), context, ConfigurationAdmin.class,
"(objectClass=" + ConfigurationAdmin.class.getName() + ")");
+    }
+    
     private static ValueMetadata createValue(ParserContext context, String value) {
         return createValue(context, value, null);
     }
@@ -510,6 +502,21 @@ public class CmNamespaceHandler implemen
         m.setComponentId(value);
         return m;
     }
+    
+    private MutableReferenceMetadata createServiceRef(BundleContext ctx, ParserContext context,
Class<?> cls, String filter) {
+        MutableReferenceMetadata m = context.createMetadata(MutableReferenceMetadata.class);
+        m.setRuntimeInterface(cls);
+        m.setInterface(cls.getName());
+        m.setBundleContext(ctx);
+        m.setActivation(ReferenceMetadata.ACTIVATION_EAGER);
+        m.setAvailability(ReferenceMetadata.AVAILABILITY_MANDATORY);
+        
+        if (filter != null) {
+            m.setFilter(filter);
+        }
+        
+        return m;
+    }
 
     private static IdRefMetadata createIdRef(ParserContext context, String value) {
         MutableIdRefMetadata m = context.createMetadata(MutableIdRefMetadata.class);
@@ -590,4 +597,24 @@ public class CmNamespaceHandler implemen
         return interfaceNames;
     }
 
+    /**
+     * Returns the bundle context within the parser context
+     * 
+     * @param parserContext the parser context
+     * @return the bundle context within the parser context (if it exists)
+     */
+    private BundleContext getBlueprintBundleContext(ParserContext parserContext)
+    {
+        BundleContext blueprintContext = null;
+        
+        if (parserContext != null) {
+            ComponentMetadata metaData = parserContext.getComponentDefinitionRegistry().getComponentDefinition("blueprintBundleContext");
+            
+            if (metaData != null) {
+                blueprintContext = (BundleContext)((PassThroughMetadataImpl)metaData).getObject();
  
+            }   
+        }
+        
+        return blueprintContext;
+    }
 }

Modified: aries/trunk/blueprint/blueprint-cm/src/main/resources/OSGI-INF/blueprint/blueprint-cm.xml
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-cm/src/main/resources/OSGI-INF/blueprint/blueprint-cm.xml?rev=1198699&r1=1198698&r2=1198699&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-cm/src/main/resources/OSGI-INF/blueprint/blueprint-cm.xml
(original)
+++ aries/trunk/blueprint/blueprint-cm/src/main/resources/OSGI-INF/blueprint/blueprint-cm.xml
Mon Nov  7 10:53:01 2011
@@ -28,11 +28,7 @@
                 </array>
             </entry>
         </service-properties>
-        <bean class="org.apache.aries.blueprint.compendium.cm.CmNamespaceHandler">
-            <property name="configAdmin">
-                <reference interface="org.osgi.service.cm.ConfigurationAdmin"/>
-            </property>
-        </bean>
+        <bean class="org.apache.aries.blueprint.compendium.cm.CmNamespaceHandler"/>
     </service>
 
 </blueprint>

Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1198699&r1=1198698&r2=1198699&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
(original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
Mon Nov  7 10:53:01 2011
@@ -563,6 +563,10 @@ public class BlueprintContainerImpl impl
                 }
             }
         }
+
+        synchronized (satisfiablesLock) {
+            satisfiables = null;
+        }
     }
 
     private void untrackServiceReference(SatisfiableRecipe recipe, Set<String> stopped,
Map<String, List<SatisfiableRecipe>> dependencies) {

Added: aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BaseBlueprintContainerBTCustomizerTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BaseBlueprintContainerBTCustomizerTest.java?rev=1198699&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BaseBlueprintContainerBTCustomizerTest.java
(added)
+++ aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BaseBlueprintContainerBTCustomizerTest.java
Mon Nov  7 10:53:01 2011
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.aries.blueprint.itests;
+
+import static org.apache.aries.itest.ExtraOptions.mavenBundleInTest;
+
+import java.io.InputStream;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+
+import org.apache.aries.itest.AbstractIntegrationTest;
+import org.apache.aries.itest.RichBundleContext;
+import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
+import org.osgi.util.tracker.ServiceTracker;
+
+public abstract class BaseBlueprintContainerBTCustomizerTest extends AbstractIntegrationTest

+{
+    protected Map<String, String> getCompositeManifest() {
+        Map<String, String> compositeManifest = new HashMap<String, String>();
+        compositeManifest.put(Constants.BUNDLE_SYMBOLICNAME, "test-composite");
+        compositeManifest.put(Constants.BUNDLE_VERSION, "1.0.0");
+        // this import-package is used by the blueprint.sample
+        compositeManifest.put(Constants.IMPORT_PACKAGE, "org.osgi.service.blueprint;version=\"[1.0.0,2.0.0)\",
org.osgi.service.blueprint.container;version=1.0, org.osgi.service.cm");
+        // this export-package is used by pax junit runner as it needs to see the blueprint
sample package 
+        // for the test after the blueprint sample is started.
+        compositeManifest.put(Constants.EXPORT_PACKAGE, "org.apache.aries.blueprint.sample");
+        
+        return compositeManifest;
+    }
+    
+    protected Bundle installConfigurationAdmin(BundleContext ctx) throws Exception {
+        
+        Bundle configAdminBundle = null;
+        // make sure we don't have a config admin already present
+        ServiceTracker tracker = new ServiceTracker(ctx, ctx.createFilter("(" + Constants.OBJECTCLASS
+ "=" + ConfigurationAdmin.class.getName() + ")"), null);
+        tracker.open();
+            Object cfgAdminService = tracker.waitForService(5000);
+        tracker.close();
+        
+        if (cfgAdminService == null) {
+            MavenArtifactProvisionOption cfgAdminOption = mavenBundleInTest(getClass().getClassLoader(),
"org.apache.felix", "org.apache.felix.configadmin");
+            InputStream cfgAdminStream = new URL(cfgAdminOption.getURL()).openStream();
+            
+            configAdminBundle = ctx.installBundle(cfgAdminOption.getURL(), cfgAdminStream);
           
+        }
+
+        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);
+    }
+}

Modified: aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintContainer2BTCustomizerTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintContainer2BTCustomizerTest.java?rev=1198699&r1=1198698&r2=1198699&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintContainer2BTCustomizerTest.java
(original)
+++ aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintContainer2BTCustomizerTest.java
Mon Nov  7 10:53:01 2011
@@ -24,10 +24,8 @@ import static org.ops4j.pax.exam.contain
 import java.io.InputStream;
 import java.net.URL;
 import java.util.HashMap;
-import java.util.Hashtable;
 import java.util.Map;
 
-import org.apache.aries.itest.AbstractIntegrationTest;
 import org.apache.aries.itest.RichBundleContext;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -38,8 +36,6 @@ import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.Configuration;
-import org.osgi.service.cm.ConfigurationAdmin;
 import org.osgi.service.framework.CompositeBundle;
 import org.osgi.service.framework.CompositeBundleFactory;
 
@@ -52,17 +48,10 @@ import static org.apache.aries.itest.Ext
  *
  */
 @RunWith(JUnit4TestRunner.class)
-public class BlueprintContainer2BTCustomizerTest extends AbstractIntegrationTest {
+public class BlueprintContainer2BTCustomizerTest extends BaseBlueprintContainerBTCustomizerTest
{
 
     @Test
     public void test() throws Exception {
-        // Create a config to check the property placeholder
-        ConfigurationAdmin ca = context().getService(ConfigurationAdmin.class);        
-        Configuration cf = ca.getConfiguration("blueprint-sample-placeholder", null);
-        Hashtable props = new Hashtable();
-        props.put("key.b", "10");
-        cf.update(props);
-
         
         ServiceReference sr = bundleContext.getServiceReference("org.osgi.service.framework.CompositeBundleFactory");
         if (sr != null) {
@@ -74,14 +63,7 @@ public class BlueprintContainer2BTCustom
             // frameworkConfig.put("osgi.console", "10000");
             
             // construct composite bundle information
-            Map<String, String> compositeManifest = new HashMap<String, String>();
-            compositeManifest.put(Constants.BUNDLE_SYMBOLICNAME, "test-composite");
-            compositeManifest.put(Constants.BUNDLE_VERSION, "1.0.0");
-            // this import-package is used by the blueprint.sample
-            compositeManifest.put(Constants.IMPORT_PACKAGE, "org.osgi.service.blueprint;version=\"[1.0.0,2.0.0)\",
org.osgi.service.blueprint.container;version=1.0");
-            // this export-package is used by pax junit runner as it needs to see the blueprint
sample package 
-            // for the test after the blueprint sample is started.
-            compositeManifest.put(Constants.EXPORT_PACKAGE, "org.apache.aries.blueprint.sample");
+            Map<String, String> compositeManifest = getCompositeManifest();
             
             CompositeBundle cb = cbf.installCompositeBundle(frameworkConfig, "test-composite",
compositeManifest);
 
@@ -92,9 +74,15 @@ public class BlueprintContainer2BTCustom
             InputStream is = new URL(mapo.getURL()).openStream();
             Bundle bundle = compositeBundleContext.installBundle(mapo.getURL(), is);
             assertNotNull(bundle);
+            // install and start the cfg admin bundle in the isolated framework
+            Bundle cfgAdminBundle = installConfigurationAdmin(compositeBundleContext);
+            assertNotNull(cfgAdminBundle);            
             
-            // start the composite bundle then the blueprint sample
+            // start the composite bundle, the config admin then the blueprint sample
             cb.start();
+            cfgAdminBundle.start();         
+            // create a config to check the property placeholder
+            applyCommonConfiguration(compositeBundleContext);
             bundle.start();
             
             // start the blueprint bundle and it should detect the previously started blueprint
sample
@@ -115,7 +103,7 @@ public class BlueprintContainer2BTCustom
         return testOptions(
             paxLogging("DEBUG"),
             Helper.blueprintBundles(false),
-//            vmOption ("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006"),
+            //vmOption ("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006"),
             equinox().version("3.5.0")
         );
     }

Modified: aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintContainerBTCustomizerTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintContainerBTCustomizerTest.java?rev=1198699&r1=1198698&r2=1198699&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintContainerBTCustomizerTest.java
(original)
+++ aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintContainerBTCustomizerTest.java
Mon Nov  7 10:53:01 2011
@@ -24,10 +24,8 @@ import static org.ops4j.pax.exam.contain
 import java.io.InputStream;
 import java.net.URL;
 import java.util.HashMap;
-import java.util.Hashtable;
 import java.util.Map;
 
-import org.apache.aries.itest.AbstractIntegrationTest;
 import org.apache.aries.itest.RichBundleContext;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -38,8 +36,6 @@ import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.Configuration;
-import org.osgi.service.cm.ConfigurationAdmin;
 import org.osgi.service.framework.CompositeBundle;
 import org.osgi.service.framework.CompositeBundleFactory;
 
@@ -53,17 +49,10 @@ import static org.apache.aries.itest.Ext
  *
  */
 @RunWith(JUnit4TestRunner.class)
-public class BlueprintContainerBTCustomizerTest extends AbstractIntegrationTest {
+public class BlueprintContainerBTCustomizerTest extends BaseBlueprintContainerBTCustomizerTest
{
 
     @Test
     public void test() throws Exception {
-        // Create a config to check the property placeholder
-        ConfigurationAdmin ca = context().getService(ConfigurationAdmin.class);
-        Configuration cf = ca.getConfiguration("blueprint-sample-placeholder", null);
-        Hashtable props = new Hashtable();
-        props.put("key.b", "10");
-        cf.update(props);
-
         
         ServiceReference sr = bundleContext.getServiceReference("org.osgi.service.framework.CompositeBundleFactory");
         if (sr != null) {
@@ -75,14 +64,7 @@ public class BlueprintContainerBTCustomi
             // frameworkConfig.put("osgi.console", "10000");
             
             // construct composite bundle information
-            Map<String, String> compositeManifest = new HashMap<String, String>();
-            compositeManifest.put(Constants.BUNDLE_SYMBOLICNAME, "test-composite");
-            compositeManifest.put(Constants.BUNDLE_VERSION, "1.0.0");
-            // this import-package is used by the blueprint.sample
-            compositeManifest.put(Constants.IMPORT_PACKAGE, "org.osgi.service.blueprint;version=\"[1.0.0,2.0.0)\",
org.osgi.service.blueprint.container;version=1.0");
-            // this export-package is used by pax junit runner as it needs to see the blueprint
sample package 
-            // for the test after the blueprint sample is started.
-            compositeManifest.put(Constants.EXPORT_PACKAGE, "org.apache.aries.blueprint.sample");
+            Map<String, String> compositeManifest = getCompositeManifest();
             
             CompositeBundle cb = cbf.installCompositeBundle(frameworkConfig, "test-composite",
compositeManifest);
 
@@ -93,9 +75,13 @@ public class BlueprintContainerBTCustomi
             InputStream is = new URL(mapo.getURL()).openStream();
             Bundle bundle = compositeBundleContext.installBundle(mapo.getURL(), is);
             assertNotNull(bundle);
+            Bundle configAdminBundle = installConfigurationAdmin(compositeBundleContext);
+            assertNotNull(configAdminBundle);
             
-            // start the composite bundle then the blueprint sample
+            // start the composite bundle, config admin then the blueprint sample
             cb.start();
+            configAdminBundle.start();
+            applyCommonConfiguration(compositeBundleContext);
             bundle.start();
 
             // do the test



Mime
View raw message