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 [2/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...

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalDependencies.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/MethodDelayedOptionalDependencies.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/MethodDelayedOptionalDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalDependencies.java Mon Nov  3 05:28:13 2008
@@ -30,7 +30,7 @@
 
 public class MethodDelayedOptionalDependencies extends OSGiTestCase {
 
-    ComponentInstance instance3, instance4, instance5;
+    ComponentInstance instance3, instance4, instance5, instance6, instance7;
 
     ComponentInstance fooProvider;
 
@@ -54,6 +54,16 @@
             i5.put("instance.name","Both");
             instance5 = Utils.getFactoryByName(context, "MBothOptionalCheckServiceProvider").createComponentInstance(i5);
             instance5.stop();
+            
+            Properties i6 = new Properties();
+            i6.put("instance.name","Map");
+            instance6 = Utils.getFactoryByName(context, "MMapOptionalCheckServiceProvider").createComponentInstance(i6);
+            instance6.stop();
+            
+            Properties i7 = new Properties();
+            i7.put("instance.name","Dict");
+            instance7 = Utils.getFactoryByName(context, "MDictOptionalCheckServiceProvider").createComponentInstance(i7);
+            instance7.stop();
         } catch (Exception e) {
             fail(e.getMessage());
         }
@@ -64,10 +74,14 @@
         instance3.dispose();
         instance4.dispose();
         instance5.dispose();
+        instance6.dispose();
+        instance7.dispose();
         fooProvider.dispose();
         instance3 = null;
         instance4 = null;
         instance5 = null;
+        instance6 = null;
+        instance7= null;
         fooProvider = null;
     }
 
@@ -194,6 +208,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();
 
@@ -213,13 +231,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/MethodDelayedSimpleDependencies.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/MethodDelayedSimpleDependencies.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/MethodDelayedSimpleDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedSimpleDependencies.java Mon Nov  3 05:28:13 2008
@@ -30,7 +30,7 @@
 
 public class MethodDelayedSimpleDependencies extends OSGiTestCase {
 	
-	ComponentInstance instance3, instance4, instance5;
+	ComponentInstance instance3, instance4, instance5, instance6, instance7;
 	ComponentInstance fooProvider;
 	
 	
@@ -54,6 +54,16 @@
             i5.put("instance.name","Both");
             instance5 = Utils.getFactoryByName(context, "MBothCheckServiceProvider").createComponentInstance(i5);
             instance5.stop();
+            
+            Properties i6 = new Properties();
+            i6.put("instance.name","Map");
+            instance6 = Utils.getFactoryByName(context, "MMapCheckServiceProvider").createComponentInstance(i6);
+            instance6.stop();
+            
+            Properties i7 = new Properties();
+            i7.put("instance.name","Dictionary");
+            instance7 = Utils.getFactoryByName(context, "MDictCheckServiceProvider").createComponentInstance(i7);
+            instance7.stop();
 		} catch(Exception e) { fail(e.getMessage()); } 
 		
 	}
@@ -62,10 +72,14 @@
 		instance3.dispose();
 		instance4.dispose();
 		instance5.dispose();
+		instance6.dispose();
+		instance7.dispose();
 		fooProvider.dispose();
 		instance3 = null;
 		instance4 = null;
 		instance5 = null;
+		instance6 = null;
+		instance7 = null;
 		fooProvider = null;
 	}
 	
@@ -176,7 +190,90 @@
         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();
+	        
+	        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/MethodMultipleDependencies.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/MethodMultipleDependencies.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/MethodMultipleDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodMultipleDependencies.java Mon Nov  3 05:28:13 2008
@@ -30,7 +30,7 @@
 
 public class MethodMultipleDependencies extends OSGiTestCase {
 
-	ComponentInstance instance3, instance4, instance5;
+	ComponentInstance instance3, instance4, instance5, instance6, instance7;
 	ComponentInstance fooProvider1, fooProvider2;
 	
 	public void setUp() {
@@ -56,6 +56,14 @@
 			Properties i5 = new Properties();
             i5.put("instance.name","Both");
             instance5 = Utils.getFactoryByName(context, "MBothMultipleCheckServiceProvider").createComponentInstance(i5);
+            
+            Properties i6 = new Properties();
+            i6.put("instance.name","Map");
+            instance6 = Utils.getFactoryByName(context, "MMapMultipleCheckServiceProvider").createComponentInstance(i6);
+            
+            Properties i7 = new Properties();
+            i7.put("instance.name","Dictionary");
+            instance7 = Utils.getFactoryByName(context, "MDictMultipleCheckServiceProvider").createComponentInstance(i7);
 		} catch(Exception e) { fail(e.getMessage()); }
 		
 	}
@@ -64,11 +72,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;
 	}
@@ -248,6 +260,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(), 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);
         assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
         assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
         assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
@@ -267,6 +283,10 @@
         assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
         assertEquals("check both bind callback invocation - 2", ((Integer)props.get("bothB")).intValue(), 2);
         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(), 0);
+        assertEquals("check dict unbind callback invocation -2", ((Integer)props.get("dictU")).intValue(), 0);
         assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
         assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
         assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
@@ -286,6 +306,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);
@@ -300,6 +324,182 @@
         context.ungetService(arch_ref);
         context.ungetService(cs_ref);
     }
+	
+	   public void testMap() {
+	        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.INVALID);
+	        
+	        fooProvider1.start();
+	        
+	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        assertTrue("Check instance validity - 2", 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(), 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);
+	        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
+	        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
+	        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
+	        
+	        fooProvider2.start();
+	        
+	        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 - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
+	        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 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(), 2);
+	        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);
+	        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
+	        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
+	        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
+	        
+	        fooProvider1.stop();
+	        
+	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        assertTrue("Check instance validity - 4", 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 - 5", id.getState() == ComponentInstance.INVALID);
+	        
+	        id = null;
+	        cs = null;
+	        context.ungetService(arch_ref);
+	        context.ungetService(cs_ref);
+	    }
+	   
+       public void testDict() {
+           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.INVALID);
+           
+           fooProvider1.start();
+           
+           id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+           assertTrue("Check instance validity - 2", 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(), 1);
+           assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
+           assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
+           assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
+           assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
+           
+           fooProvider2.start();
+           
+           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 - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
+           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 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(), 2);
+           assertEquals("check dict unbind callback invocation -2", ((Integer)props.get("dictU")).intValue(), 0);
+           assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
+           assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
+           assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
+           
+           fooProvider1.stop();
+           
+           id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+           assertTrue("Check instance validity - 4", 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 - 5", id.getState() == ComponentInstance.INVALID);
+           
+           id = null;
+           cs = null;
+           context.ungetService(arch_ref);
+           context.ungetService(cs_ref);
+       }
 
 	
 }

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalDependencies.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/MethodOptionalDependencies.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/MethodOptionalDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalDependencies.java Mon Nov  3 05:28:13 2008
@@ -30,7 +30,7 @@
 
 public class MethodOptionalDependencies extends OSGiTestCase {
 
-    ComponentInstance instance3, instance4, instance5;
+    ComponentInstance instance3, instance4, instance5, instance6, instance7;
 
     ComponentInstance fooProvider;
 
@@ -52,6 +52,14 @@
             Properties i5 = new Properties();
             i5.put("instance.name","Both");
             instance5 = Utils.getFactoryByName(context, "MBothOptionalCheckServiceProvider").createComponentInstance(i5);
+            
+            Properties i6 = new Properties();
+            i6.put("instance.name","Map");
+            instance6 = Utils.getFactoryByName(context, "MMapOptionalCheckServiceProvider").createComponentInstance(i6);
+            
+            Properties i7 = new Properties();
+            i7.put("instance.name","Dictionary");
+            instance7 = Utils.getFactoryByName(context, "MDictOptionalCheckServiceProvider").createComponentInstance(i7);
         } catch (Exception e) {
             fail(e.getMessage());
         }
@@ -61,10 +69,14 @@
         instance3.dispose();
         instance4.dispose();
         instance5.dispose();
+        instance6.dispose();
+        instance7.dispose();
         fooProvider.dispose();
         instance3 = null;
         instance4 = null;
         instance5 = null;
+        instance6 = null;
+        instance7 = null;
         fooProvider = null;
     }
 
@@ -262,5 +274,157 @@
         context.ungetService(arch_ref);
         context.ungetService(cs_ref);
     }
+    
+    public void testMap() {
+        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
+        assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
+        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(), 0);
+        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
+
+        fooProvider.start();
+
+        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
+        assertTrue("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(), 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);
+
+        fooProvider.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
+        assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
+        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 ref bind callback invocation -3", ((Integer) props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation -3", ((Integer) props.get("refU")).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(), 1);
+        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);
+
+        id = null;
+        cs = null;
+        context.ungetService(arch_ref);
+        context.ungetService(cs_ref);
+    }
+    
+    public void testDict() {
+        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
+        assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
+        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(), 0);
+        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
+
+        fooProvider.start();
+
+        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
+        assertTrue("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(), 0);
+
+        fooProvider.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
+        assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
+        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 ref bind callback invocation -3", ((Integer) props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation -3", ((Integer) props.get("refU")).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(), 1);
+        assertEquals("check dict unbind callback invocation -3", ((Integer)props.get("dictU")).intValue(), 1);
+
+        id = null;
+        cs = null;
+        context.ungetService(arch_ref);
+        context.ungetService(cs_ref);
+    }
 
 }

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalMultipleDependencies.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/MethodOptionalMultipleDependencies.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/MethodOptionalMultipleDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalMultipleDependencies.java Mon Nov  3 05:28:13 2008
@@ -52,6 +52,7 @@
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
 			instance4 = Utils.getFactoryByName(context, "MRefOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
+			
 		} catch(Exception e) { fail(e.getMessage()); }
 		
 	}

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodSimpleDependencies.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/MethodSimpleDependencies.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/MethodSimpleDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodSimpleDependencies.java Mon Nov  3 05:28:13 2008
@@ -30,7 +30,7 @@
 
 public class MethodSimpleDependencies extends OSGiTestCase {
 	
-	ComponentInstance instance3, instance4, instance5;
+	ComponentInstance instance3, instance4, instance5, instance6, instance7;
 	ComponentInstance fooProvider;
 	
 	public void setUp() {
@@ -54,6 +54,14 @@
             i5.put("instance.name","Both");
             instance5 = Utils.getFactoryByName(context, "MBothCheckServiceProvider").createComponentInstance(i5);
             assertNotNull("check instance 5", instance5);
+            
+            Properties i6 = new Properties();
+            i6.put("instance.name","Map");
+            instance6 = Utils.getFactoryByName(context, "MMapCheckServiceProvider").createComponentInstance(i6);
+            
+            Properties i7 = new Properties();
+            i7.put("instance.name","Dictionary");
+            instance7 = Utils.getFactoryByName(context, "MDictCheckServiceProvider").createComponentInstance(i7);
 		} catch(Exception e) { fail(e.getMessage()); }
 		
 	}
@@ -62,10 +70,14 @@
 		instance3.dispose();
 		instance4.dispose();
 		instance5.dispose();
-		fooProvider.dispose();
-		instance3 = null;
-		instance4 = null;
-		instance5 = null;
+		instance6.dispose();
+        instance7.dispose();
+        fooProvider.dispose();
+        instance3 = null;
+        instance4 = null;
+        instance5 = null;
+        instance6 = null;
+        instance7 = null;
 		fooProvider = null;
 	}
 
@@ -180,5 +192,88 @@
         context.ungetService(arch_ref);
         context.ungetService(cs_ref);
     }
+	
+	public void testMap() {
+        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.INVALID);
+        
+        fooProvider.start();
+        
+        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);
+    }
+	
+	public void testDict() {
+        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.INVALID);
+        
+        fooProvider.start();
+        
+        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);
+    }
+
 
 }

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalDependencies.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/OptionalDependencies.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/OptionalDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalDependencies.java Mon Nov  3 05:28:13 2008
@@ -31,7 +31,7 @@
 
 public class OptionalDependencies extends OSGiTestCase {
 	
-	ComponentInstance instance1, instance2, instance3, instance4, instance5;
+	ComponentInstance instance1, instance2, instance3, instance4, instance5, instance6, instance7;
 	ComponentInstance fooProvider;
 	
 	public void setUp() {
@@ -60,6 +60,14 @@
 			Properties i5 = new Properties();
             i5.put("instance.name","Both");
             instance5 = Utils.getFactoryByName(context, "BothOptionalCheckServiceProvider").createComponentInstance(i5);
+            
+            Properties i6 = new Properties();
+            i6.put("instance.name","Map");
+            instance6 = Utils.getFactoryByName(context, "MapOptionalCheckServiceProvider").createComponentInstance(i6);
+            
+            Properties i7 = new Properties();
+            i7.put("instance.name","Dictionary");
+            instance7 = Utils.getFactoryByName(context, "DictOptionalCheckServiceProvider").createComponentInstance(i7);
 		} catch(Exception e) { fail(e.getMessage()); }		
 	}
 	
@@ -69,12 +77,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;
 	}
 	
@@ -382,6 +394,154 @@
         context.ungetService(arch_ref);
         context.ungetService(cs_ref);
     }
+	
+	public void testMap() {
+        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
+        assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
+        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(), 0);
+        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
+        
+        fooProvider.start();
+        
+        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
+        assertTrue("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(), 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);
+        
+        fooProvider.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
+        assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
+        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 ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).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(), 1);
+        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);
+  
+        id = null;
+        cs = null;
+        context.ungetService(arch_ref);
+        context.ungetService(cs_ref);
+    }
+	
+	   public void testDict() {
+	        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
+	        assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
+	        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(), 0);
+	        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
+	        
+	        fooProvider.start();
+	        
+	        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
+	        assertTrue("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(), 0);
+	        
+	        fooProvider.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
+	        assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
+	        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 ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
+	        assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).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(), 1);
+	        assertEquals("check dict unbind callback invocation -3", ((Integer)props.get("dictU")).intValue(), 1);
+	  
+	        id = null;
+	        cs = null;
+	        context.ungetService(arch_ref);
+	        context.ungetService(cs_ref);
+	    }
 
 
 }