Fix issue Felix-815.
Properties becomes optional by default.
Unvalued properties are not published with the service reference until they receive a value.
Setter methods are not called until properties receive a value
Injected values in fields follow standard Java initialization (null for object and arrays, 0 for numeric types, false for boolean). 
Mandatory properties can be set with the 'mandatory' attribute (supported in XML and in the annotations).
The core.xsd XML Schema is also modified to add the new attribute.

This improvement allows removing default value in properties (such as in the architecture handlers).
Provides test about this new improvement

Fix issue Felix-816
The comparator attribute is now supported for any binding policy.
Provides test about using custom comparator with any binding policy

Fix issue Felix-817
Solve an issue in the ServiceExporter when a service in unregistered twice (throws an IllegalStateException since a recent modification of the Felix framework). 

Fix issue Felix-818
Implement the ServiceReferenceImpl compareTo method (method added in OSGi R4.1). This method reuse the same implementation as the Felix framework ServiceReferenceImpl method.

Remove junit4osgi embedded tests

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@713976 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java
index 285334e..c9d5a99 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java
@@ -30,6 +30,8 @@
         assertEquals("Check baa field", "m_baa", baa.getAttribute("field"));

         assertEquals("Check baa name", "baa", baa.getAttribute("name"));

         assertEquals("Check baa method", "setbaa", baa.getAttribute("method"));

+        assertEquals("Check mandatory", "true", baa.getAttribute("mandatory"));

+

         

         //Bar

         Element baz = getPropertyByName(props, "baz");

diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java
index 74a893d..9bf7719 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java
@@ -61,6 +61,7 @@
         Element bar = getPropertyByName(props, "bar");

         assertEquals("Check bar field", "bar", bar.getAttribute("field"));

         assertEquals("Check bar value", "4", bar.getAttribute("value"));

+        assertEquals("Check mandatory value", "true", bar.getAttribute("mandatory"));

         //Boo

         Element boo = getPropertyByName(props, "boo");

         assertEquals("Check boo field", "boo", boo.getAttribute("field"));

diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Properties.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Properties.java
index f4455a4..0737138 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Properties.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Properties.java
@@ -30,7 +30,7 @@
     @Property(name="baa")

     public int m_baa;

     

-    @Property(value="5")

+    @Property(value="5", mandatory=true)

     public void setbaa(int baa) {

         

     }

diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesProperties.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesProperties.java
index 081e8c9..3f77af2 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesProperties.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesProperties.java
@@ -15,7 +15,7 @@
     @ServiceProperty(name = "foo")

     public int m_foo = 0;

     

-    @ServiceProperty(value = "4")

+    @ServiceProperty(value = "4", mandatory=true)

     public int bar;

     

     @ServiceProperty

diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableCheckServiceProvider.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableCheckServiceProvider.java
index c018a54..bf9d3c7 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableCheckServiceProvider.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableCheckServiceProvider.java
@@ -74,14 +74,30 @@
         props.put("c", new Character(c));

         props.put("bool", new Boolean(bool));

         

-        props.put("bs", bs);

-        props.put("ss", ss);

-        props.put("is", is);

-        props.put("ls", ls);

-        props.put("ds", ds);

-        props.put("fs", fs);

-        props.put("cs", cs);

-        props.put("bools", bools);

+        if (bs != null) {

+            props.put("bs", bs);

+        }

+        if (ss != null) {

+            props.put("ss", ss);

+        }

+        if (is != null) {

+            props.put("is", is);

+        }

+        if (ls != null) {

+            props.put("ls", ls);

+        }

+        if (ds != null) {

+            props.put("ds", ds);

+        }

+        if (fs != null) {

+            props.put("fs", fs);

+        }

+        if (cs != null) {

+            props.put("cs", cs);

+        }

+        if (bools != null) {

+            props.put("bools", bools);

+        }

         

         props.put("upb", new Integer(upB));

         props.put("ups", new Integer(upS));

@@ -101,8 +117,13 @@
         props.put("upcs", new Integer(upCs));

         props.put("upbools", new Integer(upBools));

         

-        props.put("string", string);

-        props.put("strings", strings);

+        if (string != null) {

+            props.put("string", string);

+        }

+        if (string != null) {

+            props.put("strings", strings);

+        }

+       

         props.put("upstring", new Integer(upString));

         props.put("upstrings", new Integer(upStrings));

         

diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
index 6266e30..d9e5124 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
@@ -33,7 +33,7 @@
 	public boolean foo() {

 		intProp = 3;

 		boolProp = true;

-		if(strProp.equals("foo")) { strProp = "bar"; }

+		if(strProp == null || strProp.equals("foo")) { strProp = "bar"; }

 		else { strProp = "foo"; }

 		strAProp = new String[] {"foo", "bar", "baz"};

 		intAProp = new int[] {3, 2, 1};

@@ -44,9 +44,15 @@
 		Properties p = new Properties();

 		p.put("intProp", new Integer(intProp));

 		p.put("boolProp", new Boolean(boolProp));

-		p.put("strProp", strProp);

-		p.put("strAProp", strAProp);

-		p.put("intAProp", intAProp);

+		if (strProp != null) {

+		      p.put("strProp", strProp);

+		}

+		if (strAProp != null) {

+		    p.put("strAProp", strAProp);

+		}

+		if (intAProp != null) {

+		    p.put("intAProp", intAProp);

+		}

 		return p;

 	}

 	

diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PropertyModifier.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PropertyModifier.java
new file mode 100644
index 0000000..a127ddd
--- /dev/null
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PropertyModifier.java
@@ -0,0 +1,41 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
+import org.osgi.framework.BundleContext;
+
+public class PropertyModifier implements CheckService {
+    
+    private Class[] classes;
+    private BundleContext context;
+    
+    PropertyModifier(BundleContext bc) {
+        context = bc;
+    }
+
+    public boolean check() {
+        return classes != null;
+    }
+    
+    public void setClasses(String[] classes) throws ClassNotFoundException {
+        Class[] cls = new Class[classes.length];
+        for (int i = 0; i < classes.length; i++) {
+            try {
+                cls[i] = context.getBundle().loadClass(classes[i]);
+            } catch (ClassNotFoundException e) {
+                e.printStackTrace();
+                throw e;
+            }
+        }
+        
+        this.classes = cls;
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("classes", classes);
+        return props;
+    }
+
+}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java
index 80c919d..beffe34 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java
@@ -35,6 +35,7 @@
 		ots.addTestSuite(TestSuperMethodProperties.class);

 		ots.addTestSuite(ManagedServiceConfigurableProperties.class);

 		ots.addTestSuite(TestComplexProperties.class);

+		ots.addTestSuite(TestPropertyModifier.class);

 		return ots;

 	}

 

diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java
index 74e270a..52f734a 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java
@@ -30,7 +30,7 @@
 

 public class DynamicallyConfigurableProperties extends OSGiTestCase {

 

-	ComponentInstance instance;

+	ComponentInstance instance, instance2;

 	

 	public void setUp() {

 		String type = "CONFIG-FooProviderType-3";

@@ -41,10 +41,17 @@
 		p1.put("bar", "2");

 		p1.put("baz", "baz");

 		instance = Utils.getComponentInstance(context, type, p1);

+		

+		Properties p2 = new Properties();

+        p2.put("instance.name","instance2");

+

+        instance2 = Utils.getComponentInstance(context, type, p2);

 	}

 	

 	public void tearDown() {

 		instance.dispose();

+		instance2.dispose();

+		instance2 = null;

 		instance = null;

 	}

 	

@@ -83,6 +90,41 @@
 		context.ungetService(msRef);

 	}

 	

+	public void testStaticNoValue() {

+        ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Check FS availability", fooRef);

+        Object fooP = fooRef.getProperty("foo");

+        Object barP = fooRef.getProperty("bar");

+        Object bazP = fooRef.getProperty("baz");

+        assertEquals("Check foo equality -1", fooP, null);

+        assertEquals("Check bar equality -1", barP, null);

+        assertEquals("Check baz equality -1", bazP, null);

+        

+        ServiceReference msRef = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), instance2.getFactory().getName());

+        assertNotNull("Check ManagedServiceFactory availability", msRef);

+        

+        

+        // Configuration of baz

+        Properties conf = new Properties();

+        conf.put("baz", "zab");

+        conf.put("bar", new Integer(2));

+        conf.put("foo", "foo");

+        ManagedServiceFactory ms = (ManagedServiceFactory) context.getService(msRef);

+        try {

+            ms.updated(instance2.getInstanceName(), conf);

+        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }

+        

+        // Recheck props

+        fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());

+        fooP = (String) fooRef.getProperty("foo");

+        barP = (Integer) fooRef.getProperty("bar");

+        bazP = (String) fooRef.getProperty("baz");

+        assertEquals("Check foo equality -2", fooP, "foo");

+        assertEquals("Check bar equality -2", barP, new Integer(2));

+        assertEquals("Check baz equality -2", bazP, "zab");

+        context.ungetService(msRef);

+    }

+	

 	public void testDynamic() {

     	ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());

     	assertNotNull("Check FS availability", fooRef);

@@ -130,6 +172,54 @@
     	context.ungetService(fooRef);

     	context.ungetService(msRef);

     }

+	

+	public void testDynamicNoValue() {

+        ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Check FS availability", fooRef);

+        

+        Object fooP = fooRef.getProperty("foo");

+        Object barP = fooRef.getProperty("bar");

+        Object bazP = fooRef.getProperty("baz");

+        assertEquals("Check foo equality -1", fooP, null);

+        assertEquals("Check bar equality -1", barP, null);

+        assertEquals("Check baz equality -1", bazP, null);

+        

+        ServiceReference msRef = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), instance2.getFactory().getName());

+        assertNotNull("Check ManagedServiceFactory availability", msRef);

+        

+        // Configuration of baz

+        Properties conf = new Properties();

+        conf.put("baz", "zab");

+        conf.put("foo", "oof");

+        conf.put("bar", new Integer(0));

+        ManagedServiceFactory ms = (ManagedServiceFactory) context.getService(msRef);

+        try {

+            ms.updated(instance2.getInstanceName(), conf);

+        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }

+        

+        // Recheck props

+        fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());

+        fooP = (String) fooRef.getProperty("foo");

+        barP = (Integer) fooRef.getProperty("bar");

+        bazP = (String) fooRef.getProperty("baz");

+        

+        assertEquals("Check foo equality", fooP, "oof");

+        assertEquals("Check bar equality", barP, new Integer(0));

+        assertEquals("Check baz equality", bazP, "zab");

+        

+        // Check field value

+        FooService fs = (FooService) context.getService(fooRef);

+        Properties p = fs.fooProps();

+        fooP = (String) p.get("foo");

+        barP = (Integer) p.get("bar");

+        

+        assertEquals("Check foo field equality", fooP, "oof");

+        assertEquals("Check bar field equality", barP, new Integer(0));

+        

+        context.ungetService(fooRef);

+        context.ungetService(msRef);

+    }

+

 

     public void testDynamicString() {

 		ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());

@@ -224,5 +314,50 @@
 		

 		context.ungetService(msRef);

 	}

+	

+	public void testPropagationNoValue() {

+        ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Check FS availability", fooRef);

+        

+        Object fooP = fooRef.getProperty("foo");

+        Object barP = fooRef.getProperty("bar");

+        Object bazP = fooRef.getProperty("baz");

+        assertEquals("Check foo equality -1", fooP, null);

+        assertEquals("Check bar equality -1", barP, null);

+        assertEquals("Check baz equality -1", bazP, null);

+        

+        ServiceReference msRef = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), instance2.getFactory().getName());

+        assertNotNull("Check ManagedServiceFactory availability", msRef);

+        

+        // Configuration of baz

+        Properties conf = new Properties();

+        conf.put("baz", "zab");

+        conf.put("foo", "foo");

+        conf.put("bar", new Integer(2));

+        conf.put("propagated1", "propagated");

+        conf.put("propagated2", new Integer(1));

+        ManagedServiceFactory ms = (ManagedServiceFactory) context.getService(msRef);

+        try {

+            ms.updated(instance2.getInstanceName(), conf);

+        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }

+        

+        // Recheck props

+        fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());

+        fooP = (String) fooRef.getProperty("foo");

+        barP = (Integer) fooRef.getProperty("bar");

+        bazP = (String) fooRef.getProperty("baz");

+        assertNotNull("Check the propagated1 existency", fooRef.getProperty("propagated1"));

+        String prop1 = (String) fooRef.getProperty("propagated1");

+        assertNotNull("Check the propagated2 existency", fooRef.getProperty("propagated2"));

+        Integer prop2 = (Integer) fooRef.getProperty("propagated2");

+        

+        assertEquals("Check foo equality", fooP, "foo");

+        assertEquals("Check bar equality", barP, new Integer(2));

+        assertEquals("Check baz equality", bazP, "zab");

+        assertEquals("Check propagated1 equality", prop1, "propagated");

+        assertEquals("Check propagated2 equality", prop2, new Integer(1));

+        

+        context.ungetService(msRef);

+    }

 

 }

diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ManagedServiceConfigurableProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ManagedServiceConfigurableProperties.java
index 1344ddf..639ea4b 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ManagedServiceConfigurableProperties.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ManagedServiceConfigurableProperties.java
@@ -40,6 +40,11 @@
      */

 	ComponentInstance instance2;

 	

+	/**

+     * Instance without configuration. 

+     */

+    ComponentInstance instance3;

+	

 	public void setUp() {

 	    String type = "CONFIG-FooProviderType-4";

         Properties p = new Properties();

@@ -58,13 +63,21 @@
 		p1.put("baz", "baz");

 		p1.put("managed.service.pid", "instance");

 		instance2 = Utils.getComponentInstance(context, type, p1);

+		

+		type = "CONFIG-FooProviderType-3";

+        Properties p2 = new Properties();

+        p2.put("instance.name","instance-3");

+        p2.put("managed.service.pid", "instance-3");

+        instance3 = Utils.getComponentInstance(context, type, p2);

 	}

 	

 	public void tearDown() {

 		instance1.dispose();

 		instance2.dispose();

+		instance3.dispose();

 		instance1 = null;

 		instance2 = null;

+		instance3 = null;

 	}

 	

 	public void testStaticInstance1() {

@@ -137,6 +150,43 @@
         context.ungetService(msRef);

     }

 	

+	public void testStaticInstance3() {

+        ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance3.getInstanceName());

+        assertNotNull("Check FS availability", fooRef);

+        Object fooP = fooRef.getProperty("foo");

+        Object barP =  fooRef.getProperty("bar");

+        Object bazP =  fooRef.getProperty("baz");

+        // No values ... no properties.

+        assertEquals("Check foo equality -1", fooP, null);

+        assertEquals("Check bar equality -1", barP, null);

+        assertEquals("Check baz equality -1", bazP, null);

+        

+        ServiceReference msRef = Utils.getServiceReferenceByPID(context, ManagedService.class.getName(), "instance-3");

+        assertNotNull("Check ManagedService availability", msRef);

+        

+        

+        // Configuration of baz

+        Properties conf = new Properties();

+        conf.put("baz", "zab");

+        conf.put("bar", new Integer(2));

+        conf.put("foo", "foo");

+        ManagedService ms = (ManagedService) context.getService(msRef);

+        try {

+            ms.updated(conf);

+        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }

+        

+        // Recheck props

+        fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance3.getInstanceName());

+        fooP = (String) fooRef.getProperty("foo");

+        barP = (Integer) fooRef.getProperty("bar");

+        bazP = (String) fooRef.getProperty("baz");

+        assertEquals("Check foo equality -2", fooP, "foo");

+        assertEquals("Check bar equality -2", barP, new Integer(2));

+        assertEquals("Check baz equality -2", bazP, "zab");

+        context.ungetService(fooRef);

+        context.ungetService(msRef);

+    }

+	

 	public void testDynamicInstance1() {

     	ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance1.getInstanceName());

     	assertNotNull("Check FS availability", fooRef);

@@ -232,6 +282,54 @@
         context.ungetService(fooRef);

         context.ungetService(msRef);

     }

+	

+	public void testDynamicInstance3() {

+        ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance3.getInstanceName());

+        assertNotNull("Check FS availability", fooRef);

+        

+        Object fooP = fooRef.getProperty("foo");

+        Object barP =  fooRef.getProperty("bar");

+        Object bazP =  fooRef.getProperty("baz");

+     // No values ... no properties.

+        assertEquals("Check foo equality", fooP, null);

+        assertEquals("Check bar equality", barP, null);

+        assertEquals("Check baz equality", bazP, null);

+        

+        ServiceReference msRef = Utils.getServiceReferenceByPID(context, ManagedService.class.getName(), "instance-3");

+        assertNotNull("Check ManagedServiceFactory availability", msRef);

+        

+        // Configuration of baz

+        Properties conf = new Properties();

+        conf.put("baz", "zab");

+        conf.put("foo", "oof");

+        conf.put("bar", new Integer(0));

+        ManagedService ms = (ManagedService) context.getService(msRef);

+        try {

+            ms.updated(conf);

+        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }

+        

+        // Recheck props

+        fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance3.getInstanceName());

+        fooP = (String) fooRef.getProperty("foo");

+        barP = (Integer) fooRef.getProperty("bar");

+        bazP = (String) fooRef.getProperty("baz");

+        

+        assertEquals("Check foo equality", fooP, "oof");

+        assertEquals("Check bar equality", barP, new Integer(0));

+        assertEquals("Check baz equality", bazP, "zab");

+        

+        // Check field value

+        FooService fs = (FooService) context.getService(fooRef);

+        Properties p = fs.fooProps();

+        fooP = (String) p.get("foo");

+        barP = (Integer) p.get("bar");

+        

+        assertEquals("Check foo field equality", fooP, "oof");

+        assertEquals("Check bar field equality", barP, new Integer(0));

+        

+        context.ungetService(fooRef);

+        context.ungetService(msRef);

+    }

 

     public void testDynamicStringInstance1() {

         assertEquals("Check instance1 state", ComponentInstance.VALID,instance1.getState());

@@ -427,5 +525,51 @@
         

         context.ungetService(msRef);

     }

+	

+	public void testPropagationInstance3() {

+        ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance3.getInstanceName());

+        assertNotNull("Check FS availability", fooRef);

+        

+        Object fooP = fooRef.getProperty("foo");

+        Object barP =  fooRef.getProperty("bar");

+        Object bazP =  fooRef.getProperty("baz");

+        

+        assertEquals("Check foo equality", fooP, null);

+        assertEquals("Check bar equality", barP, null);

+        assertEquals("Check baz equality", bazP, null);

+        

+        ServiceReference msRef = Utils.getServiceReferenceByPID(context, ManagedService.class.getName(), "instance-3");

+        assertNotNull("Check ManagedService availability", msRef);

+        

+        // Configuration of baz

+        Properties conf = new Properties();

+        conf.put("baz", "zab");

+        conf.put("foo", "foo");

+        conf.put("bar", new Integer(2));

+        conf.put("propagated1", "propagated");

+        conf.put("propagated2", new Integer(1));

+        ManagedService ms = (ManagedService) context.getService(msRef);

+        try {

+            ms.updated(conf);

+        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }

+        

+        // Recheck props

+        fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance3.getInstanceName());

+        fooP = (String) fooRef.getProperty("foo");

+        barP = (Integer) fooRef.getProperty("bar");

+        bazP = (String) fooRef.getProperty("baz");

+        assertNotNull("Check the propagated1 existency", fooRef.getProperty("propagated1"));

+        String prop1 = (String) fooRef.getProperty("propagated1");

+        assertNotNull("Check the propagated2 existency", fooRef.getProperty("propagated2"));

+        Integer prop2 = (Integer) fooRef.getProperty("propagated2");

+        

+        assertEquals("Check foo equality", fooP, "foo");

+        assertEquals("Check bar equality", barP, new Integer(2));

+        assertEquals("Check baz equality", bazP, "zab");

+        assertEquals("Check propagated1 equality", prop1, "propagated");

+        assertEquals("Check propagated2 equality", prop2, new Integer(1));

+        

+        context.ungetService(msRef);

+    }

 

 }

diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java
index 13a559b..982ff42 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java
@@ -30,6 +30,7 @@
 	

 	ComponentInstance fooProvider1;

 	ComponentInstance fooProvider2;

+	ComponentInstance fooProvider3;

 	

 	public void setUp() {

 		String type = "CONFIG-FooProviderType-Conf";

@@ -46,13 +47,19 @@
 		p2.put("strAProp", new String[] {"bar", "foo"});

 		p2.put("intAProp", new int[] {1, 2, 3});

 		fooProvider2 = Utils.getComponentInstance(context, type, p2);

+		

+		Properties p3 = new Properties();

+        p3.put("instance.name","FooProvider-3");

+        fooProvider3 = Utils.getComponentInstance(context, "CONFIG-FooProviderType-ConfNoValue", p3);

 	}

 	

 	public void tearDown() {

 		fooProvider1.dispose();

 		fooProvider2.dispose();

+		fooProvider3.dispose();

 		fooProvider1 = null;

 		fooProvider2 = null;

+		fooProvider3 = null;

 	}

 	

 	public void testComponentTypeConfiguration() {

@@ -167,5 +174,53 @@
 		fs = null;

 		context.ungetService(sr);	

 	}

+	

+	public void testNoValue() {

+        ServiceReference sr = Utils.getServiceReferenceByName(context, FooService.class.getName(), "FooProvider-3");

+        assertNotNull("Check the availability of the FS service", sr);

+        

+        FooService fs = (FooService) context.getService(sr);

+        Properties toCheck = fs.fooProps();

+        

+        // Check service properties

+        Integer intProp = (Integer) toCheck.get("intProp");

+        Boolean boolProp = (Boolean) toCheck.get("boolProp");

+        String strProp = (String) toCheck.get("strProp");

+        String[] strAProp = (String[]) toCheck.get("strAProp");

+        int[] intAProp = (int[]) toCheck.get("intAProp");

+        

+        assertEquals("Check intProp equality", intProp, new Integer(0));

+        assertEquals("Check longProp equality", boolProp, new Boolean(false));

+        assertEquals("Check strProp equality", strProp, null);

+        assertNull("Check strAProp nullity", strAProp);

+        assertNull("Check intAProp  nullity", intAProp);

+       

+        assertTrue("invoke fs", fs.foo());

+        toCheck = fs.fooProps();

+        

+        // Re-check the property (change)

+        intProp = (Integer) toCheck.get("intProp");

+        boolProp = (Boolean) toCheck.get("boolProp");

+        strProp = (String) toCheck.get("strProp");

+        strAProp = (String[]) toCheck.get("strAProp");

+        intAProp = (int[]) toCheck.get("intAProp");

+        

+        assertEquals("Check intProp equality", intProp, new Integer(3));

+        assertEquals("Check longProp equality", boolProp, new Boolean(true));

+        assertEquals("Check strProp equality", strProp, new String("bar"));

+        assertNotNull("Check strAProp not nullity", strAProp);

+        String[] v = new String[] {"foo", "bar", "baz"};

+        for (int i = 0; i < strAProp.length; i++) {

+            if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }

+        }

+        assertNotNull("Check intAProp not nullity", intAProp);

+        int[] v2 = new int[] {3, 2, 1};

+        for (int i = 0; i < intAProp.length; i++) {

+            if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }

+        }

+        

+        fs = null;

+        context.ungetService(sr);   

+    }

 

 }

diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java
index 0d982a8..d467ad0 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java
@@ -29,7 +29,7 @@
 

 public class TestBothProperties extends OSGiTestCase {

     

-    ComponentInstance instance;

+    ComponentInstance instance, instance2;

 

     

     public void setUp() {

@@ -61,12 +61,20 @@
            fail("Cannot create the under-test instance : " + e.getMessage());

         }

         

+        try {

+            instance2 = fact.createComponentInstance(null);

+        } catch(Exception e) {

+           fail("Cannot create the under-test instance2 : " + e.getMessage());

+        }

+        

         

     }

     

     public void tearDown() {

         instance.dispose();

+        instance2.dispose();

         instance = null;

+        instance2 = null;

     }

     

     public void testConfigurationPrimitive() {

@@ -111,7 +119,7 @@
         assertEquals("Check upc", upc, new Integer(1));

         assertEquals("Check upbool", upbool, new Integer(1));

         

-        reconfigure();

+        reconfigure(instance);

         

         ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());

         assertNotNull("Test check service availability", ref);

@@ -198,7 +206,7 @@
         assertEquals("Check upc", upc, new Integer(1));

         assertEquals("Check upbool", upbool, new Integer(1));

         

-        reconfigureString();

+        reconfigureString(instance);

         

         ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());

         assertNotNull("Test check service availability", ref);

@@ -301,7 +309,7 @@
         assertEquals("Check upc", upc, new Integer(1));

         assertEquals("Check upbool", upbool, new Integer(1));

         

-        reconfigure();

+        reconfigure(instance);

         

         ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());

         assertNotNull("Test check service availability", ref);

@@ -420,7 +428,7 @@
         assertEquals("Check upc", upc, new Integer(1));

         assertEquals("Check upbool", upbool, new Integer(1));

         

-        reconfigureString();

+        reconfigureString(instance);

         

         ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());

         assertNotNull("Test check service availability", ref);

@@ -501,7 +509,7 @@
         assertEquals("Check upString", upString, new Integer(1));

         assertEquals("Check upStrings", upStrings, new Integer(1));

         

-        reconfigure();

+        reconfigure(instance);

         

         ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());

         assertNotNull("Test check service availability", ref);

@@ -543,7 +551,7 @@
         assertEquals("Check upString", upString, new Integer(1));

         assertEquals("Check upStrings", upStrings, new Integer(1));

         

-        reconfigureString();

+        reconfigureString(instance);

         

         ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());

         assertNotNull("Test check service availability", ref);

@@ -565,9 +573,8 @@
         assertEquals("2) Check upstrings", upStrings, new Integer(2));

     }

     

-    private void reconfigure() {

+    private void reconfigure(ComponentInstance ci) {

         Properties props2 = new Properties();

-        props2.put("instance.name","under-test");

         props2.put("b", new Byte("2"));

         props2.put("s", new Short("2"));

         props2.put("i", new Integer("2"));

@@ -587,12 +594,11 @@
         props2.put("string", "bar");

         props2.put("strings", new String[]{"baz", "bar", "foo"});

         

-        instance.reconfigure(props2);

+        ci.reconfigure(props2);

     }

     

-    private void reconfigureString() {

+    private void reconfigureString(ComponentInstance ci) {

         Properties props2 = new Properties();

-        props2.put("instance.name","under-test");

         props2.put("b", "2");

         props2.put("s", "2");

         props2.put("i", "2");

@@ -612,7 +618,239 @@
         props2.put("string", "bar");

         props2.put("strings", "{baz, bar, foo}");

         

-        instance.reconfigure(props2);

+        ci.reconfigure(props2);

+    }

+

+    public void testConfigurationPrimitiveNoValue() {

+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Test check service availability", ref);

+        CheckService check = (CheckService) context.getService(ref);

+        Properties props = check.getProps();

+        

+        Byte b = (Byte) props.get("b");

+        Short s = (Short) props.get("s");

+        Integer i = (Integer) props.get("i");

+        Long l = (Long) props.get("l");

+        Double d = (Double) props.get("d");

+        Float f = (Float) props.get("f");

+        Character c = (Character) props.get("c");

+        Boolean bool = (Boolean) props.get("bool");

+                

+        assertEquals("Check b", b, new Byte("0"));

+        assertEquals("Check s", s, new Short("0"));

+        assertEquals("Check i", i, new Integer("0"));

+        assertEquals("Check l", l, new Long("0"));

+        assertEquals("Check d", d, new Double("0"));

+        assertEquals("Check f", f, new Float("0"));

+        assertEquals("Check c", c, new Character((char) 0));

+        assertEquals("Check bool", bool, new Boolean(false));

+        

+        Integer upb = (Integer) props.get("upb");

+        Integer ups = (Integer) props.get("ups");

+        Integer upi = (Integer) props.get("upi");

+        Integer upl = (Integer) props.get("upl");

+        Integer upd = (Integer) props.get("upd");

+        Integer upf = (Integer) props.get("upf");

+        Integer upc = (Integer) props.get("upc");

+        Integer upbool = (Integer) props.get("upbool");

+        

+        assertEquals("Check upb", upb, new Integer(0));

+        assertEquals("Check ups", ups, new Integer(0));

+        assertEquals("Check upi", upi, new Integer(0));

+        assertEquals("Check upl", upl, new Integer(0));

+        assertEquals("Check upd", upd, new Integer(0));

+        assertEquals("Check upf", upf, new Integer(0));

+        assertEquals("Check upc", upc, new Integer(0));

+        assertEquals("Check upbool", upbool, new Integer(0));

+        

+        reconfigure(instance2);

+        

+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Test check service availability", ref);

+        check = (CheckService) context.getService(ref);

+        props = check.getProps();

+        

+        b = (Byte) props.get("b");

+        s = (Short) props.get("s");

+        i = (Integer) props.get("i");

+        l = (Long) props.get("l");

+        d = (Double) props.get("d");

+        f = (Float) props.get("f");

+        c = (Character) props.get("c");

+        bool = (Boolean) props.get("bool");

+        

+        assertEquals("2) Check b ("+b+")", b, new Byte("2"));

+        assertEquals("2) Check s", s, new Short("2"));

+        assertEquals("2) Check i", i, new Integer("2"));

+        assertEquals("2) Check l", l, new Long("2"));

+        assertEquals("2) Check d", d, new Double("2"));

+        assertEquals("2) Check f", f, new Float("2"));

+        assertEquals("2) Check c", c, new Character('b'));

+        assertEquals("2) Check bool", bool, new Boolean("false"));

+        

+        upb = (Integer) props.get("upb");

+        ups = (Integer) props.get("ups");

+        upi = (Integer) props.get("upi");

+        upl = (Integer) props.get("upl");

+        upd = (Integer) props.get("upd");

+        upf = (Integer) props.get("upf");

+        upc = (Integer) props.get("upc");

+        upbool = (Integer) props.get("upbool");

+        

+        assertEquals("2) Check upb", upb, new Integer(1));

+        assertEquals("2) Check ups", ups, new Integer(1));

+        assertEquals("2) Check upi", upi, new Integer(1));

+        assertEquals("2) Check upl", upl, new Integer(1));

+        assertEquals("2) Check upd", upd, new Integer(1));

+        assertEquals("2) Check upf", upf, new Integer(1));

+        assertEquals("2) Check upc", upc, new Integer(1));

+        //assertEquals("2) Check upbool", upbool, new Integer(1)); // TODO Why 0 ???

+        

+    }

+

+    public void testConfigurationPrimitiveArraysNoValue() {

+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Test check service availability", ref);

+        CheckService check = (CheckService) context.getService(ref);

+        Properties props = check.getProps();

+        

+        byte[] b = (byte[]) props.get("bs");

+        short[] s = (short[]) props.get("ss");

+        int[] i = (int[]) props.get("is");

+        long[] l = (long[]) props.get("ls");

+        double[] d = (double[]) props.get("ds");

+        float[] f = (float[]) props.get("fs");

+        char[] c = (char[]) props.get("cs");

+        boolean[] bool = (boolean[]) props.get("bools");

+                

+        assertNull("Check b nullity", b);

+        assertNull("Check s nullity", s);

+        assertNull("Check i nullity", i);

+        assertNull("Check l nullity", l);

+        assertNull("Check d nullity", d);

+        assertNull("Check f nullity", f);

+        assertNull("Check c nullity", c);

+        assertNull("Check bool nullity", bool);

+        

+        Integer upb = (Integer) props.get("upbs");

+        Integer ups = (Integer) props.get("upss");

+        Integer upi = (Integer) props.get("upis");

+        Integer upl = (Integer) props.get("upls");

+        Integer upd = (Integer) props.get("upds");

+        Integer upf = (Integer) props.get("upfs");

+        Integer upc = (Integer) props.get("upcs");

+        Integer upbool = (Integer) props.get("upbools");

+        

+        assertEquals("Check upb", upb, new Integer(0));

+        assertEquals("Check ups", ups, new Integer(0));

+        assertEquals("Check upi", upi, new Integer(0));

+        assertEquals("Check upl", upl, new Integer(0));

+        assertEquals("Check upd", upd, new Integer(0));

+        assertEquals("Check upf", upf, new Integer(0));

+        assertEquals("Check upc", upc, new Integer(0));

+        assertEquals("Check upbool", upbool, new Integer(0));

+        

+        reconfigure(instance2);

+        

+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Test check service availability", ref);

+        check = (CheckService) context.getService(ref);

+        props = check.getProps();

+        

+        b = (byte[]) props.get("bs");

+        s = (short[]) props.get("ss");

+        i = (int[]) props.get("is");

+        l = (long[]) props.get("ls");

+        d = (double[]) props.get("ds");

+        f = (float[]) props.get("fs");

+        c = (char[]) props.get("cs");

+        bool = (boolean[]) props.get("bools");

+        

+        assertEquals("2) Check b 0", b[0], 3);

+        assertEquals("2) Check b 1", b[1], 2);

+        assertEquals("2) Check b 2", b[2], 1);

+        assertEquals("2) Check s 0", s[0], 3);

+        assertEquals("2) Check s 1", s[1], 2);

+        assertEquals("2) Check s 2", s[2], 1);

+        assertEquals("2) Check i 0", i[0], 3);

+        assertEquals("2) Check i 1", i[1], 2);

+        assertEquals("2) Check i 2", i[2], 1);

+        assertEquals("2) Check l 0", l[0], 3);

+        assertEquals("2) Check l 1", l[1], 2);

+        assertEquals("2) Check l 2", l[2], 1);

+        assertEquals("2) Check d 0", d[0], 3);

+        assertEquals("2) Check d 1", d[1], 2);

+        assertEquals("2) Check d 2", d[2], 1);

+        assertEquals("2) Check f 0", f[0], 3);

+        assertEquals("2) Check f 1", f[1], 2);

+        assertEquals("2) Check f 2", f[2], 1);

+        assertEquals("2) Check c 0", c[0], 'c');

+        assertEquals("2) Check c 1", c[1], 'b');

+        assertEquals("2) Check c 2", c[2], 'a');

+        assertFalse("2) Check bool 0", bool[0]);

+        assertFalse("2) Check bool 1", bool[0]);

+        assertFalse("2) Check bool 2", bool[0]);

+        

+        upb = (Integer) props.get("upbs");

+        ups = (Integer) props.get("upss");

+        upi = (Integer) props.get("upis");

+        upl = (Integer) props.get("upls");

+        upd = (Integer) props.get("upds");

+        upf = (Integer) props.get("upfs");

+        upc = (Integer) props.get("upcs");

+        upbool = (Integer) props.get("upbools");

+        

+        assertEquals("2) Check upb", upb, new Integer(1));

+        assertEquals("2) Check ups", ups, new Integer(1));

+        assertEquals("2) Check upi", upi, new Integer(1));

+        assertEquals("2) Check upl", upl, new Integer(1));

+        assertEquals("2) Check upd", upd, new Integer(1));

+        assertEquals("2) Check upf", upf, new Integer(1));

+        assertEquals("2) Check upc", upc, new Integer(1));

+        assertEquals("2) Check upbool", upbool, new Integer(1));

+        

+    }

+

+    public void testConfigurationObjNoValue() {

+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Test check service availability", ref);

+        CheckService check = (CheckService) context.getService(ref);

+        Properties props = check.getProps();

+        

+        

+        String s = (String) props.get("string");

+        String[] ss = (String[]) props.get("strings");

+                

+        assertEquals("Check string", s, null);

+        assertEquals("Check strings", ss, null);

+

+        

+        Integer upString = (Integer) props.get("upstring");

+        Integer upStrings = (Integer) props.get("upstrings");

+        

+        assertEquals("Check upString", upString, new Integer(0));

+        assertEquals("Check upStrings", upStrings, new Integer(0));

+        

+        reconfigure(instance2);

+        

+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Test check service availability", ref);

+        check = (CheckService) context.getService(ref);

+        props = check.getProps();

+        

+        s = (String) props.get("string");

+        ss = (String[]) props.get("strings");

+                

+        assertEquals("2) Check string", s, "bar");

+        assertEquals("2) Check strings 0", ss[0], "baz");

+        assertEquals("2) Check strings 1", ss[1], "bar");

+        assertEquals("2) Check strings 2", ss[2], "foo");

+        

+        upString = (Integer) props.get("upstring");

+        upStrings = (Integer) props.get("upstrings");

+        

+        assertEquals("2) Check upstring", upString, new Integer(1));

+        assertEquals("2) Check upstrings", upStrings, new Integer(1));

     }

 

 }

diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java
index 9edb241..35335f8 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java
@@ -21,7 +21,10 @@
 import java.util.Properties;

 

 import org.apache.felix.ipojo.ComponentInstance;

+import org.apache.felix.ipojo.ConfigurationException;

 import org.apache.felix.ipojo.Factory;

+import org.apache.felix.ipojo.MissingHandlerException;

+import org.apache.felix.ipojo.UnacceptableConfiguration;

 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;

 import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;

 import org.apache.felix.ipojo.test.scenarios.util.Utils;

@@ -30,6 +33,7 @@
 public class TestFieldProperties extends OSGiTestCase {

     

     ComponentInstance instance;

+    ComponentInstance instance2;

     

     public void setUp() {

         Factory fact = Utils.getFactoryByName(context, "CONFIG-FieldConfigurableCheckService");

@@ -60,12 +64,23 @@
            fail("Cannot create the under-test instance : " + e.getMessage());

         }

         

+        try {

+            instance2 = fact.createComponentInstance(null);

+        } catch (Exception e) {

+            e.printStackTrace();

+            fail("Cannot create the instance : " + e.getMessage());

+

+        }

+

+        

         

     }

     

     public void tearDown() {

         instance.dispose();

+        instance2.dispose();

         instance = null;

+        instance2 = null;

     }

     

     public void testConfigurationPrimitive() {

@@ -92,7 +107,7 @@
         assertEquals("Check c", c, new Character('a'));

         assertEquals("Check bool", bool, new Boolean("true"));

         

-        reconfigure();

+        reconfigure(instance);

         

         ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());

         assertNotNull("Test check service availability", ref);

@@ -118,6 +133,57 @@
         assertEquals("2) Check bool", bool, new Boolean("false"));

         

     }

+    

+    public void testConfigurationPrimitiveNoValue() {

+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Test check service availability", ref);

+        CheckService check = (CheckService) context.getService(ref);

+        Properties props = check.getProps();

+        

+        Byte b = (Byte) props.get("b");

+        Short s = (Short) props.get("s");

+        Integer i = (Integer) props.get("i");

+        Long l = (Long) props.get("l");

+        Double d = (Double) props.get("d");

+        Float f = (Float) props.get("f");

+        Character c = (Character) props.get("c");

+        Boolean bool = (Boolean) props.get("bool");

+                

+        assertEquals("Check b", b, new Byte("0"));

+        assertEquals("Check s", s, new Short("0"));

+        assertEquals("Check i", i, new Integer("0"));

+        assertEquals("Check l", l, new Long("0"));

+        assertEquals("Check d", d, new Double("0"));

+        assertEquals("Check f", f, new Float("0"));

+        assertEquals("Check c", c, new Character((char) 0));

+        assertEquals("Check bool", bool, new Boolean(false));

+        

+        reconfigure(instance2);

+        

+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Test check service availability", ref);

+        check = (CheckService) context.getService(ref);

+        props = check.getProps();

+        

+        b = (Byte) props.get("b");

+        s = (Short) props.get("s");

+        i = (Integer) props.get("i");

+        l = (Long) props.get("l");

+        d = (Double) props.get("d");

+        f = (Float) props.get("f");

+        c = (Character) props.get("c");

+        bool = (Boolean) props.get("bool");

+        

+        assertEquals("2) Check b", b, new Byte("2"));

+        assertEquals("2) Check s", s, new Short("2"));

+        assertEquals("2) Check i", i, new Integer("2"));

+        assertEquals("2) Check l", l, new Long("2"));

+        assertEquals("2) Check d", d, new Double("2"));

+        assertEquals("2) Check f", f, new Float("2"));

+        assertEquals("2) Check c", c, new Character('b'));

+        assertEquals("2) Check bool", bool, new Boolean("false"));

+        

+    }

 

     public void testConfigurationPrimitiveString() {

         ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());

@@ -143,7 +209,7 @@
         assertEquals("Check c", c, new Character('a'));

         assertEquals("Check bool", bool, new Boolean("true"));

         

-        reconfigureString();

+        reconfigureString(instance);

         

         ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());

         assertNotNull("Test check service availability", ref);

@@ -170,6 +236,57 @@
         

     }

     

+    public void testConfigurationPrimitiveStringNoValue() {

+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Test check service availability", ref);

+        CheckService check = (CheckService) context.getService(ref);

+        Properties props = check.getProps();

+        

+        Byte b = (Byte) props.get("b");

+        Short s = (Short) props.get("s");

+        Integer i = (Integer) props.get("i");

+        Long l = (Long) props.get("l");

+        Double d = (Double) props.get("d");

+        Float f = (Float) props.get("f");

+        Character c = (Character) props.get("c");

+        Boolean bool = (Boolean) props.get("bool");

+                

+        assertEquals("Check b", b, new Byte("0"));

+        assertEquals("Check s", s, new Short("0"));

+        assertEquals("Check i", i, new Integer("0"));

+        assertEquals("Check l", l, new Long("0"));

+        assertEquals("Check d", d, new Double("0"));

+        assertEquals("Check f", f, new Float("0"));

+        assertEquals("Check c", c, new Character((char) 0));

+        assertEquals("Check bool", bool, new Boolean(false));

+        

+        reconfigureString(instance2);

+        

+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Test check service availability", ref);

+        check = (CheckService) context.getService(ref);

+        props = check.getProps();

+        

+        b = (Byte) props.get("b");

+        s = (Short) props.get("s");

+        i = (Integer) props.get("i");

+        l = (Long) props.get("l");

+        d = (Double) props.get("d");

+        f = (Float) props.get("f");

+        c = (Character) props.get("c");

+        bool = (Boolean) props.get("bool");

+        

+        assertEquals("2) Check b", b, new Byte("2"));

+        assertEquals("2) Check s", s, new Short("2"));

+        assertEquals("2) Check i", i, new Integer("2"));

+        assertEquals("2) Check l", l, new Long("2"));

+        assertEquals("2) Check d", d, new Double("2"));

+        assertEquals("2) Check f", f, new Float("2"));

+        assertEquals("2) Check c", c, new Character('b'));

+        assertEquals("2) Check bool", bool, new Boolean("false"));

+        

+    }

+    

     public void testConfigurationPrimitiveArrays() {

         ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());

         assertNotNull("Test check service availability", ref);

@@ -210,7 +327,7 @@
         assertTrue("Check bool 1", bool[0]);

         assertTrue("Check bool 2", bool[0]);

         

-        reconfigure();

+        reconfigure(instance);

         

         ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());

         assertNotNull("Test check service availability", ref);

@@ -252,6 +369,73 @@
         assertFalse("2) Check bool 2", bool[0]);

         

     }

+    

+    public void testConfigurationPrimitiveArraysNoValue() {

+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Test check service availability", ref);

+        CheckService check = (CheckService) context.getService(ref);

+        Properties props = check.getProps();

+        

+        byte[] b = (byte[]) props.get("bs");

+        short[] s = (short[]) props.get("ss");

+        int[] i = (int[]) props.get("is");

+        long[] l = (long[]) props.get("ls");

+        double[] d = (double[]) props.get("ds");

+        float[] f = (float[]) props.get("fs");

+        char[] c = (char[]) props.get("cs");

+        boolean[] bool = (boolean[]) props.get("bools");

+                

+        assertNull("Check b nullity", b);

+        assertNull("Check s nullity", s);

+        assertNull("Check i nullity", i);

+        assertNull("Check l nullity", l);

+        assertNull("Check d nullity", d);

+        assertNull("Check f nullity", f);

+        assertNull("Check c nullity", c);

+        assertNull("Check bool nullity", bool);

+   

+        reconfigure(instance2);

+        

+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Test check service availability", ref);

+        check = (CheckService) context.getService(ref);

+        props = check.getProps();

+        

+        b = (byte[]) props.get("bs");

+        s = (short[]) props.get("ss");

+        i = (int[]) props.get("is");

+        l = (long[]) props.get("ls");

+        d = (double[]) props.get("ds");

+        f = (float[]) props.get("fs");

+        c = (char[]) props.get("cs");

+        bool = (boolean[]) props.get("bools");

+        

+        assertEquals("2) Check b 0", b[0], 3);

+        assertEquals("2) Check b 1", b[1], 2);

+        assertEquals("2) Check b 2", b[2], 1);

+        assertEquals("2) Check s 0", s[0], 3);

+        assertEquals("2) Check s 1", s[1], 2);

+        assertEquals("2) Check s 2", s[2], 1);

+        assertEquals("2) Check i 0", i[0], 3);

+        assertEquals("2) Check i 1", i[1], 2);

+        assertEquals("2) Check i 2", i[2], 1);

+        assertEquals("2) Check l 0", l[0], 3);

+        assertEquals("2) Check l 1", l[1], 2);

+        assertEquals("2) Check l 2", l[2], 1);

+        assertEquals("2) Check d 0", d[0], 3);

+        assertEquals("2) Check d 1", d[1], 2);

+        assertEquals("2) Check d 2", d[2], 1);

+        assertEquals("2) Check f 0", f[0], 3);

+        assertEquals("2) Check f 1", f[1], 2);

+        assertEquals("2) Check f 2", f[2], 1);

+        assertEquals("2) Check c 0", c[0], 'c');

+        assertEquals("2) Check c 1", c[1], 'b');

+        assertEquals("2) Check c 2", c[2], 'a');

+        assertFalse("2) Check bool 0", bool[0]);

+        assertFalse("2) Check bool 1", bool[0]);

+        assertFalse("2) Check bool 2", bool[0]);

+        

+    }

 

     public void testConfigurationPrimitiveArraysString() {

         ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());

@@ -293,7 +477,7 @@
         assertTrue("Check bool 1", bool[0]);

         assertTrue("Check bool 2", bool[0]);

         

-        reconfigureString();

+        reconfigureString(instance);

         

         ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());

         assertNotNull("Test check service availability", ref);

@@ -336,6 +520,73 @@
         

     }

     

+    public void testConfigurationPrimitiveArraysStringNoValue() {

+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Test check service availability", ref);

+        CheckService check = (CheckService) context.getService(ref);

+        Properties props = check.getProps();

+        

+        byte[] b = (byte[]) props.get("bs");

+        short[] s = (short[]) props.get("ss");

+        int[] i = (int[]) props.get("is");

+        long[] l = (long[]) props.get("ls");

+        double[] d = (double[]) props.get("ds");

+        float[] f = (float[]) props.get("fs");

+        char[] c = (char[]) props.get("cs");

+        boolean[] bool = (boolean[]) props.get("bools");

+                

+        assertNull("Check b nullity", b);

+        assertNull("Check s nullity", s);

+        assertNull("Check i nullity", i);

+        assertNull("Check l nullity", l);

+        assertNull("Check d nullity", d);

+        assertNull("Check f nullity", f);

+        assertNull("Check c nullity", c);

+        assertNull("Check bool nullity", bool);

+        

+        reconfigureString(instance2);

+        

+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Test check service availability", ref);

+        check = (CheckService) context.getService(ref);

+        props = check.getProps();

+        

+        b = (byte[]) props.get("bs");

+        s = (short[]) props.get("ss");

+        i = (int[]) props.get("is");

+        l = (long[]) props.get("ls");

+        d = (double[]) props.get("ds");

+        f = (float[]) props.get("fs");

+        c = (char[]) props.get("cs");

+        bool = (boolean[]) props.get("bools");

+        

+        assertEquals("2) Check b 0", b[0], 3);

+        assertEquals("2) Check b 1", b[1], 2);

+        assertEquals("2) Check b 2", b[2], 1);

+        assertEquals("2) Check s 0", s[0], 3);

+        assertEquals("2) Check s 1", s[1], 2);

+        assertEquals("2) Check s 2", s[2], 1);

+        assertEquals("2) Check i 0", i[0], 3);

+        assertEquals("2) Check i 1", i[1], 2);

+        assertEquals("2) Check i 2", i[2], 1);

+        assertEquals("2) Check l 0", l[0], 3);

+        assertEquals("2) Check l 1", l[1], 2);

+        assertEquals("2) Check l 2", l[2], 1);

+        assertEquals("2) Check d 0", d[0], 3);

+        assertEquals("2) Check d 1", d[1], 2);

+        assertEquals("2) Check d 2", d[2], 1);

+        assertEquals("2) Check f 0", f[0], 3);

+        assertEquals("2) Check f 1", f[1], 2);

+        assertEquals("2) Check f 2", f[2], 1);

+        assertEquals("2) Check c 0", c[0], 'c');

+        assertEquals("2) Check c 1", c[1], 'b');

+        assertEquals("2) Check c 2", c[2], 'a');

+        assertFalse("2) Check bool 0", bool[0]);

+        assertFalse("2) Check bool 1", bool[0]);

+        assertFalse("2) Check bool 2", bool[0]);

+        

+    }

+    

     public void testConfigurationObj() {

         ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());

         assertNotNull("Test check service availability", ref);

@@ -350,7 +601,7 @@
         assertEquals("Check strings 1", ss[1], "bar");

         assertEquals("Check strings 2", ss[2], "baz");

         

-        reconfigure();

+        reconfigure(instance);

         

         ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());

         assertNotNull("Test check service availability", ref);

@@ -365,6 +616,34 @@
         assertEquals("2) Check strings 1", ss[1], "bar");

         assertEquals("2) Check strings 2", ss[2], "foo");

     }

+    

+    public void testConfigurationObjNoValue() {

+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Test check service availability", ref);

+        CheckService check = (CheckService) context.getService(ref);

+        Properties props = check.getProps();

+        

+        String s = (String) props.get("string");

+        String[] ss = (String[]) props.get("strings");

+                

+        assertEquals("Check string", s, null);

+        assertEquals("Check strings", ss, null);

+        

+        reconfigure(instance2);

+        

+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Test check service availability", ref);

+        check = (CheckService) context.getService(ref);

+        props = check.getProps();

+        

+        s = (String) props.get("string");

+        ss = (String[]) props.get("strings");

+                

+        assertEquals("2) Check string", s, "bar");

+        assertEquals("2) Check strings 0", ss[0], "baz");

+        assertEquals("2) Check strings 1", ss[1], "bar");

+        assertEquals("2) Check strings 2", ss[2], "foo");

+    }

 

     public void testConfigurationObjString() {

         ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());

@@ -380,7 +659,7 @@
         assertEquals("Check strings 1", ss[1], "bar");

         assertEquals("Check strings 2", ss[2], "baz");

         

-        reconfigureString();

+        reconfigureString(instance);

         

         ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());

         assertNotNull("Test check service availability", ref);

@@ -396,9 +675,36 @@
         assertEquals("2) Check strings 2", ss[2], "foo");

     }

     

-    private void reconfigure() {

+    public void testConfigurationObjStringNoValue() {

+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Test check service availability", ref);

+        CheckService check = (CheckService) context.getService(ref);

+        Properties props = check.getProps();

+        

+        String s = (String) props.get("string");

+        String[] ss = (String[]) props.get("strings");

+                

+        assertEquals("Check string", s, null);

+        assertEquals("Check strings", ss, null);

+        

+        reconfigureString(instance2);

+        

+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());

+        assertNotNull("Test check service availability", ref);

+        check = (CheckService) context.getService(ref);

+        props = check.getProps();

+        

+        s = (String) props.get("string");

+        ss = (String[]) props.get("strings");

+                

+        assertEquals("2) Check string", s, "bar");

+        assertEquals("2) Check strings 0", ss[0], "baz");

+        assertEquals("2) Check strings 1", ss[1], "bar");

+        assertEquals("2) Check strings 2", ss[2], "foo");

+    }

+    

+    private void reconfigure(ComponentInstance ci) {

         Properties props2 = new Properties();

-        props2.put("instance.name","under-test");

         props2.put("b", new Byte("2"));

         props2.put("s", new Short("2"));

         props2.put("i", new Integer("2"));

@@ -418,12 +724,11 @@
         props2.put("string", "bar");

         props2.put("strings", new String[]{"baz", "bar", "foo"});

         

-        instance.reconfigure(props2);

+        ci.reconfigure(props2);

     }

     

-    private void reconfigureString() {

+    private void reconfigureString(ComponentInstance ci) {

         Properties props2 = new Properties();

-        props2.put("instance.name","under-test");

         props2.put("b", "2");

         props2.put("s", "2");

         props2.put("i", "2");

@@ -443,7 +748,7 @@
         props2.put("string", "bar");

         props2.put("strings", "{baz, bar, foo}");

         

-        instance.reconfigure(props2);

+        ci.reconfigure(props2);

     }

 

 }

diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java
index fc2018c..63c3e8c 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java
@@ -32,6 +32,8 @@
     ComponentInstance instance;

     

     ComponentInstance instance2;

+    

+    ComponentInstance instance3;

 

     public void setUp() {

         Factory fact = Utils.getFactoryByName(context, "CONFIG-MethodConfigurableCheckService");

@@ -90,14 +92,23 @@
            fail("Cannot create the under-test instance 2 : " + e.getMessage());

         }

         

+        try {

+            instance3 = fact.createComponentInstance(null);

+        } catch(Exception e) {

+           e.printStackTrace();

+           fail("Cannot create the under-test instance 3 : " + e.getMessage());

+        }

+        

         

     }

     

     public void tearDown() {

         instance.dispose();

         instance2.dispose();

+        instance3.dispose();

         instance = null;

         instance2 = null;

+        instance3 = null;

     }

     

     public void testConfigurationPrimitive() {

@@ -1140,4 +1151,468 @@
         ci.reconfigure(props2);

     }

 

+    public void testConfigurationPrimitiveNoValue() {

+            ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());

+            assertNotNull("Test check service availability", ref);

+            CheckService check = (CheckService) context.getService(ref);

+            Properties props = check.getProps();

+            

+            Byte b = (Byte) props.get("b");

+            Short s = (Short) props.get("s");

+            Integer i = (Integer) props.get("i");

+            Long l = (Long) props.get("l");

+            Double d = (Double) props.get("d");

+            Float f = (Float) props.get("f");

+            Character c = (Character) props.get("c");

+            Boolean bool = (Boolean) props.get("bool");

+                    

+            assertEquals("Check b", b, new Byte("0"));

+            assertEquals("Check s", s, new Short("0"));

+            assertEquals("Check i", i, new Integer("0"));

+            assertEquals("Check l", l, new Long("0"));

+            assertEquals("Check d", d, new Double("0"));

+            assertEquals("Check f", f, new Float("0"));

+            assertEquals("Check c", c, new Character((char) 0));

+            assertEquals("Check bool", bool, new Boolean("false"));

+            

+            Integer upb = (Integer) props.get("upb");

+            Integer ups = (Integer) props.get("ups");

+            Integer upi = (Integer) props.get("upi");

+            Integer upl = (Integer) props.get("upl");

+            Integer upd = (Integer) props.get("upd");

+            Integer upf = (Integer) props.get("upf");

+            Integer upc = (Integer) props.get("upc");

+            Integer upbool = (Integer) props.get("upbool");

+            

+            assertEquals("Check upb", upb, new Integer(0));

+            assertEquals("Check ups", ups, new Integer(0));

+            assertEquals("Check upi", upi, new Integer(0));

+            assertEquals("Check upl", upl, new Integer(0));

+            assertEquals("Check upd", upd, new Integer(0));

+            assertEquals("Check upf", upf, new Integer(0));

+            assertEquals("Check upc", upc, new Integer(0));

+            assertEquals("Check upbool", upbool, new Integer(0));

+            

+            reconfigure(instance3);

+            

+            ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());

+            assertNotNull("Test check service availability", ref);

+            check = (CheckService) context.getService(ref);

+            props = check.getProps();

+            

+            b = (Byte) props.get("b");

+            s = (Short) props.get("s");

+            i = (Integer) props.get("i");

+            l = (Long) props.get("l");

+            d = (Double) props.get("d");

+            f = (Float) props.get("f");

+            c = (Character) props.get("c");

+            bool = (Boolean) props.get("bool");

+            

+            assertEquals("2) Check b ("+b+")", b, new Byte("2"));

+            assertEquals("2) Check s", s, new Short("2"));

+            assertEquals("2) Check i", i, new Integer("2"));

+            assertEquals("2) Check l", l, new Long("2"));

+            assertEquals("2) Check d", d, new Double("2"));

+            assertEquals("2) Check f", f, new Float("2"));

+            assertEquals("2) Check c", c, new Character('b'));

+            assertEquals("2) Check bool", bool, new Boolean("false"));

+            

+            upb = (Integer) props.get("upb");

+            ups = (Integer) props.get("ups");

+            upi = (Integer) props.get("upi");

+            upl = (Integer) props.get("upl");

+            upd = (Integer) props.get("upd");

+            upf = (Integer) props.get("upf");

+            upc = (Integer) props.get("upc");

+            upbool = (Integer) props.get("upbool");

+            

+            assertEquals("2) Check upb", upb, new Integer(1));

+            assertEquals("2) Check ups", ups, new Integer(1));

+            assertEquals("2) Check upi", upi, new Integer(1));

+            assertEquals("2) Check upl", upl, new Integer(1));

+            assertEquals("2) Check upd", upd, new Integer(1));

+            assertEquals("2) Check upf", upf, new Integer(1));

+            assertEquals("2) Check upc", upc, new Integer(1));

+            assertEquals("2) Check upbool", upbool, new Integer(1));

+            

+        }

+

+    public void testConfigurationPrimitiveStringNoValue() {

+            ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());

+            assertNotNull("Test check service availability", ref);

+            CheckService check = (CheckService) context.getService(ref);

+            Properties props = check.getProps();

+            

+            Byte b = (Byte) props.get("b");

+            Short s = (Short) props.get("s");

+            Integer i = (Integer) props.get("i");

+            Long l = (Long) props.get("l");

+            Double d = (Double) props.get("d");

+            Float f = (Float) props.get("f");

+            Character c = (Character) props.get("c");

+            Boolean bool = (Boolean) props.get("bool");

+                    

+            assertEquals("Check b", b, new Byte("0"));

+            assertEquals("Check s", s, new Short("0"));

+            assertEquals("Check i", i, new Integer("0"));

+            assertEquals("Check l", l, new Long("0"));

+            assertEquals("Check d", d, new Double("0"));

+            assertEquals("Check f", f, new Float("0"));

+            assertEquals("Check c", c, new Character((char) 0));

+            assertEquals("Check bool", bool, new Boolean("false"));

+            

+            Integer upb = (Integer) props.get("upb");

+            Integer ups = (Integer) props.get("ups");

+            Integer upi = (Integer) props.get("upi");

+            Integer upl = (Integer) props.get("upl");

+            Integer upd = (Integer) props.get("upd");

+            Integer upf = (Integer) props.get("upf");

+            Integer upc = (Integer) props.get("upc");

+            Integer upbool = (Integer) props.get("upbool");

+            

+            assertEquals("Check upb", upb, new Integer(0));

+            assertEquals("Check ups", ups, new Integer(0));

+            assertEquals("Check upi", upi, new Integer(0));

+            assertEquals("Check upl", upl, new Integer(0));

+            assertEquals("Check upd", upd, new Integer(0));

+            assertEquals("Check upf", upf, new Integer(0));

+            assertEquals("Check upc", upc, new Integer(0));

+            assertEquals("Check upbool", upbool, new Integer(0));

+            

+            reconfigureString(instance3);

+            

+            ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());

+            assertNotNull("Test check service availability", ref);

+            check = (CheckService) context.getService(ref);

+            props = check.getProps();

+            

+            b = (Byte) props.get("b");

+            s = (Short) props.get("s");

+            i = (Integer) props.get("i");

+            l = (Long) props.get("l");

+            d = (Double) props.get("d");

+            f = (Float) props.get("f");

+            c = (Character) props.get("c");

+            bool = (Boolean) props.get("bool");

+            

+            assertEquals("2) Check b ("+b+")", b, new Byte("2"));

+            assertEquals("2) Check s", s, new Short("2"));

+            assertEquals("2) Check i", i, new Integer("2"));

+            assertEquals("2) Check l", l, new Long("2"));

+            assertEquals("2) Check d", d, new Double("2"));

+            assertEquals("2) Check f", f, new Float("2"));

+            assertEquals("2) Check c", c, new Character('b'));

+            assertEquals("2) Check bool", bool, new Boolean("false"));

+            

+            upb = (Integer) props.get("upb");

+            ups = (Integer) props.get("ups");

+            upi = (Integer) props.get("upi");

+            upl = (Integer) props.get("upl");

+            upd = (Integer) props.get("upd");

+            upf = (Integer) props.get("upf");

+            upc = (Integer) props.get("upc");

+            upbool = (Integer) props.get("upbool");

+            

+            assertEquals("2) Check upb", upb, new Integer(1));

+            assertEquals("2) Check ups", ups, new Integer(1));

+            assertEquals("2) Check upi", upi, new Integer(1));

+            assertEquals("2) Check upl", upl, new Integer(1));

+            assertEquals("2) Check upd", upd, new Integer(1));

+            assertEquals("2) Check upf", upf, new Integer(1));

+            assertEquals("2) Check upc", upc, new Integer(1));

+            assertEquals("2) Check upbool", upbool, new Integer(1));

+            

+        }

+

+    public void testConfigurationPrimitiveArraysNoValue() {

+            ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());

+            assertNotNull("Test check service availability", ref);

+            CheckService check = (CheckService) context.getService(ref);

+            Properties props = check.getProps();

+ 

+                    

+            byte[] b = (byte[]) props.get("bs");

+            short[] s = (short[]) props.get("ss");

+            int[] i = (int[]) props.get("is");

+            long[] l = (long[]) props.get("ls");

+            double[] d = (double[]) props.get("ds");

+            float[] f = (float[]) props.get("fs");

+            char[] c = (char[]) props.get("cs");

+            boolean[] bool = (boolean[]) props.get("bools");

+                    

+            assertNull("Check b nullity", b);

+            assertNull("Check s nullity", s);

+            assertNull("Check i nullity", i);

+            assertNull("Check l nullity", l);

+            assertNull("Check d nullity", d);

+            assertNull("Check f nullity", f);

+            assertNull("Check c nullity", c);

+            assertNull("Check bool nullity", bool);

+            

+            Integer upb = (Integer) props.get("upbs");

+            Integer ups = (Integer) props.get("upss");

+            Integer upi = (Integer) props.get("upis");

+            Integer upl = (Integer) props.get("upls");

+            Integer upd = (Integer) props.get("upds");

+            Integer upf = (Integer) props.get("upfs");

+            Integer upc = (Integer) props.get("upcs");

+            Integer upbool = (Integer) props.get("upbools");

+            

+            assertEquals("Check upb", upb, new Integer(0));

+            assertEquals("Check ups", ups, new Integer(0));

+            assertEquals("Check upi", upi, new Integer(0));

+            assertEquals("Check upl", upl, new Integer(0));

+            assertEquals("Check upd", upd, new Integer(0));

+            assertEquals("Check upf", upf, new Integer(0));

+            assertEquals("Check upc", upc, new Integer(0));

+            assertEquals("Check upbool", upbool, new Integer(0));

+            

+            reconfigure(instance3);

+            

+            ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());

+            assertNotNull("Test check service availability", ref);

+            check = (CheckService) context.getService(ref);

+            props = check.getProps();

+            

+            b = (byte[]) props.get("bs");

+            s = (short[]) props.get("ss");

+            i = (int[]) props.get("is");

+            l = (long[]) props.get("ls");

+            d = (double[]) props.get("ds");

+            f = (float[]) props.get("fs");

+            c = (char[]) props.get("cs");

+            bool = (boolean[]) props.get("bools");

+            

+            assertEquals("2) Check b 0", b[0], 3);

+            assertEquals("2) Check b 1", b[1], 2);

+            assertEquals("2) Check b 2", b[2], 1);

+            assertEquals("2) Check s 0", s[0], 3);

+            assertEquals("2) Check s 1", s[1], 2);

+            assertEquals("2) Check s 2", s[2], 1);

+            assertEquals("2) Check i 0", i[0], 3);

+            assertEquals("2) Check i 1", i[1], 2);

+            assertEquals("2) Check i 2", i[2], 1);

+            assertEquals("2) Check l 0", l[0], 3);

+            assertEquals("2) Check l 1", l[1], 2);

+            assertEquals("2) Check l 2", l[2], 1);

+            assertEquals("2) Check d 0", d[0], 3);

+            assertEquals("2) Check d 1", d[1], 2);

+            assertEquals("2) Check d 2", d[2], 1);

+            assertEquals("2) Check f 0", f[0], 3);

+            assertEquals("2) Check f 1", f[1], 2);

+            assertEquals("2) Check f 2", f[2], 1);

+            assertEquals("2) Check c 0", c[0], 'c');

+            assertEquals("2) Check c 1", c[1], 'b');

+            assertEquals("2) Check c 2", c[2], 'a');

+            assertFalse("2) Check bool 0", bool[0]);

+            assertFalse("2) Check bool 1", bool[0]);

+            assertFalse("2) Check bool 2", bool[0]);

+            

+            upb = (Integer) props.get("upbs");

+            ups = (Integer) props.get("upss");

+            upi = (Integer) props.get("upis");

+            upl = (Integer) props.get("upls");

+            upd = (Integer) props.get("upds");

+            upf = (Integer) props.get("upfs");

+            upc = (Integer) props.get("upcs");

+            upbool = (Integer) props.get("upbools");

+            

+            assertEquals("2) Check upb", upb, new Integer(1));

+            assertEquals("2) Check ups", ups, new Integer(1));

+            assertEquals("2) Check upi", upi, new Integer(1));

+            assertEquals("2) Check upl", upl, new Integer(1));

+            assertEquals("2) Check upd", upd, new Integer(1));

+            assertEquals("2) Check upf", upf, new Integer(1));

+            assertEquals("2) Check upc", upc, new Integer(1));

+            assertEquals("2) Check upbool", upbool, new Integer(1));

+            

+        }

+

+    public void testConfigurationPrimitiveArraysStringNoValue() {

+            ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());

+            assertNotNull("Test check service availability", ref);

+            CheckService check = (CheckService) context.getService(ref);

+            Properties props = check.getProps();

+            

+            byte[] b = (byte[]) props.get("bs");

+            short[] s = (short[]) props.get("ss");

+            int[] i = (int[]) props.get("is");

+            long[] l = (long[]) props.get("ls");

+            double[] d = (double[]) props.get("ds");

+            float[] f = (float[]) props.get("fs");

+            char[] c = (char[]) props.get("cs");

+            boolean[] bool = (boolean[]) props.get("bools");

+            

+            assertNull("Check b nullity", b);

+            assertNull("Check s nullity", s);

+            assertNull("Check i nullity", i);

+            assertNull("Check l nullity", l);

+            assertNull("Check d nullity", d);

+            assertNull("Check f nullity", f);

+            assertNull("Check c nullity", c);

+            assertNull("Check bool nullity", bool);

+            

+            Integer upb = (Integer) props.get("upbs");

+            Integer ups = (Integer) props.get("upss");

+            Integer upi = (Integer) props.get("upis");

+            Integer upl = (Integer) props.get("upls");

+            Integer upd = (Integer) props.get("upds");

+            Integer upf = (Integer) props.get("upfs");

+            Integer upc = (Integer) props.get("upcs");

+            Integer upbool = (Integer) props.get("upbools");

+            

+            assertEquals("Check upb", upb, new Integer(0));

+            assertEquals("Check ups", ups, new Integer(0));

+            assertEquals("Check upi", upi, new Integer(0));

+            assertEquals("Check upl", upl, new Integer(0));

+            assertEquals("Check upd", upd, new Integer(0));

+            assertEquals("Check upf", upf, new Integer(0));

+            assertEquals("Check upc", upc, new Integer(0));

+            assertEquals("Check upbool", upbool, new Integer(0));

+            

+    

+            reconfigureString(instance3);

+            

+            ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());

+            assertNotNull("Test check service availability", ref);

+            check = (CheckService) context.getService(ref);

+            props = check.getProps();

+            

+            b = (byte[]) props.get("bs");

+            s = (short[]) props.get("ss");

+            i = (int[]) props.get("is");

+            l = (long[]) props.get("ls");

+            d = (double[]) props.get("ds");

+            f = (float[]) props.get("fs");

+            c = (char[]) props.get("cs");

+            bool = (boolean[]) props.get("bools");

+            

+            assertEquals("2) Check b 0", b[0], 3);

+            assertEquals("2) Check b 1", b[1], 2);

+            assertEquals("2) Check b 2", b[2], 1);

+            assertEquals("2) Check s 0", s[0], 3);

+            assertEquals("2) Check s 1", s[1], 2);

+            assertEquals("2) Check s 2", s[2], 1);

+            assertEquals("2) Check i 0", i[0], 3);

+            assertEquals("2) Check i 1", i[1], 2);

+            assertEquals("2) Check i 2", i[2], 1);

+            assertEquals("2) Check l 0", l[0], 3);

+            assertEquals("2) Check l 1", l[1], 2);

+            assertEquals("2) Check l 2", l[2], 1);

+            assertEquals("2) Check d 0", d[0], 3);

+            assertEquals("2) Check d 1", d[1], 2);

+            assertEquals("2) Check d 2", d[2], 1);

+            assertEquals("2) Check f 0", f[0], 3);

+            assertEquals("2) Check f 1", f[1], 2);

+            assertEquals("2) Check f 2", f[2], 1);

+            assertEquals("2) Check c 0", c[0], 'c');

+            assertEquals("2) Check c 1", c[1], 'b');

+            assertEquals("2) Check c 2", c[2], 'a');

+            assertFalse("2) Check bool 0", bool[0]);

+            assertFalse("2) Check bool 1", bool[0]);

+            assertFalse("2) Check bool 2", bool[0]);

+            

+            upb = (Integer) props.get("upbs");

+            ups = (Integer) props.get("upss");

+            upi = (Integer) props.get("upis");

+            upl = (Integer) props.get("upls");

+            upd = (Integer) props.get("upds");

+            upf = (Integer) props.get("upfs");

+            upc = (Integer) props.get("upcs");

+            upbool = (Integer) props.get("upbools");

+            

+            assertEquals("2) Check upb", upb, new Integer(1));

+            assertEquals("2) Check ups", ups, new Integer(1));

+            assertEquals("2) Check upi", upi, new Integer(1));

+            assertEquals("2) Check upl", upl, new Integer(1));

+            assertEquals("2) Check upd", upd, new Integer(1));

+            assertEquals("2) Check upf", upf, new Integer(1));

+            assertEquals("2) Check upc", upc, new Integer(1));

+            assertEquals("2) Check upbool", upbool, new Integer(1));

+            

+        }

+

+    public void testConfigurationObjNoValue() {

+            ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());

+            assertNotNull("Test check service availability", ref);

+            CheckService check = (CheckService) context.getService(ref);

+            Properties props = check.getProps();

+            

+            String s = (String) props.get("string");

+            String[] ss = (String[]) props.get("strings");

+                    

+            assertEquals("Check string", s, null);

+            assertEquals("Check strings", ss, null);

+

+            

+            Integer upString = (Integer) props.get("upstring");

+            Integer upStrings = (Integer) props.get("upstrings");

+            

+            assertEquals("Check upString", upString, new Integer(0));

+            assertEquals("Check upStrings", upStrings, new Integer(0));

+            

+            reconfigure(instance3);

+            

+            ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());

+            assertNotNull("Test check service availability", ref);

+            check = (CheckService) context.getService(ref);

+            props = check.getProps();

+            

+            s = (String) props.get("string");

+            ss = (String[]) props.get("strings");

+                    

+            assertEquals("2) Check string", s, "bar");

+            assertEquals("2) Check strings 0", ss[0], "baz");

+            assertEquals("2) Check strings 1", ss[1], "bar");

+            assertEquals("2) Check strings 2", ss[2], "foo");

+            

+            upString = (Integer) props.get("upstring");

+            upStrings = (Integer) props.get("upstrings");

+            

+            assertEquals("2) Check upString", upString, new Integer(1));

+            assertEquals("2) Check upStrings", upStrings, new Integer(1));

+        }

+

+    public void testConfigurationObjStringNoValue() {

+            ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());

+            assertNotNull("Test check service availability", ref);

+            CheckService check = (CheckService) context.getService(ref);

+            Properties props = check.getProps();

+            

+            String s = (String) props.get("string");

+            String[] ss = (String[]) props.get("strings");

+                    

+            assertEquals("Check string", s, null);

+            assertEquals("Check strings", ss, null);

+

+            

+            Integer upString = (Integer) props.get("upstring");

+            Integer upStrings = (Integer) props.get("upstrings");

+            

+            assertEquals("Check upString", upString, new Integer(0));

+            assertEquals("Check upStrings", upStrings, new Integer(0));

+            

+            reconfigureString(instance3);

+            

+            ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());

+            assertNotNull("Test check service availability", ref);

+            check = (CheckService) context.getService(ref);

+            props = check.getProps();

+            

+            s = (String) props.get("string");

+            ss = (String[]) props.get("strings");

+                    

+            assertEquals("2) Check string", s, "bar");

+            assertEquals("2) Check strings 0", ss[0], "baz");

+            assertEquals("2) Check strings 1", ss[1], "bar");

+            assertEquals("2) Check strings 2", ss[2], "foo");

+            

+            upString = (Integer) props.get("upstring");

+            upStrings = (Integer) props.get("upstrings");

+            

+            assertEquals("2) Check upString", upString, new Integer(1));

+            assertEquals("2) Check upStrings", upStrings, new Integer(1));

+        }

+

 }

diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestPropertyModifier.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestPropertyModifier.java
new file mode 100644
index 0000000..9f8b7d7
--- /dev/null
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestPropertyModifier.java
@@ -0,0 +1,76 @@
+package org.apache.felix.ipojo.test.scenarios.configuration;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.ServiceReference;
+
+public class TestPropertyModifier extends OSGiTestCase {
+    
+    public void testPropertyModifier() {
+        ComponentInstance ci = null; 
+        Factory factory =  Utils.getFactoryByName(context, "org.apache.felix.ipojo.test.scenarios.component.PropertyModifier");
+        Properties props = new Properties();
+        props.put("cls", new String[] {FooService.class.getName()});
+        try {
+            ci = factory.createComponentInstance(props);
+        } catch (Exception e) {
+            fail(e.getMessage());
+        } 
+        
+        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), ci.getInstanceName());
+        assertNotNull("Check ref", ref);
+        
+        // Check the service property
+        // Not exposed here:
+        assertNull("Classes -0", ref.getProperty("classes"));
+        
+        CheckService check = (CheckService) context.getService(ref);
+        assertTrue(check.check());
+        
+        // Property exposed now.
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), ci.getInstanceName());
+        Class[] str = (Class[]) ref.getProperty("classes");
+        assertEquals("Classes size", 1, str.length);
+        assertEquals("Classes[0]", FooService.class.getName(), str[0].getName());
+        
+        Properties p = check.getProps();
+        Class[] str2 = (Class[]) p.get("classes");
+        assertEquals("Classes size -2", 1, str2.length);
+        assertEquals("Classes[0] -2", FooService.class.getName(), str2[0].getName());
+        
+        Properties props2 = new Properties();
+        props2.put("cls", new String[] {FooService.class.getName(), CheckService.class.getName()});
+        try {
+            ci.reconfigure(props2);
+        } catch (Exception e) {
+            fail(e.getMessage());
+        } 
+        
+        // Check the service property
+        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), ci.getInstanceName());
+        assertNotNull("Check ref", ref);
+        str = (Class[]) ref.getProperty("classes");
+        assertEquals("Classes size -3", 2, str.length);
+        assertEquals("Classes[0] -3", FooService.class.getName(), str[0].getName());
+        assertEquals("Classes[1] -3", CheckService.class.getName(), str[1].getName());
+
+        
+        check = (CheckService) context.getService(ref);
+        p = check.getProps();
+        str2 = (Class[]) p.get("classes");
+        assertEquals("Classes size -4", 2, str2.length);
+        assertEquals("Classes[0] -4", FooService.class.getName(), str2[0].getName());
+        assertEquals("Classes[1] -4", CheckService.class.getName(), str2[1].getName());
+        
+        ci.dispose();
+        context.ungetService(ref);
+        
+    }
+
+}
diff --git a/ipojo/tests/core/configuration/src/main/resources/metadata.xml b/ipojo/tests/core/configuration/src/main/resources/metadata.xml
index 0826a26..fb7800a 100644
--- a/ipojo/tests/core/configuration/src/main/resources/metadata.xml
+++ b/ipojo/tests/core/configuration/src/main/resources/metadata.xml
@@ -13,6 +13,21 @@
 			<property name="intAProp" field="intAProp" value="{1,2, 3}" />

 		</properties>

 	</component>

+	

+	<component

+		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn"

+		name="CONFIG-FooProviderType-ConfNoValue" architecture="true">

+		<provides />

+		<properties propagation="false">

+			<property name="int" field="intProp"/>

+			<property name="boolean" field="boolProp"/>

+			<property name="string" field="strProp"/>

+			<property name="strAProp" field="strAProp"/>

+			<property name="intAProp" field="intAProp"/>

+		</properties>

+	</component>

+	

+	

 	<component

 		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"

 		name="CONFIG-FooProviderType-3" architecture="true">

@@ -223,4 +238,13 @@
 		<property name="empty-map" type="map"/>

 	</instance>

 	

+	<component classname="org.apache.felix.ipojo.test.scenarios.component.PropertyModifier">

+		<provides>

+			<property field="classes"/>

+		</provides>

+		<properties>

+			<property method="setClasses" name="cls"/>

+		</properties>

+	</component>

+	

 </ipojo>

diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java
index 841efe0..2822832 100644
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java
+++ b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java
@@ -52,6 +52,27 @@
 	}

 	

 	/**

+     * Configuration without the name property.

+     */

+    public void testWithoutNameOpt() {

+        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2opt");

+        

+        Properties  p = new Properties();

+        p.put("int", new Integer(3));

+        p.put("long", new Long(42));

+        p.put("string", "absdir");

+        p.put("strAProp", new String[] {"a"});

+        p.put("intAProp", new int[] {1,2});

+        

+        ComponentInstance ci = null;

+        try {

+            ci = f.createComponentInstance(p);

+            ci.dispose();

+        } catch(Exception e) { fail("an acceptable configuration is refused : " + e.getMessage()); }

+        

+    }

+	

+	/**

 	 * Empty configuration.

 	 */

 	public void testEmptyConfiguration() {

@@ -66,6 +87,20 @@
 	}

 	

 	/**

+     * Empty configuration.

+     */

+    public void testEmptyConfigurationOpt() {

+        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2opt");

+        Properties  p = new Properties();

+        

+        ComponentInstance ci = null;

+        try {

+            ci = f.createComponentInstance(p);

+            ci.dispose();

+        } catch(Exception e) { fail("An acceptable configuration is refused"); }

+    }

+	

+	/**

 	 * Empty configuration (just the name).

 	 */

 	public void testEmptyConfiguration2() {

@@ -82,6 +117,23 @@
 	}

 	

 	/**

+     * Empty configuration (just the name).

+     */

+    public void testEmptyConfiguration2opt() {

+        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2opt");

+        Properties  p = new Properties();

+        p.put("instance.name","ko");

+        ComponentInstance ci = null;

+        try {

+            ci = f.createComponentInstance(p);

+            ci.dispose();

+        } catch(Exception e) { 

+            fail("An acceptable configuration is refused");

+        }

+        

+    }

+	

+	/**

 	 * Null configuration (accept).

 	 */

 	public void testNull() {

@@ -95,6 +147,19 @@
 	}

 	

 	/**

+     * Null configuration (accept).

+     */

+    public void testNullOpt() {

+        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2opt");

+        

+        ComponentInstance ci = null;

+        try {

+            ci = f.createComponentInstance(null);

+            ci.dispose();

+        } catch(Exception e) { fail("An acceptable configuration is refused"); }

+    }

+	

+	/**

 	 * Null configuration (fail).

 	 */

 	public void testNull2() {

@@ -110,6 +175,23 @@
 	}

 	

 	/**

+     * Null configuration (success).

+     */

+    public void testNull2Opt() {

+        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2opt");

+        

+        ComponentInstance ci = null;

+        try {

+            ci = f.createComponentInstance(null);

+            ci.dispose();

+        } catch(Exception e) {

+            fail("An acceptable configuration is refused");

+        }

+        

+        

+    }

+	

+	/**

 	 * Check static properties.

 	 */

 	public void testStaticOK() {

@@ -133,6 +215,29 @@
 	}

 	

 	/**

+     * Check static properties.

+     */

+    public void testStaticOKopt() {

+        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2opt");

+        

+        Properties  p = new Properties();

+        p.put("instance.name","ok");

+        p.put("int", new Integer(3));

+        p.put("long", new Long(42));

+        p.put("string", "absdir");

+        p.put("strAProp", new String[] {"a"});

+        p.put("intAProp", new int[] {1,2});

+        

+        ComponentInstance ci = null;

+        try {

+            ci = f.createComponentInstance(p);

+            ci.dispose();

+        } catch(Exception e) {

+            fail("An acceptable configuration is rejected : " + e.getMessage());

+        }

+    }

+	

+	/**

 	 * Check dynamic properties.

 	 */

 	public void testDynamicOK() {

@@ -156,6 +261,46 @@
 		}

 	}

 	

+	

+	/**

+     * Check dynamic properties.

+     */

+    public void testDynamicOKopt() {

+        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dynopt");

+        

+        Properties  p = new Properties();

+        p.put("instance.name","ok");

+        p.put("int", new Integer(3));

+        p.put("boolean", new Boolean(true));

+        p.put("string", "absdir");

+        p.put("strAProp", new String[] {"a"});

+        p.put("intAProp", new int[] {1,2});

+        

+        ComponentInstance ci = null;

+        try {

+            ci = f.createComponentInstance(p);

+            ci.dispose();

+        } catch(Exception e) {

+            e.printStackTrace();

+            fail("An acceptable configuration is rejected : " + e.getMessage());

+        }

+        

+        p = new Properties();

+        p.put("instance.name","ok");

+        p.put("boolean", new Boolean(true));

+        p.put("strAProp", new String[] {"a"});

+        p.put("intAProp", new int[] {1,2});

+        

+        ci = null;

+        try {

+            ci = f.createComponentInstance(p);

+            ci.dispose();

+        } catch(Exception e) {

+            e.printStackTrace();

+            fail("An acceptable configuration is rejected (2) : " + e.getMessage());

+        }

+    }

+    

 	/**

 	 * Check inconsistent types.

 	 */

@@ -180,6 +325,43 @@
 	}

 	

 	/**

+     * Check inconsistent types.

+     */

+    public void testDynamicBadTypeOpt() {

+        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dynopt");

+        

+        Properties  p = new Properties();

+        p.put("instance.name","ok");

+        p.put("int", new Integer(3));

+        p.put("long", new Long(42));

+        p.put("string", "absdir");

+        p.put("strAProp", new String[] {"a"});

+        p.put("intAProp", new int[] {1,2});

+        

+        ComponentInstance ci = null;

+        try {

+            ci = f.createComponentInstance(p);

+            ci.dispose();

+        } catch(Exception e) {

+            fail("An acceptable configuration is rejected : " + e.getMessage());

+        }

+        

+        p = new Properties();

+        p.put("instance.name","ok");

+        p.put("int", new Integer(3));

+        p.put("strAProp", new String[] {"a"});

+        p.put("intAProp", new int[] {1,2});

+        

+        ci = null;

+        try {

+            ci = f.createComponentInstance(p);

+            ci.dispose();

+        } catch(Exception e) {

+            fail("An acceptable configuration is rejected (2) : " + e.getMessage());

+        }

+    }

+	

+	/**

 	 * Check good configuration (with overriding).

 	 */

 	public void testDynamicComplete() {

@@ -203,6 +385,44 @@
 	}

 	

 	/**

+     * Check good configuration (with overriding).

+     */

+    public void testDynamicCompleteOpt() {

+        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2opt");

+        

+        Properties  p = new Properties();

+        p.put("instance.name","ok");

+        p.put("int", new Integer(3));

+        p.put("boolean", new Boolean(true));

+        p.put("string", "absdir");

+        p.put("strAProp", new String[] {"a"});

+        p.put("intAProp", new int[] {1,2});

+        

+        ComponentInstance ci = null;

+        try {

+            ci = f.createComponentInstance(p);

+            ci.dispose();

+        } catch(Exception e) {

+            fail("An acceptable configuration is rejected : " + e.getMessage());

+        }

+        

+        

+        p = new Properties();

+        p.put("instance.name","ok");

+        p.put("int", new Integer(3));

+        p.put("strAProp", new String[] {"a"});

+        p.put("intAProp", new int[] {1,2});

+        

+        ci = null;

+        try {

+            ci = f.createComponentInstance(p);

+            ci.dispose();

+        } catch(Exception e) {

+            fail("An acceptable configuration is rejected (2) : " + e.getMessage());

+        }

+    }

+	

+	/**

 	 * Check good configuration.

 	 */

 	public void testDynamicJustEnough() {

@@ -224,6 +444,40 @@
 	}

 	

 	/**

+     * Check good configuration.

+     */

+    public void testDynamicJustEnoughOpt() {

+        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2opt");

+        

+        Properties  p = new Properties();

+        p.put("instance.name","ok");

+        p.put("boolean", new Boolean(true));

+        p.put("string", "absdir");

+        p.put("strAProp", new String[] {"a"});

+        

+        ComponentInstance ci = null;

+        try {

+            ci = f.createComponentInstance(p);

+            ci.dispose();

+        } catch(Exception e) {

+            fail("An acceptable configuration is rejected : " + e.getMessage());

+        }

+        

+        p = new Properties();

+        p.put("instance.name","ok");

+        p.put("boolean", new Boolean(true));

+        p.put("strAProp", new String[] {"a"});

+        

+        ci = null;

+        try {

+            ci = f.createComponentInstance(p);

+            ci.dispose();

+        } catch(Exception e) {

+            fail("An acceptable configuration is rejected : " + e.getMessage());

+        }

+    }

+	

+	/**

 	 * Check good configuration.

 	 */

 	public void testDynamicMix() {

@@ -246,6 +500,42 @@
 	}

 	

 	/**

+     * Check good configuration.

+     */

+    public void testDynamicMixOpt() {

+        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2opt");

+        

+        Properties  p = new Properties();

+        p.put("instance.name","ok");

+        p.put("boolean", new Boolean(true));

+        p.put("string", "absdir");

+        p.put("strAProp", new String[] {"a"});

+        p.put("intAProp", new int[] {1,2});

+        

+        ComponentInstance ci = null;

+        try {

+            ci = f.createComponentInstance(p);

+            ci.dispose();

+        } catch(Exception e) {

+            fail("An acceptable configuration is rejected : " + e.getMessage());

+        }

+        

+        p = new Properties();

+        p.put("instance.name","ok");

+        p.put("string", "absdir");

+        p.put("strAProp", new String[] {"a"});

+        p.put("intAProp", new int[] {1,2});

+        

+        ci = null;

+        try {

+            ci = f.createComponentInstance(p);

+            ci.dispose();

+        } catch(Exception e) {

+            fail("An acceptable configuration is rejected : " + e.getMessage());

+        }

+    }

+	

+	/**

 	 * Check uncomplete configuration.

 	 */

 	public void testDynamicUncomplete() {

@@ -267,6 +557,27 @@
 	}

 	

 	/**

+     * Check uncomplete configuration.

+     */

+    public void testDynamicUncompleteOpt() {

+        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2opt");

+        

+        Properties  p = new Properties();

+        p.put("instance.name","ok");

+        p.put("string", "absdir");

+        p.put("strAProp", new String[] {"a"});

+        p.put("intAProp", new int[] {1,2});

+        

+        ComponentInstance ci = null;

+        try {

+            ci = f.createComponentInstance(p);

+            ci.dispose();

+        } catch(Exception e) { fail("An acceptable configuration is refused"); }

+        

+        

+    }

+	

+	/**

 	 * Check good configuration (more properties).

 	 */

 	public void testDynamicMore() {

@@ -291,6 +602,30 @@
 	}

 	

 	/**

+     * Check good configuration (more properties).

+     */

+    public void testDynamicMoreOpt() {

+        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2opt");

+        

+        Properties  p = new Properties();

+        p.put("instance.name","ok");

+        p.put("int", new Integer(3));

+        p.put("boolean", new Boolean(true));

+        p.put("string", "absdir");

+        p.put("strAProp", new String[] {"a"});

+        p.put("intAProp", new int[] {1,2});

+        p.put("tralala", "foo");

+        

+        ComponentInstance ci = null;

+        try {

+            ci = f.createComponentInstance(p);

+            ci.dispose();

+        } catch(Exception e) {

+            fail("An acceptable configuration is rejected : " + e.getMessage());

+        }

+    }

+	

+	/**

 	 * Check properties affecting services and component.

 	 */

 	public void testDoubleProps() {

@@ -314,6 +649,31 @@
 			fail("An acceptable configuration is rejected : " + e.getMessage());

 		}

 	}

+	

+	/**

+     * Check properties affecting services and component.

+     */

+    public void testDoublePropsOpt() {

+        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2opt");

+        

+        Properties  p = new Properties();

+        p.put("instance.name","ok");

+        p.put("int", new Integer(3));

+        p.put("boolean", new Boolean(true));

+        p.put("string", "absdir");

+        p.put("strAProp", new String[] {"a"});

+        p.put("intAProp", new int[] {1,2});

+        p.put("boolean", new Boolean(false));

+        p.put("string", "toto");

+        

+        ComponentInstance ci = null;

+        try {

+            ci = f.createComponentInstance(p);

+            ci.dispose();

+        } catch(Exception e) {

+            fail("An acceptable configuration is rejected : " + e.getMessage());

+        }

+    }

     

     /**

      * Check instance name unicity.

@@ -367,7 +727,7 @@
     public void testUnicity3() {

         Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2");

         

-        ComponentInstance ci1 = null,ci2 = null, ci3 = null;

+        ComponentInstance ci1 = null,ci2 = null;

         try {

             Properties p1 = new Properties();

             p1.put("instance.name","name1");

@@ -376,11 +736,8 @@
             p2.put("instance.name","name1");

             ci2 = f.createComponentInstance(p2);

             assertNotEquals("Check name ci1, ci2", ci1.getInstanceName(), ci2.getInstanceName());

-            assertNotEquals("Check name ci1, ci3", ci1.getInstanceName(), ci3.getInstanceName());

-            assertNotEquals("Check name ci3, ci2", ci3.getInstanceName(), ci3.getInstanceName());

             ci1.dispose();

             ci2.dispose();

-            ci3.dispose();

         } catch(Exception e) { 

             ci1.dispose();

             return; }

@@ -395,7 +752,7 @@
         Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2");

         Factory f2 = Utils.getFactoryByName(context, "Factories-FooProviderType-1");

         

-        ComponentInstance ci1 = null,ci2 = null, ci3 = null;

+        ComponentInstance ci1 = null,ci2 = null;

         try {

             Properties p1 = new Properties();

             p1.put("instance.name","name1");

@@ -403,13 +760,9 @@
             Properties p2 = new Properties();

             p2.put("instance.name","name1");

             ci2 = f2.createComponentInstance(p2);

-            System.err.println("==== " + ci1.getInstanceName() + " === " + ci2.getInstanceName());

             assertNotEquals("Check name ci1, ci2", ci1.getInstanceName(), ci2.getInstanceName());

-            assertNotEquals("Check name ci1, ci3", ci1.getInstanceName(), ci3.getInstanceName());

-            assertNotEquals("Check name ci3, ci2", ci3.getInstanceName(), ci3.getInstanceName());

             ci1.dispose();

             ci2.dispose();

-            ci3.dispose();

         } catch(Exception e) { 

             ci1.dispose();

             return; }

diff --git a/ipojo/tests/core/factories/src/main/resources/metadata.xml b/ipojo/tests/core/factories/src/main/resources/metadata.xml
index 8781753..7daf702 100644
--- a/ipojo/tests/core/factories/src/main/resources/metadata.xml
+++ b/ipojo/tests/core/factories/src/main/resources/metadata.xml
@@ -1,8 +1,5 @@
-<ipojo

-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

-    xsi:schemaLocation="org.apache.felix.ipojo http://people.apache.org/~clement/ipojo/schemas/core.xsd"

-    xmlns="org.apache.felix.ipojo"

-    >

+<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

+	xsi:schemaLocation="org.apache.felix.ipojo http://people.apache.org/~clement/ipojo/schemas/core.xsd" xmlns="org.apache.felix.ipojo">

 	<!-- Simple provider  -->

 	<component

 		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"

@@ -22,12 +19,25 @@
 		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn"

 		name="Factories-FooProviderType-Dyn" architecture="true">

 		<provides>

-			<property name="int" field="intProp" value="2" />

-			<property name="boolean" field="boolProp" value="false" />

-			<property name="string" field="strProp" value="foo" />

+			<property name="int" field="intProp" value="2" mandatory="true"/>

+			<property name="boolean" field="boolProp" value="false" mandatory="true"/>

+			<property name="string" field="strProp" value="foo" mandatory="true"/>

 			<property name="strAProp" field="strAProp"

-				value="{foo, bar}" />

-			<property name="intAProp" field="intAProp" value="{ 1,2,3}" />

+				value="{foo, bar}" mandatory="true"/>

+			<property name="intAProp" field="intAProp" value="{ 1,2,3}" mandatory="true"/>

+		</provides>

+	</component>

+	

+	<component

+		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn"

+		name="Factories-FooProviderType-Dynopt" architecture="true">

+		<provides>

+			<property name="int" field="intProp" value="2"/>

+			<property name="boolean" field="boolProp" value="false"/>

+			<property name="string" field="strProp" value="foo"/>

+			<property name="strAProp" field="strAProp"

+				value="{foo, bar}"/>

+			<property name="intAProp" field="intAProp" value="{ 1,2,3}"/>

 		</provides>

 	</component>

 	

@@ -35,12 +45,25 @@
 		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"

 		name="Factories-FooProviderType-2" architecture="true">

 		<provides>

-			<property name="int" type="int" value="2" />

-			<property name="long" type="long" value="40" />

-			<property name="string" type="java.lang.String" value="foo" />

+			<property name="int" type="int" value="2" mandatory="true" />

+			<property name="long" type="long" value="40" mandatory="true"/>

+			<property name="string" type="java.lang.String" value="foo" mandatory="true"/>

+			<property name="strAProp" type="java.lang.String[]"

+				value="{foo, bar}" mandatory="true" />

+			<property name="intAProp" type="int[]" value="{1,2,3}" mandatory="true"/>

+		</provides>

+	</component>

+	

+	<component

+		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"

+		name="Factories-FooProviderType-2opt" architecture="true">

+		<provides>

+			<property name="int" type="int" value="2"/>

+			<property name="long" type="long" value="40"/>

+			<property name="string" type="java.lang.String" value="foo"/>

 			<property name="strAProp" type="java.lang.String[]"

 				value="{foo, bar}" />

-			<property name="intAProp" type="int[]" value="{1,2,3}" />

+			<property name="intAProp" type="int[]" value="{1,2,3}"/>

 		</provides>

 	</component>

 	

@@ -48,12 +71,25 @@
 		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn2"

 		name="Factories-FooProviderType-Dyn2" architecture="true">

 		<provides>

-			<property name="int" field="intProp" value="4" />

-			<property name="boolean" field="boolProp" />

-			<property name="string" field="strProp" />

-			<property name="strAProp" field="strAProp" />

+			<property name="int" field="intProp" value="4" mandatory="true"/>

+			<property name="boolean" field="boolProp" mandatory="true"/>

+			<property name="string" field="strProp" mandatory="true"/>

+			<property name="strAProp" field="strAProp" mandatory="true"/>

 			<property name="intAProp" field="intAProp"

-				value="{1, 2,3 }" />

+				value="{1, 2,3 }" mandatory="true"/>

+		</provides>

+	</component>

+	

+	<component

+		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn2"

+		name="Factories-FooProviderType-Dyn2opt" architecture="true">

+		<provides>

+			<property name="int" field="intProp" value="4" />

+			<property name="boolean" field="boolProp"/>

+			<property name="string" field="strProp"/>

+			<property name="strAProp" field="strAProp"/>

+			<property name="intAProp" field="intAProp"

+				value="{1, 2,3 }"/>

 		</provides>

 	</component>

 	

@@ -61,13 +97,27 @@
 		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"

 		name="Factories-FooProviderType-3" architecture="true">

 		<provides>

-			<property name="foo" field="m_foo" />

-			<property name="bar" field="m_bar" />

-			<property name="baz" type="java.lang.String" />

+			<property name="foo" field="m_foo" mandatory="true"/>

+			<property name="bar" field="m_bar" mandatory="true"/>

+			<property name="baz" type="java.lang.String" mandatory="true"/>

 		</provides>

 		<properties propagation="true">

-			<property name="foo" field="m_foo" />

-			<property name="bar" field="m_bar" />

+			<property name="foo" field="m_foo" mandatory="true"/>

+			<property name="bar" field="m_bar" mandatory="true"/>

+		</properties>

+	</component>

+	

+	<component

+		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"

+		name="Factories-FooProviderType-3opt" architecture="true">

+		<provides>

+			<property name="foo" field="m_foo"/>

+			<property name="bar" field="m_bar"/>

+			<property name="baz" type="java.lang.String"/>

+		</provides>

+		<properties propagation="true">

+			<property name="foo" field="m_foo"/>

+			<property name="bar" field="m_bar"/>

 		</properties>

 	</component>

 	

diff --git a/ipojo/tests/core/service-dependency-comparator/pom.xml b/ipojo/tests/core/service-dependency-comparator/pom.xml
new file mode 100644
index 0000000..56ab721
--- /dev/null
+++ b/ipojo/tests/core/service-dependency-comparator/pom.xml
@@ -0,0 +1,104 @@
+<!--

+	Licensed to the Apache Software Foundation (ASF) under one

+	or more contributor license agreements.  See the NOTICE file

+	distributed with this work for additional information

+	regarding copyright ownership.  The ASF licenses this file

+	to you under the Apache License, Version 2.0 (the

+	"License"); you may not use this file except in compliance

+	with the License.  You may obtain a copy of the License at

+	

+	http://www.apache.org/licenses/LICENSE-2.0

+	

+	Unless required by applicable law or agreed to in writing,

+	software distributed under the License is distributed on an

+	"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

+	KIND, either express or implied.  See the License for the

+	specific language governing permissions and limitations

+	under the License.

+-->

+<project>

+	<modelVersion>4.0.0</modelVersion>

+	<packaging>bundle</packaging>

+	<name>iPOJO Service Dependency (Binding Policy) Test Suite</name>

+	<artifactId>tests.core.service.dependency.bindingpolicy</artifactId>

+	<groupId>ipojo.tests</groupId>

+	<version>1.1.0-SNAPSHOT</version>

+	<dependencies>

+		<dependency>

+			<groupId>org.apache.felix</groupId>

+			<artifactId>org.apache.felix.ipojo</artifactId>

+			<version>1.1.0-SNAPSHOT</version>

+		</dependency>

+		<dependency>

+			<groupId>org.apache.felix</groupId>

+			<artifactId>org.apache.felix.ipojo.metadata</artifactId>

+			<version>1.1.0-SNAPSHOT</version>

+		</dependency>

+		<dependency>

+			<groupId>org.apache.felix</groupId>

+			<artifactId>org.osgi.core</artifactId>

+			<version>1.2.0</version>

+		</dependency>

+		<dependency>

+			<groupId>junit</groupId>

+			<artifactId>junit</artifactId>

+			<version>3.8.1</version>

+		</dependency>

+		<dependency>

+			<groupId>ipojo.examples</groupId>

+			<artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>

+			<version>1.1.0-SNAPSHOT</version>

+		</dependency>

+		<dependency>

+			<groupId>ipojo.tests</groupId>

+			<artifactId>tests.core.service.dependency</artifactId>

+			<version>1.1.0-SNAPSHOT</version>

+		</dependency>

+	</dependencies>

+	<build>

+		<plugins>

+			<plugin>

+				<groupId>org.apache.felix</groupId>

+				<artifactId>maven-bundle-plugin</artifactId>

+				<version>1.4.3</version>

+				<extensions>true</extensions>

+				<configuration>

+					<instructions>

+						<Bundle-SymbolicName>

+							${pom.artifactId}

+						</Bundle-SymbolicName>

+						<Private-Package>

+							org.apache.felix.ipojo.test.scenarios.service.dependency.comparator

+						</Private-Package>

+						<Test-Suite>

+							org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.ComparatorTestCase						

+						</Test-Suite>

+					</instructions>

+				</configuration>

+			</plugin>

+			<plugin>

+				<groupId>org.apache.felix</groupId>

+				<artifactId>maven-ipojo-plugin</artifactId>

+				<version>1.1.0-SNAPSHOT</version>

+				<executions>

+					<execution>

+						<goals>

+							<goal>ipojo-bundle</goal>

+						</goals>

+						<configuration>

+							<ignoreAnnotations>true</ignoreAnnotations>

+						</configuration>

+					</execution>

+				</executions>

+			</plugin>

+			<plugin>

+				<groupId>org.apache.maven.plugins</groupId>

+				<artifactId>maven-compiler-plugin</artifactId>

+				<configuration>

+					<source>1.4</source>

+					<target>1.4</target>

+				</configuration>

+			</plugin>

+		</plugins>

+	</build>

+</project>

diff --git a/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/ComparatorTestCase.java b/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/ComparatorTestCase.java
new file mode 100644
index 0000000..6cde37c
--- /dev/null
+++ b/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/ComparatorTestCase.java
@@ -0,0 +1,141 @@
+package org.apache.felix.ipojo.test.scenarios.service.dependency.comparator;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
+import org.osgi.framework.ServiceReference;
+
+public class ComparatorTestCase extends OSGiTestCase {
+    
+    String gradeFactory="COMPARATOR-gradedFooProvider";
+    String dynamic = "COMPARATOR-DynamicCheckService";
+    String dynamicpriority = "COMPARATOR-DynamicPriorityCheckService";
+    
+    
+    IPOJOHelper helper;
+    ComponentInstance dynInstance;
+    ComponentInstance dpInstance;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+        dynInstance = helper.createComponentInstance(dynamic, (Properties) null);
+        dpInstance = helper.createComponentInstance(dynamicpriority, (Properties) null);
+    }
+    
+    public void tearDown() {
+        dynInstance.dispose();
+       dpInstance.dispose();
+    }
+    
+    public void testDynamic() {
+        ComponentInstance grade1 = createGrade(1);
+        ComponentInstance grade2 = createGrade(2);
+        
+        ServiceReference ref = getServiceReferenceByName(CheckService.class.getName(), dynInstance.getInstanceName());
+        assertNotNull("CS availability", ref);
+        
+        CheckService cs = (CheckService) context.getService(ref);
+        Properties result = cs.getProps();
+        int fsGrade = ((Integer) result.get("fs")).intValue();
+        int fs2Grade = ((Integer) result.get("fs2")).intValue();
+        int[] fssGrades = (int[]) result.get("fss");
+        
+        assertEquals("fs grade -1", 2, fsGrade);
+        assertEquals("fs2 grade -1", 2, fs2Grade);
+        assertEquals("fss grade size -1", 2, fssGrades.length);
+        assertEquals("fss grade[0] -1", 2, fssGrades[0]);
+        assertEquals("fss grade[1] -1", 1, fssGrades[1]);
+        
+        ComponentInstance grade3 = createGrade(3);
+        result = cs.getProps();
+        fsGrade = ((Integer) result.get("fs")).intValue();
+        fs2Grade = ((Integer) result.get("fs2")).intValue();
+        fssGrades = (int[]) result.get("fss");
+        
+        assertEquals("fs grade -2", 2, fsGrade);
+        assertEquals("fs2 grade -2", 2, fs2Grade);
+        assertEquals("fss grade size -2", 3, fssGrades.length);
+        assertEquals("fss grade[0] -2", 2, fssGrades[0]);
+        assertEquals("fss grade[1] -2", 1, fssGrades[1]);
+        assertEquals("fss grade[2] -2", 3, fssGrades[2]);
+
+        grade2.stop();
+        
+        result = cs.getProps();
+        fsGrade = ((Integer) result.get("fs")).intValue();
+        fs2Grade = ((Integer) result.get("fs2")).intValue();
+        fssGrades = (int[]) result.get("fss");
+        
+        assertEquals("fs grade -3", 3, fsGrade);
+        assertEquals("fs2 grade -3", 3, fs2Grade);
+        assertEquals("fss grade size -3", 2, fssGrades.length);
+        assertEquals("fss grade[0] -3", 1, fssGrades[0]);
+        assertEquals("fss grade[1] -3", 3, fssGrades[1]);        
+        
+        context.ungetService(ref);
+        grade1.dispose();
+        grade2.dispose();
+        grade3.dispose();
+    }
+    
+    public void testDynamicPriority() {
+        ComponentInstance grade1 = createGrade(1);
+        ComponentInstance grade2 = createGrade(2);
+        
+        ServiceReference ref = getServiceReferenceByName(CheckService.class.getName(), dpInstance.getInstanceName());
+        assertNotNull("CS availability", ref);
+        
+        CheckService cs = (CheckService) context.getService(ref);
+        Properties result = cs.getProps();
+        int fsGrade = ((Integer) result.get("fs")).intValue();
+        int fs2Grade = ((Integer) result.get("fs2")).intValue();
+        int[] fssGrades = (int[]) result.get("fss");
+        
+        assertEquals("fs grade -1", 2, fsGrade);
+        assertEquals("fs2 grade -1", 2, fs2Grade);
+        assertEquals("fss grade size -1", 2, fssGrades.length);
+        assertEquals("fss grade[0] -1", 2, fssGrades[0]);
+        assertEquals("fss grade[1] -1", 1, fssGrades[1]);
+        
+        ComponentInstance grade3 = createGrade(3);
+        result = cs.getProps();
+        fsGrade = ((Integer) result.get("fs")).intValue();
+        fs2Grade = ((Integer) result.get("fs2")).intValue();
+        fssGrades = (int[]) result.get("fss");
+        
+        assertEquals("fs grade -2", 3, fsGrade);
+        assertEquals("fs2 grade -2", 3, fs2Grade);
+        assertEquals("fss grade size -2", 3, fssGrades.length);
+        assertEquals("fss grade[0] -2", 3, fssGrades[0]);
+        assertEquals("fss grade[1] -2", 2, fssGrades[1]);
+        assertEquals("fss grade[2] -2", 1, fssGrades[2]);
+
+        grade2.stop();
+        
+        result = cs.getProps();
+        fsGrade = ((Integer) result.get("fs")).intValue();
+        fs2Grade = ((Integer) result.get("fs2")).intValue();
+        fssGrades = (int[]) result.get("fss");
+        
+        assertEquals("fs grade -3", 3, fsGrade);
+        assertEquals("fs2 grade -3", 3, fs2Grade);
+        assertEquals("fss grade size -3", 2, fssGrades.length);
+        assertEquals("fss grade[0] -3", 3, fssGrades[0]);
+        assertEquals("fss grade[1] -3", 1, fssGrades[1]);        
+        
+        context.ungetService(ref);
+        grade1.dispose();
+        grade2.dispose();
+        grade3.dispose();
+    }
+    
+    private ComponentInstance createGrade(int grade) {
+        Properties props = new Properties();
+        props.put("grade", new Integer(grade));
+        return helper.createComponentInstance(gradeFactory, props);
+    }
+
+}
diff --git a/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/component/CheckServiceProvider.java b/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/component/CheckServiceProvider.java
new file mode 100644
index 0000000..0ce96ff
--- /dev/null
+++ b/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/component/CheckServiceProvider.java
@@ -0,0 +1,60 @@
+/* 

+ * Licensed to the Apache Software Foundation (ASF) under one

+ * or more contributor license agreements.  See the NOTICE file

+ * distributed with this work for additional information

+ * regarding copyright ownership.  The ASF licenses this file

+ * to you under the Apache License, Version 2.0 (the

+ * "License"); you may not use this file except in compliance

+ * with the License.  You may obtain a copy of the License at

+ *

+ *   http://www.apache.org/licenses/LICENSE-2.0

+ *

+ * Unless required by applicable law or agreed to in writing,

+ * software distributed under the License is distributed on an

+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

+ * KIND, either express or implied.  See the License for the

+ * specific language governing permissions and limitations

+ * under the License.

+ */

+package org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component;

+

+import java.util.Properties;

+

+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;

+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;

+

+public class CheckServiceProvider implements CheckService {

+    

+	FooService fs;

+	

+	FooService fs2;

+	

+	FooService[] fss;

+	

+

+	public boolean check() {    

+		return fs.foo();

+	}

+

+	public Properties getProps() {

+		Properties props = new Properties();

+		props.put("fs", new Integer(fs.getInt()));

+		props.put("fs2", new Integer(fs2.getInt()));

+		

+		int[] grades = new int[fss.length];

+		props.put("fss", grades);

+		

+		return props;

+	}

+	

+	void bind(FooService svc) {

+		fs2 = svc;

+	}

+	

+	void unbind(FooService svc) {

+        fs2 = null;

+    }

+	

+	

+

+}

diff --git a/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/component/GradeComparator.java b/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/component/GradeComparator.java
new file mode 100644
index 0000000..c3be86b
--- /dev/null
+++ b/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/component/GradeComparator.java
@@ -0,0 +1,31 @@
+package org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component;
+
+import java.util.Comparator;
+
+import org.osgi.framework.ServiceReference;
+
+public class GradeComparator implements Comparator {
+
+    public int compare(Object arg0, Object arg1) {
+        ServiceReference ref0 = null;
+        ServiceReference ref1 = null;
+        Integer grade0 = null;
+        Integer grade1 = null;
+        if (arg0 instanceof ServiceReference) {
+            ref0 = (ServiceReference)  arg0;
+            grade0 = (Integer) ref0.getProperty("grade");
+        }
+        if (arg1 instanceof ServiceReference) {
+            ref1 = (ServiceReference) arg1;
+            grade1 = (Integer) ref1.getProperty("grade");
+        }
+        
+        if (ref0 != null && ref1 != null
+                && grade0 != null && grade1 != null) {
+            return grade1.compareTo(grade0); // Best grade first.
+        } else {
+            return 0; // Equals
+        }
+    }
+
+}
diff --git a/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/component/GradedFooServiceProvider.java b/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/component/GradedFooServiceProvider.java
new file mode 100644
index 0000000..baca0ea
--- /dev/null
+++ b/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/component/GradedFooServiceProvider.java
@@ -0,0 +1,40 @@
+package org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
+
+public class GradedFooServiceProvider implements FooService {
+    
+    
+    private int grade;
+
+    public boolean foo() {
+        return grade > 0;
+    }
+
+    public Properties fooProps() {
+        return null;
+    }
+
+    public boolean getBoolean() {
+        return false;
+    }
+
+    public double getDouble() {
+        return 0;
+    }
+
+    public int getInt() {
+        return grade;
+    }
+
+    public long getLong() {
+        return 0;
+    }
+
+    public Boolean getObject() {
+        return null;
+    }
+
+}
diff --git a/ipojo/tests/core/service-dependency-comparator/src/main/resources/metadata.xml b/ipojo/tests/core/service-dependency-comparator/src/main/resources/metadata.xml
new file mode 100644
index 0000000..f505f8f
--- /dev/null
+++ b/ipojo/tests/core/service-dependency-comparator/src/main/resources/metadata.xml
@@ -0,0 +1,36 @@
+<ipojo 

+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

+    xsi:schemaLocation="org.apache.felix.ipojo http://people.apache.org/~clement/ipojo/schemas/core.xsd"

+    xmlns="org.apache.felix.ipojo"

+>

+	<component classname="org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component.GradedFooServiceProvider"

+		name="COMPARATOR-gradedFooProvider">

+		<provides>

+			<property field="grade"/>

+		</provides>

+	</component>

+	

+	

+	<component classname="org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component.CheckServiceProvider"

+		name="COMPARATOR-DynamicCheckService">

+		<provides/>

+		<requires field="fs" comparator="org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component.GradeComparator"/>

+		<requires field="fss" comparator="org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component.GradeComparator"/>

+		<requires comparator="org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component.GradeComparator">

+			<callback type="bind" method="bind"/>

+			<callback type="unbind" method="unbind"/>

+		</requires>

+	</component>

+	

+	<component classname="org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component.CheckServiceProvider"

+		name="COMPARATOR-DynamicPriorityCheckService">

+		<provides/>

+		<requires policy="dynamic-priority" field="fs" comparator="org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component.GradeComparator"/>

+		<requires policy="dynamic-priority" field="fss" comparator="org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component.GradeComparator"/>

+		<requires policy="dynamic-priority" comparator="org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component.GradeComparator">

+			<callback type="bind" method="bind"/>

+			<callback type="unbind" method="unbind"/>

+		</requires>

+	</component>

+	

+</ipojo>

diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicProps.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicProps.java
index e4631f9..3929cc6 100644
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicProps.java
+++ b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicProps.java
@@ -31,6 +31,7 @@
 	ComponentInstance fooProvider1;

 	ComponentInstance fooProvider2;

 	ComponentInstance fooProvider3;

+	ComponentInstance fooProvider4;

 

 	public void setUp() {

 		String type = "PS-FooProviderType-Dyn";

@@ -58,6 +59,10 @@
 		p3.put("intAProp", new int[0]);

 		fooProvider3 = Utils.getComponentInstance(context, type2, p3);

 		

+        Properties p4 = new Properties();

+        p4.put("instance.name","FooProvider-4");

+        fooProvider4 = Utils.getComponentInstance(context, type2, p4);

+		

 	}

 	

 	public void tearDown() {

@@ -67,6 +72,8 @@
 		fooProvider2 = null;

 		fooProvider3.dispose();

 		fooProvider3 = null;

+		fooProvider4.dispose();

+		fooProvider4 = null;

 	}

 	

 	public void testProperties1() {

@@ -228,4 +235,52 @@
 

 	}

 

+    public void testProperties4() {

+    	ServiceReference sr = Utils.getServiceReferenceByName(context, FooService.class.getName(), "FooProvider-4");

+    	assertNotNull("Check the availability of the FS service", sr);

+    	

+    	// Check service properties

+    	Integer intProp = (Integer) sr.getProperty("int");

+    	Object boolProp = sr.getProperty("boolean");

+    	Object strProp = sr.getProperty("string");

+    	Object strAProp = sr.getProperty("strAProp");

+    	int[] intAProp = (int[]) sr.getProperty("intAProp");

+    	

+    	assertEquals("Check intProp equality", intProp, new Integer(4)); // Set by the component type.

+    	assertEquals("Check boolProp equality", boolProp, null);

+    	assertEquals("Check strProp equality", strProp, null);

+    	assertNull("Check strAProp  nullity", strAProp);

+    	assertNotNull("Check intAProp not nullity", intAProp); // Set by the component type.

+    	assertNotNull("Check intAProp not nullity", intAProp);

+        int[] v2 = new int[] {1, 2, 3};

+        for (int i = 0; i < intAProp.length; i++) {

+            if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }

+        }

+    	

+    	// Invoke

+    	FooService fs = (FooService) context.getService(sr);

+    	assertTrue("invoke fs", fs.foo());

+    	

+    	// Re-check the property (change)

+    	intProp = (Integer) sr.getProperty("int");

+    	boolProp = (Boolean) sr.getProperty("boolean");

+    	strProp = (String) sr.getProperty("string");

+    	strAProp = (String[]) sr.getProperty("strAProp");

+    	intAProp = (int[]) sr.getProperty("intAProp");

+    	

+    	assertEquals("Check intProp equality", intProp, new Integer(2));

+    	assertEquals("Check longProp equality", boolProp, new Boolean(true));

+    	assertEquals("Check strProp equality", strProp, new String("foo"));

+    	assertNotNull("Check strAProp not nullity", strAProp);

+    	String[] v = new String[] {"foo", "bar"};

+    	for (int i = 0; i < ((String[]) strAProp).length; i++) {

+    		if(! ((String[]) strAProp)[i].equals(v[i])) { fail("Check the strAProp Equality"); }

+    	}

+    	assertNull("Check intAProp hidding (no value)", intAProp);

+    	

+    	fs = null;

+    	context.ungetService(sr);	

+    

+    }

+

 }

diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicPropsReconfiguration.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicPropsReconfiguration.java
index 6ed2ace..c162147 100644
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicPropsReconfiguration.java
+++ b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicPropsReconfiguration.java
@@ -30,7 +30,7 @@
 import org.osgi.service.cm.ManagedServiceFactory;

 

 public class DynamicPropsReconfiguration extends OSGiTestCase {

-	ComponentInstance fooProvider3;

+	ComponentInstance fooProvider3, fooProvider4;

 	

 	public void setUp() {		

 		String type2 = "PS-FooProviderType-Dyn2";

@@ -42,11 +42,17 @@
 		p3.put("strAProp", new String[0]);

 		p3.put("intAProp", new int[0]);

 		fooProvider3 = Utils.getComponentInstance(context, type2, p3);

+		

+		Properties p4 = new Properties();

+        p4.put("instance.name","FooProvider-4");

+        fooProvider4 = Utils.getComponentInstance(context, type2, p4);

 	}

 	

 	public void tearDown() {

 		fooProvider3.dispose();

 		fooProvider3 = null;

+	    fooProvider4.dispose();

+	    fooProvider4 = null;

 	}

 	

 	public void testFactoryReconf() {

@@ -572,6 +578,134 @@
     	fs = null;

     	context.ungetService(sr);	

     }

-	

+

+    public void testFactoryReconfNoValue() {

+    	ServiceReference sr = Utils.getServiceReferenceByName(context, FooService.class.getName(), "FooProvider-4");

+    	assertNotNull("Check the availability of the FS service", sr);

+    	

+    	// Check service properties

+    	Integer intProp = (Integer) sr.getProperty("int");

+    	Object boolProp = sr.getProperty("boolean");

+    	Object strProp = sr.getProperty("string");

+    	Object strAProp = sr.getProperty("strAProp");

+    	int[] intAProp = (int[]) sr.getProperty("intAProp");

+    	

+    	assertEquals("Check intProp equality", intProp, new Integer(4));

+    	assertEquals("Check longProp equality", boolProp, null);

+    	assertEquals("Check strProp equality", strProp, null);

+    	assertNull("Check strAProp nullity", strAProp);

+    	

+    	assertNotNull("Check intAProp not nullity", intAProp);

+        int[] v2 = new int[] {1, 2, 3};

+        for (int i = 0; i < intAProp.length; i++) {

+            if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }

+        }

+    	

+    	// Reconfiguration

+    	ServiceReference fact_ref = Utils.getServiceReferenceByName(context, Factory.class.getName() , "PS-FooProviderType-Dyn2");

+    	Factory fact = (Factory) context.getService(fact_ref);

+    	Properties p3 = new Properties();

+    	p3.put("instance.name","FooProvider-4");

+    	p3.put("int", new Integer(1));

+    	p3.put("boolean", new Boolean(true));

+    	p3.put("string", new String("foo"));

+    	p3.put("strAProp", new String[] {"foo", "bar", "baz"});

+    	p3.put("intAProp", new int[] { 1, 2, 3});

+    	try {

+    		fact.reconfigure(p3);

+    	} catch(Exception e) {

+    		fail("Unable to reconfigure the instance with : " + p3);

+    	}

+    	

+    	sr = Utils.getServiceReferenceByName(context, FooService.class.getName(), "FooProvider-4");

+    	assertNotNull("Check the availability of the FS service", sr);

+    	

+    	// Check service properties

+    	intProp = (Integer) sr.getProperty("int");

+    	boolProp = (Boolean) sr.getProperty("boolean");

+    	strProp = (String) sr.getProperty("string");

+    	strAProp = (String[]) sr.getProperty("strAProp");

+    	intAProp = (int[]) sr.getProperty("intAProp");

+    	

+    	assertEquals("Check intProp equality", intProp, new Integer(1));

+    	assertEquals("Check longProp equality", boolProp, new Boolean(true));

+    	assertEquals("Check strProp equality", strProp, new String("foo"));

+    	assertNotNull("Check strAProp not nullity", strAProp);

+    	String[] v = new String[] {"foo", "bar", "baz"};

+    	for (int i = 0; i < ((String[]) strAProp).length; i++) {

+    		if(! ((String[])strAProp)[i].equals(v[i])) { fail("Check the strAProp Equality"); }

+    	}

+    	assertNotNull("Check intAProp not nullity", intAProp);

+    	v2 = new int[] { 1, 2, 3};

+    	for (int i = 0; i < intAProp.length; i++) {

+    		if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }

+    	}	

+    	

+    	// Invoke

+    	FooService fs = (FooService) context.getService(sr);

+    	assertTrue("invoke fs", fs.foo());

+    	

+    	// Re-check the property (change)

+    	intProp = (Integer) sr.getProperty("int");

+    	boolProp = (Boolean) sr.getProperty("boolean");

+    	strProp = (String) sr.getProperty("string");

+    	strAProp = (String[]) sr.getProperty("strAProp");

+    	intAProp = (int[]) sr.getProperty("intAProp");

+    	

+    	assertEquals("Check intProp equality", intProp, new Integer(2));

+    	assertEquals("Check longProp equality", boolProp, new Boolean(true));

+    	assertEquals("Check strProp equality", strProp, new String("foo"));

+    	assertNotNull("Check strAProp not nullity", strAProp);

+    	v = new String[] {"foo", "bar"};

+    	for (int i = 0; i < ((String[]) strAProp).length; i++) {

+    		if(!((String[]) strAProp)[i].equals(v[i])) { fail("Check the strAProp Equality"); }

+    	}

+    	assertNull("Check intAProp hidding (no value)", intAProp);

+    	

+    	//	Reconfiguration

+    	fact_ref = Utils.getServiceReferenceByName(context, Factory.class.getName() , "PS-FooProviderType-Dyn2");

+    	fact = (Factory) context.getService(fact_ref);

+    	p3 = new Properties();

+    	p3.put("instance.name","FooProvider-3");

+    	p3.put("int", new Integer(1));

+    	p3.put("boolean", new Boolean(true));

+    	p3.put("string", new String("foo"));

+    	p3.put("strAProp", new String[] {"foo", "bar", "baz"});

+    	p3.put("intAProp", new int[] { 1, 2, 3});

+    	try {

+    		fact.reconfigure(p3);

+    	} catch(Exception e) {

+    		fail("Unable to reconfigure the instance with : " + p3);

+    	}

+    	

+    	sr = Utils.getServiceReferenceByName(context, FooService.class.getName(), "FooProvider-3");

+    	assertNotNull("Check the availability of the FS service", sr);

+    	

+    	// Check service properties

+    	intProp = (Integer) sr.getProperty("int");

+    	boolProp = (Boolean) sr.getProperty("boolean");

+    	strProp = (String) sr.getProperty("string");

+    	strAProp = (String[]) sr.getProperty("strAProp");

+    	intAProp = (int[]) sr.getProperty("intAProp");

+    	

+    	assertEquals("Check intProp equality", intProp, new Integer(1));

+    	assertEquals("Check longProp equality", boolProp, new Boolean(true));

+    	assertEquals("Check strProp equality", strProp, new String("foo"));

+    	assertNotNull("Check strAProp not nullity", strAProp);

+    	v = new String[] {"foo", "bar", "baz"};

+    	for (int i = 0; i < ((String[])strAProp).length; i++) {

+    		if(!((String[]) strAProp)[i].equals(v[i])) { fail("Check the strAProp Equality"); }

+    	}

+    	assertNotNull("Check intAProp not nullity", intAProp);

+    	v2 = new int[] { 1, 2, 3};

+    	for (int i = 0; i < intAProp.length; i++) {

+    		if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }

+    	}	

+    	

+    	fact = null;

+    	context.ungetService(fact_ref);

+    	fs = null;

+    	context.ungetService(sr);	

+    }

 

 }

diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceArchitectureTest.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceArchitectureTest.java
index f7316fa..e9ed400 100644
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceArchitectureTest.java
+++ b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceArchitectureTest.java
@@ -195,5 +195,58 @@
 		

 		ci.dispose();

 	}

+

+    public void testPropsNoValue() {

+    	String factName = "PS-FooProviderType-3";

+    	String compName = "FooProvider";

+    	

+    	// Get the factory to create a component instance

+    	Factory fact = Utils.getFactoryByName(context, factName);

+    	assertNotNull("Cannot find the factory FooProvider", fact);

+    	

+    	Properties props = new Properties();

+    	props.put("instance.name",compName);

+    	ComponentInstance ci = null;

+    	try {

+    		ci = fact.createComponentInstance(props);

+    	} catch (Exception e) { fail(e.getMessage()); }

+    

+    	ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), compName);

+    	assertNotNull("Architecture not available", arch_ref);

+    

+    	Architecture arch = (Architecture) context.getService(arch_ref);

+    	InstanceDescription id = arch.getInstanceDescription();

+    	

+    	assertEquals("Check component instance name (" + id.getName() + ")", id.getName(), compName);

+    	assertEquals("Check component type implementation class", id.getComponentDescription().getClassName(), "org.apache.felix.ipojo.test.scenarios.component.FooProviderType1");

+    	

+    	HandlerDescription[] handlers = id.getHandlers();

+    	assertEquals("Number of handlers", handlers.length, 3);

+    	

+    	//Look for the ProvidedService Handler

+    	ProvidedServiceHandlerDescription pshd = null;

+    	for(int i = 0; i < handlers.length; i++) {

+    		if(handlers[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {

+    			pshd = (ProvidedServiceHandlerDescription) handlers[i];

+    		}

+    	}

+    	

+    	assertNotNull("Check ProvidedServiceHandlerDescription", pshd);

+    	ProvidedServiceDescription[] ps = pshd.getProvidedServices();

+    	

+    	assertEquals("Check ProvidedService number", ps.length, 1);

+    	assertEquals("Check Provided Service Specs - 1", ps[0].getServiceSpecification().length, 1);

+    	assertEquals("Check Provided Service Specs - 2", ps[0].getServiceSpecification()[0], FooService.class.getName());

+    	assertEquals("Check Provided Service availability", ps[0].getState(), ProvidedServiceDescription.REGISTERED);

+    

+    	Properties prop = ps[0].getProperties();

+    	assertNotNull("Check Props", prop);

+    	assertEquals("Check service properties number (#" + prop + "?=5)" , prop.size(), 2);

+    	assertEquals("Check instance.name property", prop.getProperty("instance.name"), compName);

+    	assertEquals("Check factory.name property", prop.getProperty("factory.name"), factName);

+

+    	

+    	ci.dispose();

+    }

 	

 }