You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cl...@apache.org on 2008/11/03 14:28:13 UTC

svn commit: r710054 [1/3] - in /felix/trunk/ipojo: core/src/main/java/org/apache/felix/ipojo/handlers/dependency/ tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ tests/core/service-dependency/src/main/java/o...

Author: clement
Date: Mon Nov  3 05:28:13 2008
New Revision: 710054

URL: http://svn.apache.org/viewvc?rev=710054&view=rev
Log:
Fix issue Felix-801
Dependency callbacks support two new signatures:
- service object, dictionary
- service object, map 
Those signatures allow injecting service properties without injecting the service reference.

Update tests checking the correct behavior of the new types of callbacks.

Modified:
    felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyCallback.java
    felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CollectionCheckService.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/DynCheckServiceProvider.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ListCheckService.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodCheckServiceProvider.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodMultipleCheckService.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedMultipleDependencies.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalDependencies.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedSimpleDependencies.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalDependencies.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedSimpleDependencies.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodMultipleDependencies.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalDependencies.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalMultipleDependencies.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodSimpleDependencies.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalDependencies.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalNoNullableDependencies.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SimpleDependencies.java
    felix/trunk/ipojo/tests/core/service-dependency/src/main/resources/metadata.xml

Modified: felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyCallback.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyCallback.java?rev=710054&r1=710053&r2=710054&view=diff
==============================================================================
--- felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyCallback.java (original)
+++ felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyCallback.java Mon Nov  3 05:28:13 2008
@@ -20,6 +20,10 @@
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
 
 import org.apache.felix.ipojo.util.Callback;
 import org.osgi.framework.ServiceReference;
@@ -161,12 +165,14 @@
                         m_argument = new String[0];
                         return;
                     case 1:
+                        // The callback receives a ServiceReference
                         if (clazzes[0].getName().equals(ServiceReference.class.getName())) {
                             // Callback with a service reference.
                             m_methodObj = methods[i];
                             m_argument = new String[] { ServiceReference.class.getName() };
                             return;
                         }
+                        // The callback receives a Service object
                         if (clazzes[0].getName().equals(m_dependency.getSpecification().getName())) {
                             // Callback with the service object.
                             m_methodObj = methods[i];
@@ -175,12 +181,27 @@
                         }
                         break;
                     case 2:
+                        // The callback receives the service object and the service reference
                         if (clazzes[0].getName().equals(m_dependency.getSpecification().getName()) && clazzes[1].getName().equals(ServiceReference.class.getName())) {
                             // Callback with two arguments.
                             m_methodObj = methods[i];
                             m_argument = new String[] { m_dependency.getSpecification().getName(), ServiceReference.class.getName() };
                             return;
                         }
+                        // The callback receives the service object and the service properties (in a Map)
+                        if (clazzes[0].getName().equals(m_dependency.getSpecification().getName()) && clazzes[1].getName().equals(Map.class.getName())) {
+                            // Callback with two arguments.
+                            m_methodObj = methods[i];
+                            m_argument = new String[] { m_dependency.getSpecification().getName(), Map.class.getName() };
+                            return;
+                        }
+                        // The callback receives the service object and the service properties (in a Dictionary)
+                        if (clazzes[0].getName().equals(m_dependency.getSpecification().getName()) && clazzes[1].getName().equals(Dictionary.class.getName())) {
+                            // Callback with two arguments.
+                            m_methodObj = methods[i];
+                            m_argument = new String[] { m_dependency.getSpecification().getName(), Dictionary.class.getName() };
+                            return;
+                        }
                         break;
                     default:
                         break;
@@ -214,7 +235,13 @@
                 }
                 break;
             case 2 :
-                call(new Object[] {obj, ref});
+                if (m_argument[1].equals(ServiceReference.class.getName())) {
+                    call(new Object[] {obj, ref});
+                } else if (m_argument[1].equals(Dictionary.class.getName())) {
+                    call(new Object[] {obj, getPropertiesInDictionary(ref)});
+                } else {
+                    call(new Object[] {obj, getPropertiesInMap(ref)});
+                }
                 break;
             default : 
                 break;
@@ -222,6 +249,37 @@
     }
 
     /**
+     * Creates a {@link Dictionary} containing service properties of the
+     * given service reference.
+     * @param ref the service reference
+     * @return a {@link Dictionary} containing the service properties.
+     */
+    private Dictionary getPropertiesInDictionary(ServiceReference ref) {
+        String[] keys = ref.getPropertyKeys(); // Can't be null
+        Dictionary dict = new Properties();
+        for (int i = 0; i < keys.length; i++) {
+            dict.put(keys[i], ref.getProperty(keys[i]));
+        }
+        return dict;
+    }
+    
+    /**
+     * Creates a {@link Map} containing service properties of the
+     * given service reference.
+     * @param ref the service reference
+     * @return a {@link Map} containing the service properties.
+     */
+    private Map getPropertiesInMap(ServiceReference ref) {
+        String[] keys = ref.getPropertyKeys(); // Can't be null
+        Map map = new HashMap();
+        for (int i = 0; i < keys.length; i++) {
+            map.put(keys[i], ref.getProperty(keys[i]));
+        }
+        return map;
+    }
+
+
+    /**
      * Call the callback on the given instance with the given argument.
      * 
      * @param instance : the instance on which call the callback
@@ -247,7 +305,13 @@
                 }
                 break;
             case 2 :
-                call(instance, new Object[] {obj, ref});
+                if (m_argument[1].equals(ServiceReference.class.getName())) {
+                    call(instance, new Object[] {obj, ref});
+                } else if (m_argument[1].equals(Dictionary.class.getName())) {
+                    call(instance, new Object[] {obj, getPropertiesInDictionary(ref)});
+                } else {
+                    call(instance, new Object[] {obj, getPropertiesInMap(ref)});
+                }
                 break;
             default : 
                 break;

Modified: felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java?rev=710054&r1=710053&r2=710054&view=diff
==============================================================================
--- felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java (original)
+++ felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java Mon Nov  3 05:28:13 2008
@@ -22,6 +22,7 @@
 import java.util.Comparator;
 import java.util.Dictionary;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.Vector;
 
@@ -197,9 +198,11 @@
                     }
                 } else if (mets[0].getMethodArguments().length == 2) {
                     // The callback receives service object, service reference. Check that the second argument is a service reference
-                    if (!mets[0].getMethodArguments()[1].equals(ServiceReference.class.getName())) {
+                    if (!(mets[0].getMethodArguments()[1].equals(ServiceReference.class.getName()) // callback with (service object, service reference)
+                           || mets[0].getMethodArguments()[1].equals(Dictionary.class.getName()) // callback with (service object, service properties in a dictionary)
+                           || mets[0].getMethodArguments()[1].equals(Map.class.getName()))) { // callback with (service object, service properties in a map)
                         String message =
-                                "The requirement callback " + callbacks[i].getMethodName() + " must have a ServiceReference as the second argument";
+                                "The requirement callback " + callbacks[i].getMethodName() + " must have a ServiceReference, a Dictionary or a Map as the second argument";
                         throw new ConfigurationException(message);
                     }
                     setSpecification(dep, mets[0].getMethodArguments()[0], false); // Just warn if a mismatch is discovered.

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java?rev=710054&r1=710053&r2=710054&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java Mon Nov  3 05:28:13 2008
@@ -18,6 +18,9 @@
  */
 package org.apache.felix.ipojo.test.scenarios.component;
 
+import java.util.Dictionary;
+import java.util.Map;
+
 import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
 import org.osgi.framework.ServiceReference;
 
@@ -27,12 +30,23 @@
     int objectU = 0;
     int refU = 0;
     int bothU = 0;
+    int mapU = 0;
+    int dictU = 0;
     
     
     public void bothUnbind(FooService o, ServiceReference sr) {
         if(sr != null && o != null && o instanceof FooService) { bothU++; }
     }
     
+   public void propertiesDictionaryUnbind(FooService o, Dictionary props) {
+        if (props != null && o != null && o instanceof FooService && props.size() > 0) { dictU++; }
+   }
+    
+   public void propertiesMapUnbind(FooService o, Map props) {
+        if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapU++; }
+   }
+   
+    
     public void refUnbind(ServiceReference sr) {
         if(sr != null) { refU++; }
     }

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java?rev=710054&r1=710053&r2=710054&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java Mon Nov  3 05:28:13 2008
@@ -18,6 +18,8 @@
  */
 package org.apache.felix.ipojo.test.scenarios.component;
 
+import java.util.Dictionary;
+import java.util.Map;
 import java.util.Properties;
 
 import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
@@ -32,6 +34,8 @@
 	int objectB = 0;
 	int refB = 0;
 	int bothB = 0;
+	int mapB = 0;
+	int dictB = 0;
 
 	public boolean check() {
 		return fs.foo();
@@ -47,6 +51,10 @@
 		props.put("objectU", new Integer(objectU));
 		props.put("refU", new Integer(refU));
 		props.put("bothU", new Integer(bothU));
+		props.put("mapB", new Integer(mapB));
+		props.put("dictB", new Integer(dictB));
+		props.put("mapU", new Integer(mapU));
+		props.put("dictU", new Integer(dictU));
 		if (fs != null) {
 		    props.put("result", new Boolean(fs.foo()));
 		    props.put("boolean", new Boolean(fs.getBoolean()));
@@ -79,5 +87,15 @@
     public void bothBind(FooService o, ServiceReference sr) {
 	    if(sr != null && o != null && o instanceof FooService) { bothB++; }
 	}
+    
+    protected void propertiesDictionaryBind(FooService o, Dictionary props) {
+        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictB++; }
+        fs = o;
+    }   
+    
+    protected void propertiesMapBind(FooService o, Map props) {
+        if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapB++; }
+        fs = o;
+    }   
 
 }

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CollectionCheckService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CollectionCheckService.java?rev=710054&r1=710053&r2=710054&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CollectionCheckService.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CollectionCheckService.java Mon Nov  3 05:28:13 2008
@@ -19,7 +19,9 @@
 package org.apache.felix.ipojo.test.scenarios.component;
 
 import java.util.Collection;
+import java.util.Dictionary;
 import java.util.Iterator;
+import java.util.Map;
 import java.util.Properties;
 
 import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
@@ -45,6 +47,8 @@
     int refU = 0;
 
     int bothU = 0;
+    
+    int mapB, mapU, dictB, dictU;
 
     public boolean check() {
         boolean r = fs.size() != 0;
@@ -109,6 +113,11 @@
         props.put("objectU", new Integer(objectU));
         props.put("refU", new Integer(refU));
         props.put("bothU", new Integer(bothU));
+        props.put("mapB", new Integer(mapB));
+        props.put("mapU", new Integer(mapU));
+        props.put("dictB", new Integer(dictB));
+        props.put("dictU", new Integer(dictU));
+        
         props.put("boolean", new Boolean(getBoolean()));
         props.put("int", new Integer(getInt()));
         props.put("long", new Long(getLong()));
@@ -160,5 +169,19 @@
             bothU++;
         }
     }
+    
+    protected void propertiesMapBind(FooService o, Map props) {
+        if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapB++; }
+    }   
+    protected void propertiesMapUnbind(FooService o, Map props) {
+         if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapU++; }
+    }
+    
+    protected void propertiesDictionaryBind(FooService o, Dictionary props) {
+        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictB++; }
+    }   
+    protected void propertiesDictionaryUnbind(FooService o, Dictionary props) {
+        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictU++; }
+    }
 
 }

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/DynCheckServiceProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/DynCheckServiceProvider.java?rev=710054&r1=710053&r2=710054&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/DynCheckServiceProvider.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/DynCheckServiceProvider.java Mon Nov  3 05:28:13 2008
@@ -18,6 +18,8 @@
  */
 package org.apache.felix.ipojo.test.scenarios.component;
 
+import java.util.Dictionary;
+import java.util.Map;
 import java.util.Properties;
 
 import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
@@ -32,6 +34,7 @@
 	int objectB = 0;
 	int refB = 0;
 	int bothB = 0;
+	 int mapB, mapU, dictB, dictU;
 
 	public boolean check() {
 		return fs.foo();
@@ -47,6 +50,11 @@
 		props.put("objectU", new Integer(objectU));
 		props.put("refU", new Integer(refU));
 		props.put("bothU", new Integer(bothU));
+		props.put("mapB", new Integer(mapB));
+        props.put("mapU", new Integer(mapU));
+        props.put("dictB", new Integer(dictB));
+        props.put("dictU", new Integer(dictU));
+        
 		if (fs != null) {
 		    props.put("int", new Integer(fs.getInt()));
 		    if(fs.getObject() != null) { props.put("object", fs.getObject()); }
@@ -75,5 +83,15 @@
     public void bothBind(FooService o, ServiceReference sr) {
 	    if(sr != null && o != null && o instanceof FooService) { bothB++; }
 	}
+    
+    protected void propertiesMapBind(FooService o, Map props) {
+        if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapB++; }
+    }   
+   
+    
+    protected void propertiesDictionaryBind(FooService o, Dictionary props) {
+        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictB++; }
+    }   
+    
 
 }

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ListCheckService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ListCheckService.java?rev=710054&r1=710053&r2=710054&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ListCheckService.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ListCheckService.java Mon Nov  3 05:28:13 2008
@@ -18,7 +18,9 @@
  */
 package org.apache.felix.ipojo.test.scenarios.component;
 
+import java.util.Dictionary;
 import java.util.List;
+import java.util.Map;
 import java.util.Properties;
 
 import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
@@ -44,6 +46,9 @@
     int refU = 0;
 
     int bothU = 0;
+    
+    int mapB, mapU, dictB, dictU;
+
 
     public boolean check() {
         boolean r = fs.size() != 0;
@@ -104,6 +109,12 @@
         props.put("objectU", new Integer(objectU));
         props.put("refU", new Integer(refU));
         props.put("bothU", new Integer(bothU));
+        
+        props.put("mapB", new Integer(mapB));
+        props.put("mapU", new Integer(mapU));
+        props.put("dictB", new Integer(dictB));
+        props.put("dictU", new Integer(dictU));
+        
         props.put("boolean", new Boolean(getBoolean()));
         props.put("int", new Integer(getInt()));
         props.put("long", new Long(getLong()));
@@ -155,5 +166,19 @@
             bothU++;
         }
     }
+    
+    protected void propertiesMapBind(FooService o, Map props) {
+        if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapB++; }
+    }   
+    protected void propertiesMapUnbind(FooService o, Map props) {
+         if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapU++; }
+    }
+    
+    protected void propertiesDictionaryBind(FooService o, Dictionary props) {
+        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictB++; }
+    }   
+    protected void propertiesDictionaryUnbind(FooService o, Dictionary props) {
+        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictU++; }
+    }
 
 }

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodCheckServiceProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodCheckServiceProvider.java?rev=710054&r1=710053&r2=710054&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodCheckServiceProvider.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodCheckServiceProvider.java Mon Nov  3 05:28:13 2008
@@ -18,13 +18,14 @@
  */
 package org.apache.felix.ipojo.test.scenarios.component;
 
+import java.util.Dictionary;
+import java.util.Map;
 import java.util.Properties;
 
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
 import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
 import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
 
 public class MethodCheckServiceProvider implements CheckService {
 	
@@ -36,10 +37,14 @@
 	int objectB = 0;
 	int refB = 0;
 	int bothB = 0;
+	int mapB = 0;
+	int dictB = 0;
 	int simpleU = 0;
 	int objectU = 0;
 	int refU = 0;
 	int bothU = 0;
+	int mapU = 0;
+	int dictU = 0;
 	
     
     public MethodCheckServiceProvider(BundleContext bc) {
@@ -65,10 +70,14 @@
 		props.put("objectB", new Integer(objectB));
 		props.put("refB", new Integer(refB));
 		props.put("bothB", new Integer(bothB));
+	    props.put("mapB", new Integer(mapB));
+	    props.put("dictB", new Integer(dictB));
 		props.put("voidU", new Integer(simpleU));
 		props.put("objectU", new Integer(objectU));
 		props.put("refU", new Integer(refU));
 		props.put("bothU", new Integer(bothU));
+		props.put("mapU", new Integer(mapU));
+		props.put("dictU", new Integer(dictU));
 		
 		if(fs != null) {
 		    if(fs.getObject() != null) { props.put("object", fs.getObject()); }
@@ -104,4 +113,22 @@
 	     if(ref != null && o != null && o instanceof FooService) { bothU++; }
 	     fs = null;
 	}
+    
+    protected void propertiesMapBind(FooService o, Map props) {
+        if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapB++; }
+        fs = o;
+    }   
+    protected void propertiesMapUnbind(FooService o, Map props) {
+         if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapU++; }
+         fs = null;
+    }
+    
+    protected void propertiesDictionaryBind(FooService o, Dictionary props) {
+        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictB++; }
+        fs = o;
+    }   
+    protected void propertiesDictionaryUnbind(FooService o, Dictionary props) {
+         if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictU++; }
+         fs = null;
+    }
 }

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodMultipleCheckService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodMultipleCheckService.java?rev=710054&r1=710053&r2=710054&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodMultipleCheckService.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodMultipleCheckService.java Mon Nov  3 05:28:13 2008
@@ -19,7 +19,9 @@
 package org.apache.felix.ipojo.test.scenarios.component;
 
 import java.util.ArrayList;
+import java.util.Dictionary;
 import java.util.List;
+import java.util.Map;
 import java.util.Properties;
 
 import org.osgi.framework.BundleContext;
@@ -49,6 +51,10 @@
 
     int bothU = 0;
     
+    int mapB = 0;
+    int mapU = 0;
+    int dictB = 0, dictU=0;
+    
     public MethodMultipleCheckService(BundleContext bc) {
         context = bc;
     }
@@ -110,6 +116,10 @@
         props.put("objectU", new Integer(objectU));
         props.put("refU", new Integer(refU));
         props.put("bothU", new Integer(bothU));
+        props.put("mapU", new Integer(mapU));
+        props.put("mapB", new Integer(mapB));
+        props.put("dictU", new Integer(dictU));
+        props.put("dictB", new Integer(dictB));
 		props.put("boolean", new Boolean(getBoolean()));
 		props.put("int", new Integer(getInt()));
 		props.put("long", new Long(getLong()));
@@ -150,5 +160,23 @@
             bothU++;
         }
     }
+    
+    protected void propertiesMapBind(FooService o, Map props) {
+        if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapB++; }
+        fs.add(o);
+    }   
+    protected void propertiesMapUnbind(FooService o, Map props) {
+         if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapU++; }
+         fs.remove(o);
+    }
+    
+    protected void propertiesDictionaryBind(FooService o, Dictionary props) {
+        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictB++; }
+        fs.add(o);
+    }   
+    protected void propertiesDictionaryUnbind(FooService o, Dictionary props) {
+         if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictU++; }
+         fs.remove(o);
+    }
 	
 }

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java?rev=710054&r1=710053&r2=710054&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java Mon Nov  3 05:28:13 2008
@@ -18,6 +18,8 @@
  */
 package org.apache.felix.ipojo.test.scenarios.component;
 
+import java.util.Dictionary;
+import java.util.Map;
 import java.util.Properties;
 
 import org.osgi.framework.ServiceReference;
@@ -44,6 +46,9 @@
     int refU = 0;
 
     int bothU = 0;
+    
+    int mapB, mapU, dictB, dictU;
+
 
     public boolean check() {
         boolean r = fs.length != 0;
@@ -108,6 +113,11 @@
         props.put("int", new Integer(getInt()));
         props.put("long", new Long(getLong()));
         props.put("double", new Double(getDouble()));
+        
+        props.put("mapB", new Integer(mapB));
+        props.put("mapU", new Integer(mapU));
+        props.put("dictB", new Integer(dictB));
+        props.put("dictU", new Integer(dictU));
 
         return props;
     }
@@ -155,5 +165,20 @@
             bothU++;
         }
     }
+    
+    protected void propertiesMapBind(FooService o, Map props) {
+        if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapB++; }
+    }   
+    protected void propertiesMapUnbind(FooService o, Map props) {
+         if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapU++; }
+    }
+    
+    protected void propertiesDictionaryBind(FooService o, Dictionary props) {
+        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictB++; }
+    }   
+    protected void propertiesDictionaryUnbind(FooService o, Dictionary props) {
+        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictU++; }
+    }
+
 
 }

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedMultipleDependencies.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedMultipleDependencies.java?rev=710054&r1=710053&r2=710054&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedMultipleDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedMultipleDependencies.java Mon Nov  3 05:28:13 2008
@@ -31,7 +31,7 @@
 
 public class DelayedMultipleDependencies extends OSGiTestCase {
 
-	ComponentInstance instance1, instance2, instance3, instance4, instance5;
+	ComponentInstance instance1, instance2, instance3, instance4, instance5, instance6, instance7;
 	ComponentInstance fooProvider1, fooProvider2;
 	
 	public void setUp() {
@@ -57,9 +57,19 @@
 			instance4.stop();
 			
 	         Properties i5 = new Properties();
-	            i5.put("instance.name","Both");
-	            instance5 = Utils.getFactoryByName(context, "BothMultipleCheckServiceProvider").createComponentInstance(i5);
-	            instance5.stop();
+	         i5.put("instance.name","Both");
+	         instance5 = Utils.getFactoryByName(context, "BothMultipleCheckServiceProvider").createComponentInstance(i5);
+	         instance5.stop();
+	         
+	         Properties i6 = new Properties();
+             i6.put("instance.name","Map");
+             instance6 = Utils.getFactoryByName(context, "MapMultipleCheckServiceProvider").createComponentInstance(i6);
+             instance6.stop();
+             
+             Properties i7 = new Properties();
+             i7.put("instance.name","Dict");
+             instance7 = Utils.getFactoryByName(context, "DictMultipleCheckServiceProvider").createComponentInstance(i7);
+             instance7.stop();
 		
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
@@ -77,6 +87,8 @@
 		instance3.dispose();
 		instance4.dispose();
 		instance5.dispose();
+		instance6.dispose();
+		instance7.dispose();
 		fooProvider1.dispose();
 		fooProvider2.dispose();
 		instance1 = null;
@@ -84,6 +96,8 @@
 		instance3 = null;
 		instance4 = null;
 		instance5 = null;
+		instance6 = null;
+		instance7 = null;
 		fooProvider1 = null;
 		fooProvider2 = null;
 	}
@@ -330,6 +344,11 @@
         assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
         assertEquals("check both bind callback invocation - 1", ((Integer)props.get("bothB")).intValue(), 2);
         assertEquals("check both unbind callback invocation - 1", ((Integer)props.get("bothU")).intValue(), 0);
+        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
+        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
+        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
+        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
+        
         assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
         assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
         assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0, 0);
@@ -349,6 +368,10 @@
         assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
         assertEquals("check both bind callback invocation - 3", ((Integer)props.get("bothB")).intValue(), 2);
         assertEquals("check both unbind callback invocation - 3", ((Integer)props.get("bothU")).intValue(), 1);
+        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
+        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
+        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
+        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
         assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
         assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
         assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0, 0);
@@ -364,6 +387,132 @@
         instance5.stop();
         context.ungetService(cs_ref);
     }
+	
+	public void testMap() {
+	        instance6.start();
+	        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance6.getInstanceName());
+	        assertNotNull("Check architecture availability", arch_ref);
+	        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
+	        
+	        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance6.getInstanceName());
+	        assertNotNull("Check CheckService availability", cs_ref);
+	        CheckService cs = (CheckService) context.getService(cs_ref);
+	        Properties props = cs.getProps();
+	        //Check properties
+	        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
+	        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
+	        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
+	        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
+	        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
+	        assertEquals("check both bind callback invocation - 1", ((Integer)props.get("bothB")).intValue(), 0);
+	        assertEquals("check both unbind callback invocation - 1", ((Integer)props.get("bothU")).intValue(), 0);
+	        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 2);
+	        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
+	        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
+	        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
+	        
+	        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
+	        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
+	        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0, 0);
+	        
+	        fooProvider1.stop();
+	        
+	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
+	        
+	        cs = (CheckService) context.getService(cs_ref);
+	        props = cs.getProps();
+	        //Check properties
+	        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
+	        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
+	        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
+	        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
+	        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
+	        assertEquals("check both bind callback invocation - 3", ((Integer)props.get("bothB")).intValue(), 0);
+	        assertEquals("check both unbind callback invocation - 3", ((Integer)props.get("bothU")).intValue(), 0);
+	        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 2);
+	        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 1);
+	        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
+	        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
+	        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
+	        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
+	        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0, 0);
+	        
+	        fooProvider2.stop();
+	        
+	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
+	        
+	        id = null;
+	        cs = null;
+	        context.ungetService(arch_ref);
+	        instance6.stop();
+	        context.ungetService(cs_ref);
+	}
+	
+	public void testDict() {
+        instance7.start();
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance7.getInstanceName());
+        assertNotNull("Check architecture availability", arch_ref);
+        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
+        
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance7.getInstanceName());
+        assertNotNull("Check CheckService availability", cs_ref);
+        CheckService cs = (CheckService) context.getService(cs_ref);
+        Properties props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
+        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
+        assertEquals("check both bind callback invocation - 1", ((Integer)props.get("bothB")).intValue(), 0);
+        assertEquals("check both unbind callback invocation - 1", ((Integer)props.get("bothU")).intValue(), 0);
+        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
+        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
+        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 2);
+        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
+        
+        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
+        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
+        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0, 0);
+        
+        fooProvider1.stop();
+        
+        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
+        
+        cs = (CheckService) context.getService(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
+        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
+        assertEquals("check both bind callback invocation - 3", ((Integer)props.get("bothB")).intValue(), 0);
+        assertEquals("check both unbind callback invocation - 3", ((Integer)props.get("bothU")).intValue(), 0);
+        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
+        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
+        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 2);
+        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 1);
+        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
+        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
+        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0, 0);
+        
+        fooProvider2.stop();
+        
+        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
+        
+        id = null;
+        cs = null;
+        context.ungetService(arch_ref);
+        instance7.stop();
+        context.ungetService(cs_ref);
+	}
 
 	
 }

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalDependencies.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalDependencies.java?rev=710054&r1=710053&r2=710054&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalDependencies.java Mon Nov  3 05:28:13 2008
@@ -31,7 +31,7 @@
 
 public class DelayedOptionalDependencies extends OSGiTestCase {
 
-    ComponentInstance instance1, instance2, instance3, instance4, instance5;
+    ComponentInstance instance1, instance2, instance3, instance4, instance5, instance6, instance7;
 
     ComponentInstance fooProvider;
 
@@ -65,6 +65,16 @@
             i5.put("instance.name","Both");
             instance5 = Utils.getFactoryByName(context, "BothOptionalCheckServiceProvider").createComponentInstance(i5);
             instance5.stop();
+            
+            Properties i6 = new Properties();
+            i6.put("instance.name","Map");
+            instance6 = Utils.getFactoryByName(context, "MapOptionalCheckServiceProvider").createComponentInstance(i6);
+            instance6.stop();
+            
+            Properties i7 = new Properties();
+            i7.put("instance.name","Dict");
+            instance7 = Utils.getFactoryByName(context, "DictOptionalCheckServiceProvider").createComponentInstance(i7);
+            instance7.stop();
         } catch (Exception e) {
             fail(e.getMessage());
         }
@@ -77,12 +87,16 @@
         instance3.dispose();
         instance4.dispose();
         instance5.dispose();
+        instance6.dispose();
+        instance7.dispose();
         fooProvider.dispose();
         instance1 = null;
         instance2 = null;
         instance3 = null;
         instance4 = null;
         instance5 = null;
+        instance6 = null;
+        instance7 = null;
         fooProvider = null;
     }
 
@@ -323,6 +337,10 @@
         assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
         assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 1);
         assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
+        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
+        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
+        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
+        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
 
         fooProvider.stop();
 
@@ -342,13 +360,133 @@
         assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
         assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 1);
         assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 1);
+        assertEquals("check map bind callback invocation - 2", ((Integer)props.get("mapB")).intValue(), 0);
+        assertEquals("check map unbind callback invocation - 2", ((Integer)props.get("mapU")).intValue(), 0);
+        assertEquals("check dict bind callback invocation - 2", ((Integer)props.get("dictB")).intValue(), 0);
+        assertEquals("check dict unbind callback invocation - 2", ((Integer)props.get("dictU")).intValue(), 0);
 
         id = null;
         cs = null;
         context.ungetService(arch_ref);
         context.ungetService(cs_ref);
 
-        instance4.stop();
+        instance5.stop();
+    }
+    
+    public void testMap() {
+        instance6.start();
+
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance6.getInstanceName());
+        assertNotNull("Check architecture availability", arch_ref);
+        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
+
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance6.getInstanceName());
+        assertNotNull("Check CheckService availability", cs_ref);
+        CheckService cs = (CheckService) context.getService(cs_ref);
+        Properties props = cs.getProps();
+        // Check properties
+        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
+        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
+        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 0);
+        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
+        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 1);
+        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
+        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
+        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
+
+        fooProvider.stop();
+
+        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
+
+        assertNotNull("Check CheckService availability", cs_ref);
+        cs = (CheckService) context.getService(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
+        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
+        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 0);
+        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 0);
+        assertEquals("check map bind callback invocation - 2", ((Integer)props.get("mapB")).intValue(), 1);
+        assertEquals("check map unbind callback invocation - 2", ((Integer)props.get("mapU")).intValue(), 1);
+        assertEquals("check dict bind callback invocation - 2", ((Integer)props.get("dictB")).intValue(), 0);
+        assertEquals("check dict unbind callback invocation - 2", ((Integer)props.get("dictU")).intValue(), 0);
+
+        id = null;
+        cs = null;
+        context.ungetService(arch_ref);
+        context.ungetService(cs_ref);
+
+        instance6.stop();
+    }
+    
+    public void testDict() {
+        instance7.start();
+
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance7.getInstanceName());
+        assertNotNull("Check architecture availability", arch_ref);
+        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
+
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance7.getInstanceName());
+        assertNotNull("Check CheckService availability", cs_ref);
+        CheckService cs = (CheckService) context.getService(cs_ref);
+        Properties props = cs.getProps();
+        // Check properties
+        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
+        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
+        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 0);
+        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
+        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
+        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
+        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 1);
+        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
+
+        fooProvider.stop();
+
+        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
+
+        assertNotNull("Check CheckService availability", cs_ref);
+        cs = (CheckService) context.getService(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
+        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
+        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 0);
+        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 0);
+        assertEquals("check map bind callback invocation - 2", ((Integer)props.get("mapB")).intValue(), 0);
+        assertEquals("check map unbind callback invocation - 2", ((Integer)props.get("mapU")).intValue(), 0);
+        assertEquals("check dict bind callback invocation - 2", ((Integer)props.get("dictB")).intValue(), 1);
+        assertEquals("check dict unbind callback invocation - 2", ((Integer)props.get("dictU")).intValue(), 1);
+
+        id = null;
+        cs = null;
+        context.ungetService(arch_ref);
+        context.ungetService(cs_ref);
+
+        instance7.stop();
     }
 
 }

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedSimpleDependencies.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedSimpleDependencies.java?rev=710054&r1=710053&r2=710054&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedSimpleDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedSimpleDependencies.java Mon Nov  3 05:28:13 2008
@@ -29,7 +29,7 @@
 import org.osgi.framework.ServiceReference;
 public class DelayedSimpleDependencies extends OSGiTestCase {
 	
-	ComponentInstance instance1, instance2, instance3, instance4, instance5;
+	ComponentInstance instance1, instance2, instance3, instance4, instance5, instance6, instance7;
 	ComponentInstance fooProvider;
 	
 	
@@ -63,6 +63,16 @@
             i5.put("instance.name","Both");
             instance5 = Utils.getFactoryByName(context, "BothCheckServiceProvider").createComponentInstance(i5);
             instance5.stop();
+            
+            Properties i6 = new Properties();
+            i6.put("instance.name","Map");
+            instance6 = Utils.getFactoryByName(context, "MapCheckServiceProvider").createComponentInstance(i6);
+            instance6.stop();
+            
+            Properties i7 = new Properties();
+            i7.put("instance.name","Dict");
+            instance7 = Utils.getFactoryByName(context, "DictCheckServiceProvider").createComponentInstance(i7);
+            instance7.stop();
 		} catch(Exception e) { fail(e.getMessage()); } 
 		
 	}
@@ -73,6 +83,9 @@
 		instance3.dispose();
 		instance4.dispose();
 		instance5.dispose();
+		instance5.dispose();
+		instance6.dispose();
+		instance7.dispose();
 		fooProvider.dispose();
 		instance1 = null;
 		instance2 = null;
@@ -80,6 +93,8 @@
 		instance4 = null;
 		instance4 = null;
 		instance5 = null;
+		instance6 = null;
+		instance7 = null;
 		fooProvider = null;
 	}
 	
@@ -245,6 +260,11 @@
         assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 1);
         assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
         
+        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
+        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
+        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
+        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
+        
         fooProvider.stop();
         
         id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
@@ -257,5 +277,88 @@
         
         instance5.stop();
     }
+	
+	public void testMap() {
+        instance6.start();
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance6.getInstanceName());
+        assertNotNull("Check architecture availability", arch_ref);
+        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        
+        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
+        
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance6.getInstanceName());
+        assertNotNull("Check CheckService availability", cs_ref);
+        CheckService cs = (CheckService) context.getService(cs_ref);
+        Properties props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
+        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
+        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
+        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
+       
+        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 1);
+        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
+        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
+        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
+        
+        fooProvider.stop();
+        
+        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
+        
+        id = null;
+        cs = null;
+        context.ungetService(arch_ref);
+        context.ungetService(cs_ref);
+        
+        instance6.stop();
+    }
+	   public void testDict() {
+	        instance7.start();
+	        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance7.getInstanceName());
+	        assertNotNull("Check architecture availability", arch_ref);
+	        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        
+	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
+	        
+	        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance7.getInstanceName());
+	        assertNotNull("Check CheckService availability", cs_ref);
+	        CheckService cs = (CheckService) context.getService(cs_ref);
+	        Properties props = cs.getProps();
+	        //Check properties
+	        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
+	        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
+	        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
+	        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
+	        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
+	        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
+	        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
+	        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
+	        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
+	       
+	        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
+	        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
+	        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 1);
+	        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
+	        
+	        fooProvider.stop();
+	        
+	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
+	        
+	        id = null;
+	        cs = null;
+	        context.ungetService(arch_ref);
+	        context.ungetService(cs_ref);
+	        
+	        instance7.stop();
+	    }
 
 }

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java?rev=710054&r1=710053&r2=710054&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java Mon Nov  3 05:28:13 2008
@@ -117,6 +117,7 @@
 		
 		// Check dependency metadata
 		assertEquals("Check dependency interface", dhd.getDependencies()[0].getInterface(), FooService.class.getName());
+		assertEquals("Check dependency id", dhd.getDependencies()[0].getId(), FooService.class.getName());
 		assertFalse("Check dependency cardinality", dhd.getDependencies()[0].isMultiple());
 		assertFalse("Check dependency optionality", dhd.getDependencies()[0].isOptional());
 		assertNull("Check dependency ref -1", dhd.getDependencies()[0].getServiceReferences());
@@ -207,6 +208,7 @@
 		
 		// Check dependency metadata
 		assertEquals("Check dependency interface", dhd.getDependencies()[0].getInterface(), FooService.class.getName());
+	    assertEquals("Check dependency id", dhd.getDependencies()[0].getId(), "FooService");
 		assertFalse("Check dependency cardinality", dhd.getDependencies()[0].isMultiple());
 		assertTrue("Check dependency optionality", dhd.getDependencies()[0].isOptional());
 		assertNull("Check dependency ref -1", dhd.getDependencies()[0].getServiceReferences());

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java?rev=710054&r1=710053&r2=710054&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java Mon Nov  3 05:28:13 2008
@@ -30,7 +30,7 @@
 
 public class MethodDelayedMultipleDependencies extends OSGiTestCase {
 
-	ComponentInstance instance3, instance4, instance5;
+	ComponentInstance instance3, instance4, instance5, instance6, instance7;
 	ComponentInstance fooProvider1, fooProvider2;
 	
 	public void setUp() {
@@ -50,6 +50,16 @@
             i5.put("instance.name","Both");
             instance5 = Utils.getFactoryByName(context, "MBothMultipleCheckServiceProvider").createComponentInstance(i5);
             instance5.stop();
+            
+            Properties i6 = new Properties();
+            i6.put("instance.name","Map");
+            instance6 = Utils.getFactoryByName(context, "MMapMultipleCheckServiceProvider").createComponentInstance(i6);
+            instance6.stop();
+            
+            Properties i7 = new Properties();
+            i7.put("instance.name","Dict");
+            instance7 = Utils.getFactoryByName(context, "MDictMultipleCheckServiceProvider").createComponentInstance(i7);
+            instance7.stop();
 		
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
@@ -65,11 +75,15 @@
 		instance3.dispose();
 		instance4.dispose();
 		instance5.dispose();
+		instance6.dispose();
+		instance7.dispose();
 		fooProvider1.dispose();
 		fooProvider2.dispose();
 		instance3 = null;
 		instance4 = null;
 		instance5 = null;
+		instance6 = null;
+		instance7 = null;
 		fooProvider1 = null;
 		fooProvider2 = null;
 	}
@@ -205,6 +219,10 @@
         assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
         assertEquals("check both bind callback invocation - 1", ((Integer)props.get("bothB")).intValue(), 2);
         assertEquals("check both unbind callback invocation - 1", ((Integer)props.get("bothU")).intValue(), 0);
+        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
+        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
+        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
+        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
         assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
         assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
         assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0);
@@ -224,6 +242,10 @@
         assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
         assertEquals("check both bind callback invocation - 3", ((Integer)props.get("bothB")).intValue(), 2);
         assertEquals("check both unbind callback invocation - 3", ((Integer)props.get("bothU")).intValue(), 1);
+        assertEquals("check map bind callback invocation - 3", ((Integer)props.get("mapB")).intValue(), 0);
+        assertEquals("check map unbind callback invocation - 3", ((Integer)props.get("mapU")).intValue(), 0);
+        assertEquals("check dict bind callback invocation - 3", ((Integer)props.get("dictB")).intValue(), 0);
+        assertEquals("check dict unbind callback invocation - 3", ((Integer)props.get("dictU")).intValue(), 0);
         assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
         assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
         assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
@@ -239,6 +261,130 @@
         instance5.stop();
         context.ungetService(cs_ref);
     }
+	
+	public void testMap() {
+        instance6.start();
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance6.getInstanceName());
+        assertNotNull("Check architecture availability", arch_ref);
+        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
+        
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance6.getInstanceName());
+        assertNotNull("Check CheckService availability", cs_ref);
+        CheckService cs = (CheckService) context.getService(cs_ref);
+        Properties props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
+        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
+        assertEquals("check both bind callback invocation - 1", ((Integer)props.get("bothB")).intValue(), 0);
+        assertEquals("check both unbind callback invocation - 1", ((Integer)props.get("bothU")).intValue(), 0);
+        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 2);
+        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
+        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
+        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
+        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
+        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0);
+        
+        fooProvider1.stop();
+        
+        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
+        
+        cs = (CheckService) context.getService(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
+        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
+        assertEquals("check both bind callback invocation - 3", ((Integer)props.get("bothB")).intValue(), 0);
+        assertEquals("check both unbind callback invocation - 3", ((Integer)props.get("bothU")).intValue(), 0);
+        assertEquals("check map bind callback invocation - 3", ((Integer)props.get("mapB")).intValue(), 2);
+        assertEquals("check map unbind callback invocation - 3", ((Integer)props.get("mapU")).intValue(), 1);
+        assertEquals("check dict bind callback invocation - 3", ((Integer)props.get("dictB")).intValue(), 0);
+        assertEquals("check dict unbind callback invocation - 3", ((Integer)props.get("dictU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
+        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
+        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
+        
+        fooProvider2.stop();
+        
+        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
+        
+        id = null;
+        cs = null;
+        context.ungetService(arch_ref);
+        instance6.stop();
+        context.ungetService(cs_ref);
+    }
+	
+	public void testDict() {
+        instance7.start();
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance7.getInstanceName());
+        assertNotNull("Check architecture availability", arch_ref);
+        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
+        
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance7.getInstanceName());
+        assertNotNull("Check CheckService availability", cs_ref);
+        CheckService cs = (CheckService) context.getService(cs_ref);
+        Properties props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
+        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
+        assertEquals("check both bind callback invocation - 1", ((Integer)props.get("bothB")).intValue(), 0);
+        assertEquals("check both unbind callback invocation - 1", ((Integer)props.get("bothU")).intValue(), 0);
+        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
+        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
+        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 2);
+        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
+        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
+        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0);
+        
+        fooProvider1.stop();
+        
+        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
+        
+        cs = (CheckService) context.getService(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
+        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
+        assertEquals("check both bind callback invocation - 3", ((Integer)props.get("bothB")).intValue(), 0);
+        assertEquals("check both unbind callback invocation - 3", ((Integer)props.get("bothU")).intValue(), 0);
+        assertEquals("check map bind callback invocation - 3", ((Integer)props.get("mapB")).intValue(), 0);
+        assertEquals("check map unbind callback invocation - 3", ((Integer)props.get("mapU")).intValue(), 0);
+        assertEquals("check dict bind callback invocation - 3", ((Integer)props.get("dictB")).intValue(), 2);
+        assertEquals("check dict unbind callback invocation - 3", ((Integer)props.get("dictU")).intValue(), 1);
+        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
+        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
+        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
+        
+        fooProvider2.stop();
+        
+        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
+        
+        id = null;
+        cs = null;
+        context.ungetService(arch_ref);
+        instance7.stop();
+        context.ungetService(cs_ref);
+    }
 
 	
 }