You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cl...@apache.org on 2007/09/25 17:07:18 UTC

svn commit: r579291 [12/12] - in /felix/sandbox/clement/Tests/Suite: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/felix/ src/main/java/org/apache/felix/ipojo/ src/main/java/org/apache/felix/ipoj...

Added: felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/DynamicPropsReconfiguration.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/DynamicPropsReconfiguration.java?rev=579291&view=auto
==============================================================================
--- felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/DynamicPropsReconfiguration.java (added)
+++ felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/DynamicPropsReconfiguration.java Tue Sep 25 08:06:53 2007
@@ -0,0 +1,302 @@
+package org.apache.felix.ipojo.test.scenarios.service.providing;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedServiceFactory;
+
+import fr.imag.adele.escoffier.utf.framework.TestCase;
+
+public class DynamicPropsReconfiguration extends TestCase {
+	ComponentInstance fooProvider3;
+	
+	public DynamicPropsReconfiguration(BundleContext bc) { super(bc); }
+	
+	public void setUp() {		
+		String type2 = "FooProviderType-Dyn2";
+		Properties p3 = new Properties();
+		p3.put("name", "FooProvider-3");
+		p3.put("int", new Integer(0));
+		p3.put("boolean", new Boolean(true));
+		p3.put("string", new String(""));
+		p3.put("strAProp", new String[0]);
+		p3.put("intAProp", new int[0]);
+		fooProvider3 = Utils.getComponentInstance(context, type2, p3);
+		
+	}
+	
+	public void tearDown() {
+		fooProvider3.dispose();
+		fooProvider3 = null;
+	}
+	
+	public void testFactoryReconf() {
+		ServiceReference sr = Utils.getServiceReferenceByName(context, FooService.class.getName(), "FooProvider-3");
+		assertNotNull("Check the availability of the FS service", sr);
+		
+		// Check service properties
+		Integer intProp = (Integer) sr.getProperty("int");
+		Boolean boolProp = (Boolean) sr.getProperty("boolean");
+		String strProp = (String) sr.getProperty("string");
+		String[] strAProp = (String[]) sr.getProperty("strAProp");
+		int[] intAProp = (int[]) sr.getProperty("intAProp");
+		
+		assertEquals("Check intProp equality", intProp, new Integer(0));
+		assertEquals("Check longProp equality", boolProp, new Boolean(true));
+		assertEquals("Check strProp equality", strProp, new String(""));
+		assertNotNull("Check strAProp not nullity", strAProp);
+		String[] v = new String[0];
+		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[0];
+		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() , "FooProviderType-Dyn2");
+		Factory fact = (Factory) context.getService(fact_ref);
+		Properties p3 = new Properties();
+		p3.put("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 < strAProp.length; i++) {
+			if(!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 < strAProp.length; i++) {
+			if(!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() , "FooProviderType-Dyn2");
+		fact = (Factory) context.getService(fact_ref);
+		p3 = new Properties();
+		p3.put("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 < strAProp.length; i++) {
+			if(!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);	
+	}
+	
+	public void testMSFReconf() {
+		ServiceReference sr = Utils.getServiceReferenceByName(context, FooService.class.getName(), "FooProvider-3");
+		assertNotNull("Check the availability of the FS service", sr);
+		
+		// Check service properties
+		Integer intProp = (Integer) sr.getProperty("int");
+		Boolean boolProp = (Boolean) sr.getProperty("boolean");
+		String strProp = (String) sr.getProperty("string");
+		String[] strAProp = (String[]) sr.getProperty("strAProp");
+		int[] intAProp = (int[]) sr.getProperty("intAProp");
+		
+		assertEquals("Check intProp equality", intProp, new Integer(0));
+		assertEquals("Check longProp equality", boolProp, new Boolean(true));
+		assertEquals("Check strProp equality", strProp, new String(""));
+		assertNotNull("Check strAProp not nullity", strAProp);
+		String[] v = new String[0];
+		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[0];
+		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, ManagedServiceFactory.class.getName() , "FooProviderType-Dyn2");
+		ManagedServiceFactory fact = (ManagedServiceFactory) context.getService(fact_ref);
+		Properties p3 = new Properties();
+		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.updated("FooProvider-3", p3);
+		} catch (ConfigurationException 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 < strAProp.length; i++) {
+			if(!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 < strAProp.length; i++) {
+			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
+		}
+		assertNull("Check intAProp hidding (no value)", intAProp);
+		
+		//	Reconfiguration
+		fact_ref = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName() , "FooProviderType-Dyn2");
+		fact = (ManagedServiceFactory) context.getService(fact_ref);
+		p3 = new Properties();
+		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.updated("FooProvider-3", p3);
+		} catch (ConfigurationException 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 < strAProp.length; i++) {
+			if(!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);	
+	}
+	
+
+}

Added: felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/Exposition.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/Exposition.java?rev=579291&view=auto
==============================================================================
--- felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/Exposition.java (added)
+++ felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/Exposition.java Tue Sep 25 08:06:53 2007
@@ -0,0 +1,184 @@
+package org.apache.felix.ipojo.test.scenarios.service.providing;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.test.scenarios.service.BarService;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+import fr.imag.adele.escoffier.utf.framework.TestCase;
+
+public class Exposition extends TestCase {
+	
+	private ComponentInstance fooProviderSimple;
+	private ComponentInstance fooProviderItf;
+	private ComponentInstance fooBarProvider;
+	private ComponentInstance fooBarProvider2;
+	private ComponentInstance fooBarProvider3;
+	
+	
+	public Exposition(BundleContext arg0) {
+		super(arg0);
+	}
+	
+	public void setUp(){ 
+		Properties p1 = new Properties();
+		p1.put("name", "fooProviderSimple");
+		fooProviderSimple = Utils.getComponentInstance(context, "FooProviderType-1", p1);
+		
+		Properties p2 = new Properties();
+		p2.put("name", "fooProviderItf");
+		fooProviderItf = Utils.getComponentInstance(context, "FooProviderType-itf", p2);
+		
+		Properties p3 = new Properties();
+		p3.put("name", "fooProviderItfs");
+		fooBarProvider = Utils.getComponentInstance(context, "FooBarProviderType-1", p3);
+		
+		Properties p4 = new Properties();
+		p4.put("name", "fooProviderItfs2");
+		fooBarProvider2 = Utils.getComponentInstance(context, "FooBarProviderType-2", p4);
+		
+		Properties p5 = new Properties();
+		p5.put("name", "fooProviderItfs3");
+		fooBarProvider3 = Utils.getComponentInstance(context, "FooBarProviderType-3", p5);
+		
+		
+		
+		assertNotNull("Check the instance creation of fooProviderSimple", fooProviderSimple);
+		assertNotNull("Check the instance creation of fooProviderItf", fooProviderItf);
+		assertNotNull("Check the instance creation of fooProviderItfs", fooBarProvider);
+		assertNotNull("Check the instance creation of fooProviderItfs2", fooBarProvider2);
+		assertNotNull("Check the instance creation of fooProviderItfs3", fooBarProvider3);
+		
+	}
+	
+	public void tearDown() {
+		fooProviderSimple.dispose();
+		fooProviderItf.dispose();
+		fooBarProvider.dispose();
+		fooBarProvider2.dispose();
+		fooBarProvider3.dispose();
+		fooProviderSimple = null;
+		fooProviderItf = null;
+		fooBarProvider = null;
+		fooBarProvider2 = null;
+		fooBarProvider3 = null;		
+	}
+	
+	public void testSimpleExposition() {
+		ServiceReference ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), fooProviderSimple.getInstanceName());
+		assertNotNull("Check the availability of the FS from "+fooProviderSimple.getInstanceName(), ref);
+		FooService fs = (FooService) context.getService(ref);
+		assertTrue("Check fs invocation", fs.foo());
+		fs = null;
+		context.ungetService(ref);
+		fooProviderSimple.stop();
+		ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), fooProviderSimple.getInstanceName());
+		assertNull("Check the absence of the FS from "+fooProviderSimple.getInstanceName(), ref);
+		
+	}
+	
+	public void testItfExposition() {
+		ServiceReference ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), fooProviderItf.getInstanceName());
+		assertNotNull("Check the availability of the FS from "+fooProviderItf.getInstanceName(), ref);
+		FooService fs = (FooService) context.getService(ref);
+		assertTrue("Check fs invocation", fs.foo());
+		fs = null;
+		context.ungetService(ref);
+		fooProviderItf.stop();
+		
+		ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), fooProviderItf.getInstanceName());
+		assertNull("Check the absence of the FS from "+fooProviderItf.getInstanceName(), ref);
+	}
+	
+	public void testItfsExposition() {
+		ServiceReference refFoo = Utils.getServiceReferenceByName(context, FooService.class.getName(), fooBarProvider.getInstanceName());
+		assertNotNull("Check the availability of the FS from "+fooBarProvider.getInstanceName(), refFoo);
+		ServiceReference refBar = Utils.getServiceReferenceByName(context, BarService.class.getName(), fooBarProvider.getInstanceName());
+		assertNotNull("Check the availability of the BS from "+fooBarProvider.getInstanceName(), refBar);
+		
+		assertSame("Check service reference equality", refFoo, refBar);
+		
+		FooService fs = (FooService) context.getService(refFoo);
+		assertTrue("Check fs invocation", fs.foo());
+		fs = null;
+		context.ungetService(refFoo);
+		
+		BarService bs = (BarService) context.getService(refBar);
+		assertTrue("Check bs invocation", bs.bar());
+		bs = null;
+		context.ungetService(refBar);
+		
+		fooBarProvider.stop();
+		
+		refFoo = Utils.getServiceReferenceByName(context, FooService.class.getName(), fooBarProvider.getInstanceName());
+		refBar = Utils.getServiceReferenceByName(context, BarService.class.getName(), fooBarProvider.getInstanceName());
+		assertNull("Check the absence of the FS from "+fooBarProvider.getInstanceName(), refFoo);
+		assertNull("Check the absence of the BS from "+fooBarProvider.getInstanceName(), refBar);
+	}
+	
+	public void testItfsExposition2() {
+		ServiceReference refFoo = Utils.getServiceReferenceByName(context, FooService.class.getName(), fooBarProvider2.getInstanceName());
+		assertNotNull("Check the availability of the FS from "+fooBarProvider2.getInstanceName(), refFoo);
+		ServiceReference refBar = Utils.getServiceReferenceByName(context, BarService.class.getName(), fooBarProvider2.getInstanceName());
+		assertNotNull("Check the availability of the BS from "+fooBarProvider2.getInstanceName(), refBar);
+		
+		assertSame("Check service reference equality", refFoo, refBar);
+		
+		FooService fs = (FooService) context.getService(refFoo);
+		assertTrue("Check fs invocation", fs.foo());
+		fs = null;
+		context.ungetService(refFoo);
+		
+		BarService bs = (BarService) context.getService(refBar);
+		assertTrue("Check bs invocation", bs.bar());
+		bs = null;
+		context.ungetService(refBar);
+		
+		fooBarProvider2.stop();
+		
+		refFoo = Utils.getServiceReferenceByName(context, FooService.class.getName(), fooBarProvider2.getInstanceName());
+		refBar = Utils.getServiceReferenceByName(context, BarService.class.getName(), fooBarProvider2.getInstanceName());
+		assertNull("Check the absence of the FS from "+fooBarProvider.getInstanceName(), refFoo);
+		assertNull("Check the absence of the BS from "+fooBarProvider.getInstanceName(), refBar);
+	}
+	
+	public void testItfsExposition3() {
+		ServiceReference refFoo = Utils.getServiceReferenceByName(context, FooService.class.getName(), fooBarProvider3.getInstanceName());
+		assertNotNull("Check the availability of the FS from "+fooBarProvider3.getInstanceName(), refFoo);
+		ServiceReference refBar = Utils.getServiceReferenceByName(context, BarService.class.getName(), fooBarProvider3.getInstanceName());
+		assertNotNull("Check the availability of the BS from "+fooBarProvider3.getInstanceName(), refBar);
+		
+		assertNotSame("Check service reference inequality", refFoo, refBar);
+		
+		FooService fs = (FooService) context.getService(refFoo);
+		assertTrue("Check fs invocation", fs.foo());
+		fs = null;
+		context.ungetService(refFoo);
+		
+		BarService bs = (BarService) context.getService(refBar);
+		assertTrue("Check bs invocation", bs.bar());
+		bs = null;
+		context.ungetService(refBar);
+		
+		// Check properties
+		String baz1 = (String) refFoo.getProperty("baz");
+		String baz2 = (String) refBar.getProperty("baz");
+		
+		assertEquals("Check Baz Property 1", baz1, "foo");
+		assertEquals("Check Baz Property 2", baz2, "bar");
+		
+		fooBarProvider3.stop();
+		
+		refFoo = Utils.getServiceReferenceByName(context, FooService.class.getName(), fooBarProvider3.getInstanceName());
+		refBar = Utils.getServiceReferenceByName(context, BarService.class.getName(), fooBarProvider3.getInstanceName());
+		assertNull("Check the absence of the FS from "+fooBarProvider.getInstanceName(), refFoo);
+		assertNull("Check the absence of the BS from "+fooBarProvider.getInstanceName(), refBar);
+	}
+	
+	
+
+}

Added: felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/FactoryProps.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/FactoryProps.java?rev=579291&view=auto
==============================================================================
--- felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/FactoryProps.java (added)
+++ felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/FactoryProps.java Tue Sep 25 08:06:53 2007
@@ -0,0 +1,79 @@
+package org.apache.felix.ipojo.test.scenarios.service.providing;
+
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.architecture.PropertyDescription;
+import org.apache.felix.ipojo.test.scenarios.component.FooProviderType1;
+import org.apache.felix.ipojo.test.scenarios.service.BarService;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+import fr.imag.adele.escoffier.utf.framework.TestCase;
+
+public class FactoryProps extends TestCase {
+	
+	
+	public FactoryProps(BundleContext bc) { super(bc); }
+	
+	public void setUp(){ }
+	
+	public void tearDown() { }
+	
+	public void testImplementationClass() {
+		ServiceReference ref1 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooProviderType-1");
+		assertNotNull("The factory is available", ref1);
+		String clazz = (String) ref1.getProperty("component.class");
+		assertEquals("Check the implementation class", clazz, FooProviderType1.class.getName());
+	}
+	
+	public void testSimpleExposition() {
+		ServiceReference ref1 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooProviderType-1");
+		assertNotNull("The factory is available", ref1);
+		String[] spec = (String[]) ref1.getProperty("component.providedServiceSpecifications");
+		assertEquals("Check array length", spec.length, 1);
+		assertEquals("Check spec", spec[0], FooService.class.getName());
+	}
+	
+	public void testDoubleExposition() {
+		ServiceReference ref1 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooBarProviderType-1");
+		assertNotNull("The factory is available", ref1);
+		String[] spec = (String[]) ref1.getProperty("component.providedServiceSpecifications");
+		assertEquals("Check array length", spec.length, 2);
+		assertEquals("Check spec 1", spec[0], FooService.class.getName());
+		assertEquals("Check spec 2", spec[1], BarService.class.getName());
+	}
+	
+	public void testProps() {
+		ServiceReference ref1 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooProviderType-Dyn2");
+		assertNotNull("The factory is available", ref1);
+		PropertyDescription[] pd = (PropertyDescription[]) ref1.getProperty("component.properties");
+		assertEquals("Check property list size", pd.length, 5);
+		
+		//P0
+		assertEquals("0) Check name", "int", pd[0].getName());
+		assertEquals("0) Check type", "int", pd[0].getType());
+		assertEquals("0) Check value", "4", pd[0].getValue());
+		
+		//P1
+		assertEquals("1) Check name", "boolean", pd[1].getName());
+		assertEquals("1) Check type", "boolean", pd[1].getType());
+		assertNull("1) Check value", pd[1].getValue());
+		
+		//P2
+		assertEquals("2) Check name", "string", pd[2].getName());
+		assertEquals("2) Check type",  String.class.getName(), pd[2].getType());
+		assertNull("2) Check value", pd[2].getValue());
+		
+		//P3
+		assertEquals("3) Check name", "strAProp", pd[3].getName());
+		assertEquals("3) Check type", "java.lang.String[]", pd[3].getType());
+		assertNull("3) Check value", pd[3].getValue());
+		
+		//P4
+		assertEquals("4) Check name", "intAProp", pd[4].getName());
+		assertEquals("4) Check type", "int[]", pd[4].getType());
+	}
+	
+
+}

Added: felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/ProvidedServiceTestSuite.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/ProvidedServiceTestSuite.java?rev=579291&view=auto
==============================================================================
--- felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/ProvidedServiceTestSuite.java (added)
+++ felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/ProvidedServiceTestSuite.java Tue Sep 25 08:06:53 2007
@@ -0,0 +1,28 @@
+package org.apache.felix.ipojo.test.scenarios.service.providing;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.osgi.framework.BundleContext;
+
+import fr.imag.adele.escoffier.utf.framework.TestSuite;
+
+public class ProvidedServiceTestSuite extends TestSuite {
+
+	public ProvidedServiceTestSuite(BundleContext arg0) {
+		super(arg0);
+	}
+
+	public List suite() {
+		List suite = new ArrayList();
+		suite.add(new Exposition(context));
+		suite.add(new SimplePS(context));
+		suite.add(new StaticProps(context));
+		suite.add(new DynamicProps(context));
+		suite.add(new FactoryProps(context));
+		suite.add(new StaticPropsReconfiguration(context));
+		suite.add(new DynamicPropsReconfiguration(context));
+		return suite;
+	}
+
+}

Added: felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/SimplePS.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/SimplePS.java?rev=579291&view=auto
==============================================================================
--- felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/SimplePS.java (added)
+++ felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/SimplePS.java Tue Sep 25 08:06:53 2007
@@ -0,0 +1,66 @@
+package org.apache.felix.ipojo.test.scenarios.service.providing;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+
+import fr.imag.adele.escoffier.utf.framework.TestCase;
+
+public class SimplePS extends TestCase {
+	
+	public SimplePS(BundleContext bc) { super(bc); }
+
+	public void testPS() {
+		String factName = "FooProviderType-1";
+		String compName = "FooProvider-1";
+		ServiceReference[] refs = null;
+		
+		// Check that no Foo Service are available
+		try {
+			refs = context.getServiceReferences(FooService.class.getName(), null);
+		} catch (InvalidSyntaxException e) { fail("Service query failed : " + e); }
+		
+		assertNull("FS already available", refs);
+	
+		// Get the factory to create a component instance
+		Factory fact = Utils.getFactoryByName(context, factName);
+		assertNotNull("Cannot find the factory FooProvider-1", fact);
+		
+		Properties props = new Properties();
+		props.put("name", compName);
+		ComponentInstance ci = null;
+		try {
+			ci = fact.createComponentInstance(props);
+		} catch (Exception e1) { fail(e1.getMessage()); }		
+		
+		// Get a FooService provider
+		try {
+			refs = context.getServiceReferences(FooService.class.getName(), "(" + "instance.name" + "=" + compName + ")");
+		} catch (InvalidSyntaxException e) { fail("Service query failed (2) " + e); }
+		
+		assertNotNull("FS not available", refs);
+		
+		// Test foo invocation
+		FooService fs = (FooService) context.getService(refs[0]);
+		assertTrue("FooService invocation failed", fs.foo());
+		
+		// Unget the service
+		context.ungetService(refs[0]);
+		
+		ci.dispose();
+		
+		// Check that there is no more FooService
+		try {
+			refs = context.getServiceReferences(FooService.class.getName(), null);
+		} catch (InvalidSyntaxException e) { fail("Service query failed (3) : " + e.getMessage()); }
+		
+		assertNull("FS available, but component instance stopped", refs);
+	}
+
+}

Added: felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/StaticProps.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/StaticProps.java?rev=579291&view=auto
==============================================================================
--- felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/StaticProps.java (added)
+++ felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/StaticProps.java Tue Sep 25 08:06:53 2007
@@ -0,0 +1,98 @@
+package org.apache.felix.ipojo.test.scenarios.service.providing;
+
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+import fr.imag.adele.escoffier.utf.framework.TestCase;
+
+public class StaticProps extends TestCase {
+	
+	ComponentInstance fooProvider1;
+	ComponentInstance fooProvider2;
+	
+	public StaticProps(BundleContext bc) { super(bc); }
+	
+	public void setUp() {
+		String type = "FooProviderType-2";
+		
+		Properties p1 = new Properties();
+		p1.put("name", "FooProvider-1");
+		fooProvider1 = Utils.getComponentInstance(context, type, p1);
+		
+		Properties p2 = new Properties();
+		p2.put("name", "FooProvider-2");
+		p2.put("int", new Integer(4));
+		p2.put("long", new Long(42));
+		p2.put("string", new String("bar"));
+		p2.put("strAProp", new String[] {"bar", "foo"});
+		p2.put("intAProp", new int[] {1, 2, 3});
+		fooProvider2 = Utils.getComponentInstance(context, type, p2);
+		
+	}
+	
+	public void tearDown() {
+		fooProvider1.dispose();
+		fooProvider1 = null;
+		fooProvider2.dispose();
+		fooProvider2 = null;
+	}
+	
+	public void testProperties1() {
+		ServiceReference sr = Utils.getServiceReferenceByName(context, FooService.class.getName(), "FooProvider-1");
+		assertNotNull("Check the availability of the FS service", sr);
+		
+		// Check service properties
+		Integer intProp = (Integer) sr.getProperty("int");
+		Long longProp = (Long) sr.getProperty("long");
+		String strProp = (String) sr.getProperty("string");
+		String[] strAProp = (String[]) sr.getProperty("strAProp");
+		int[] intAProp = (int[]) sr.getProperty("intAProp");
+		
+		assertEquals("Check intProp equality", intProp, new Integer(2));
+		assertEquals("Check longProp equality", longProp, new Long(40));
+		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 < strAProp.length; i++) {
+			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
+		}
+		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"); }
+		}
+		       
+	}
+	
+	public void testProperties2() {
+		ServiceReference sr = Utils.getServiceReferenceByName(context, FooService.class.getName(), "FooProvider-2");
+		assertNotNull("Check the availability of the FS service", sr);
+		
+		// Check service properties
+		Integer intProp = (Integer) sr.getProperty("int");
+		Long longProp = (Long) sr.getProperty("long");
+		String strProp = (String) sr.getProperty("string");
+		String[] strAProp = (String[]) sr.getProperty("strAProp");
+		int[] intAProp = (int[]) sr.getProperty("intAProp");
+		
+		assertEquals("Check intProp equality", intProp, new Integer(4));
+		assertEquals("Check longProp equality", longProp, new Long(42));
+		assertEquals("Check strProp equality", strProp, new String("bar"));
+
+		assertNotNull("Check strAProp not nullity", strAProp);
+		String[] v = new String[] {"bar", "foo"};
+		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[] {1, 2, 3};
+		for (int i = 0; i < intAProp.length; i++) {
+			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
+		}
+	}
+}

Added: felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/StaticPropsReconfiguration.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/StaticPropsReconfiguration.java?rev=579291&view=auto
==============================================================================
--- felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/StaticPropsReconfiguration.java (added)
+++ felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/service/providing/StaticPropsReconfiguration.java Tue Sep 25 08:06:53 2007
@@ -0,0 +1,325 @@
+package org.apache.felix.ipojo.test.scenarios.service.providing;
+
+import java.util.Dictionary;
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.test.scenarios.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedServiceFactory;
+
+import fr.imag.adele.escoffier.utf.framework.TestCase;
+
+public class StaticPropsReconfiguration extends TestCase {
+
+	ComponentInstance fooProvider1;
+	ComponentInstance fooProvider2;
+	
+	public StaticPropsReconfiguration(BundleContext arg0) {
+		super(arg0);
+	}
+	
+	public void setUp() {
+		String type = "FooProviderType-2";
+		
+		Properties p1 = new Properties();
+		p1.put("name", "FooProvider-1");
+		fooProvider1 = Utils.getComponentInstance(context, type, p1);
+		
+		Properties p2 = new Properties();
+		p2.put("name", "FooProvider-2");
+		p2.put("int", new Integer(4));
+		p2.put("long", new Long(42));
+		p2.put("string", new String("bar"));
+		p2.put("strAProp", new String[] {"bar", "foo"});
+		p2.put("intAProp", new int[] {1, 2, 3});
+		fooProvider2 = Utils.getComponentInstance(context, type, p2);
+		
+	}
+	
+	public void tearDown() {
+		fooProvider1.dispose();
+		fooProvider1 = null;
+		fooProvider2.dispose();
+		fooProvider2 = null;
+	}
+	
+	public void testReconfFactory1() {
+		ServiceReference sr = Utils.getServiceReferenceByName(context, FooService.class.getName(), "FooProvider-1");
+		assertNotNull("Check the availability of the FS service", sr);
+		
+		// Check service properties
+		Integer intProp = (Integer) sr.getProperty("int");
+		Long longProp = (Long) sr.getProperty("long");
+		String strProp = (String) sr.getProperty("string");
+		String[] strAProp = (String[]) sr.getProperty("strAProp");
+		int[] intAProp = (int[]) sr.getProperty("intAProp");
+		
+		assertEquals("Check intProp equality", intProp, new Integer(2));
+		assertEquals("Check longProp equality", longProp, new Long(40));
+		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 < strAProp.length; i++) {
+			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
+		}
+		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(), "FooProviderType-2");
+		Dictionary reconf = new Properties();
+		reconf.put("name", "FooProvider-1");
+		reconf.put("int", new Integer(5));
+		reconf.put("long", new Long(43));
+		reconf.put("string", new String("toto"));
+		reconf.put("strAProp", new String[] {"foo", "baz"});
+		reconf.put("intAProp", new int[] {3, 2, 1});
+		Factory fact = (Factory) context.getService(fact_ref);
+		try {
+			fact.reconfigure(reconf);
+		} catch(Exception e) {
+			fail("Configuration non acceptable : " + reconf);
+		}
+
+		sr = Utils.getServiceReferenceByName(context, FooService.class.getName(), "FooProvider-1");
+		assertNotNull("Check the availability of the FS service", sr);
+		
+		// Check service properties after the reconfiguration
+		intProp = (Integer) sr.getProperty("int");
+		longProp = (Long) sr.getProperty("long");
+		strProp = (String) sr.getProperty("string");
+		strAProp = (String[]) sr.getProperty("strAProp");
+		intAProp = (int[]) sr.getProperty("intAProp");
+		
+		assertEquals("Check intProp equality after reconfiguration", intProp, new Integer(5));
+		assertEquals("Check longProp equality after reconfiguration", longProp, new Long(43));
+		assertEquals("Check strProp equality after reconfiguration", strProp, new String("toto"));
+		assertNotNull("Check strAProp not nullity after reconfiguration", strAProp);
+		v = new String[] {"foo", "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);
+		v2 = new int[] {3, 2, 1};
+		for (int i = 0; i < intAProp.length; i++) {
+			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
+		}
+		
+		context.ungetService(fact_ref);
+		fact = null;
+		       
+	}
+	
+	public void testReconfFactory2() {
+		ServiceReference sr = Utils.getServiceReferenceByName(context, FooService.class.getName(), "FooProvider-2");
+		assertNotNull("Check the availability of the FS service", sr);
+		
+		// Check service properties
+		Integer intProp = (Integer) sr.getProperty("int");
+		Long longProp = (Long) sr.getProperty("long");
+		String strProp = (String) sr.getProperty("string");
+		String[] strAProp = (String[]) sr.getProperty("strAProp");
+		int[] intAProp = (int[]) sr.getProperty("intAProp");
+		
+		assertEquals("Check intProp equality", intProp, new Integer(4));
+		assertEquals("Check longProp equality", longProp, new Long(42));
+		assertEquals("Check strProp equality", strProp, new String("bar"));
+
+		assertNotNull("Check strAProp not nullity", strAProp);
+		String[] v = new String[] {"bar", "foo"};
+		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[] {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(), "FooProviderType-2");
+		Dictionary reconf = new Properties();
+		reconf.put("name", "FooProvider-2");
+		reconf.put("int", new Integer(5));
+		reconf.put("long", new Long(43));
+		reconf.put("string", new String("toto"));
+		reconf.put("strAProp", new String[] {"foo", "baz"});
+		reconf.put("intAProp", new int[] {3, 2, 1});
+		Factory fact = (Factory) context.getService(fact_ref);
+		try {
+			fact.reconfigure(reconf);
+		} catch(Exception e) {
+			fail("Configuration non acceptable : " + reconf);
+		}
+		
+		// Check service properties after the reconfiguration
+		intProp = (Integer) sr.getProperty("int");
+		longProp = (Long) sr.getProperty("long");
+		strProp = (String) sr.getProperty("string");
+		strAProp = (String[]) sr.getProperty("strAProp");
+		intAProp = (int[]) sr.getProperty("intAProp");
+		
+		assertEquals("Check intProp equality after reconfiguration", intProp, new Integer(5));
+		assertEquals("Check longProp equality after reconfiguration", longProp, new Long(43));
+		assertEquals("Check strProp equality after reconfiguration", strProp, new String("toto"));
+		assertNotNull("Check strAProp not nullity after reconfiguration", strAProp);
+		v = new String[] {"foo", "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);
+		v2 = new int[] {3, 2, 1};
+		for (int i = 0; i < intAProp.length; i++) {
+			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
+		}
+		
+		context.ungetService(fact_ref);
+		fact = null;
+	}
+	
+	public void testMSFFactory1() {
+		ServiceReference sr = Utils.getServiceReferenceByName(context, FooService.class.getName(), "FooProvider-1");
+		assertNotNull("Check the availability of the FS service", sr);
+		
+		// Check service properties
+		Integer intProp = (Integer) sr.getProperty("int");
+		Long longProp = (Long) sr.getProperty("long");
+		String strProp = (String) sr.getProperty("string");
+		String[] strAProp = (String[]) sr.getProperty("strAProp");
+		int[] intAProp = (int[]) sr.getProperty("intAProp");
+		
+		assertEquals("Check intProp equality", intProp, new Integer(2));
+		assertEquals("Check longProp equality", longProp, new Long(40));
+		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 < strAProp.length; i++) {
+			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
+		}
+		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, ManagedServiceFactory.class.getName(), "FooProviderType-2");
+		Dictionary reconf = new Properties();
+		reconf.put("int", new Integer(5));
+		reconf.put("long", new Long(43));
+		reconf.put("string", new String("toto"));
+		reconf.put("strAProp", new String[] {"foo", "baz"});
+		reconf.put("intAProp", new int[] {3, 2, 1});
+		ManagedServiceFactory fact = (ManagedServiceFactory) context.getService(fact_ref);
+		try {
+			fact.updated("FooProvider-1", reconf);
+		} catch (ConfigurationException e) {
+			fail("Configuration non acceptable : " + reconf);
+		}
+
+		sr = Utils.getServiceReferenceByName(context, FooService.class.getName(), "FooProvider-1");
+		assertNotNull("Check the availability of the FS service", sr);
+		
+		// Check service properties after the reconfiguration
+		intProp = (Integer) sr.getProperty("int");
+		longProp = (Long) sr.getProperty("long");
+		strProp = (String) sr.getProperty("string");
+		strAProp = (String[]) sr.getProperty("strAProp");
+		intAProp = (int[]) sr.getProperty("intAProp");
+		
+		assertEquals("Check intProp equality after reconfiguration", intProp, new Integer(5));
+		assertEquals("Check longProp equality after reconfiguration", longProp, new Long(43));
+		assertEquals("Check strProp equality after reconfiguration", strProp, new String("toto"));
+		assertNotNull("Check strAProp not nullity after reconfiguration", strAProp);
+		v = new String[] {"foo", "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);
+		v2 = new int[] {3, 2, 1};
+		for (int i = 0; i < intAProp.length; i++) {
+			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
+		}
+		
+		context.ungetService(fact_ref);
+		fact = null;
+		       
+	}
+	
+	public void testReconfMSF2() {
+		ServiceReference sr = Utils.getServiceReferenceByName(context, FooService.class.getName(), "FooProvider-2");
+		assertNotNull("Check the availability of the FS service", sr);
+		
+		// Check service properties
+		Integer intProp = (Integer) sr.getProperty("int");
+		Long longProp = (Long) sr.getProperty("long");
+		String strProp = (String) sr.getProperty("string");
+		String[] strAProp = (String[]) sr.getProperty("strAProp");
+		int[] intAProp = (int[]) sr.getProperty("intAProp");
+		
+		assertEquals("Check intProp equality", intProp, new Integer(4));
+		assertEquals("Check longProp equality", longProp, new Long(42));
+		assertEquals("Check strProp equality", strProp, new String("bar"));
+
+		assertNotNull("Check strAProp not nullity", strAProp);
+		String[] v = new String[] {"bar", "foo"};
+		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[] {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, ManagedServiceFactory.class.getName(), "FooProviderType-2");
+		Dictionary reconf = new Properties();
+		reconf.put("int", new Integer(5));
+		reconf.put("long", new Long(43));
+		reconf.put("string", new String("toto"));
+		reconf.put("strAProp", new String[] {"foo", "baz"});
+		reconf.put("intAProp", new int[] {3, 2, 1});
+		ManagedServiceFactory fact = (ManagedServiceFactory) context.getService(fact_ref);
+		try {
+			fact.updated("FooProvider-2", reconf);
+		} catch (ConfigurationException e) {
+			fail("Configuration non acceptable : " + reconf);
+		}
+		
+		// Check service properties after the reconfiguration
+		intProp = (Integer) sr.getProperty("int");
+		longProp = (Long) sr.getProperty("long");
+		strProp = (String) sr.getProperty("string");
+		strAProp = (String[]) sr.getProperty("strAProp");
+		intAProp = (int[]) sr.getProperty("intAProp");
+		
+		assertEquals("Check intProp equality after reconfiguration", intProp, new Integer(5));
+		assertEquals("Check longProp equality after reconfiguration", longProp, new Long(43));
+		assertEquals("Check strProp equality after reconfiguration", strProp, new String("toto"));
+		assertNotNull("Check strAProp not nullity after reconfiguration", strAProp);
+		v = new String[] {"foo", "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);
+		v2 = new int[] {3, 2, 1};
+		for (int i = 0; i < intAProp.length; i++) {
+			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
+		}
+		
+		context.ungetService(fact_ref);
+		fact = null;
+	}
+	
+	
+
+}

Added: felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java?rev=579291&view=auto
==============================================================================
--- felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java (added)
+++ felix/sandbox/clement/Tests/Suite/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java Tue Sep 25 08:06:53 2007
@@ -0,0 +1,199 @@
+package org.apache.felix.ipojo.test.scenarios.util;
+
+import java.util.Dictionary;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.CompositeManager;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.ServiceContext;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.ManagedServiceFactory;
+
+public class Utils {
+	
+	public static Factory getFactoryByName(BundleContext bc, String factoryName){
+		ServiceReference[] refs;
+		try {
+			refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name="+factoryName+")");
+			if(refs == null) {
+			    System.err.println("Cannot get the factory " + factoryName);
+			    return null; 
+			}
+			return ((Factory) bc.getService(refs[0]));
+		} catch (InvalidSyntaxException e) {
+			System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
+			return null;
+		}
+	}
+	
+	public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
+		Factory fact = getFactoryByName(bc, factoryName);
+		
+		if (fact == null) {
+		    System.err.println("Factory " + factoryName + " not found");
+		    return null;
+		}
+		
+		//if(fact.isAcceptable(configuration)) {
+			try {
+				return fact.createComponentInstance(configuration);
+			} catch(Exception e) {
+				System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
+				e.printStackTrace();
+				return null;
+			}
+		//} 
+		//else {
+		//	System.err.println("Configuration not accepted by : " + factoryName);
+		//	return null;
+		//}
+	}
+	
+	public static ServiceReference[] getServiceReferences(BundleContext bc, String itf, String filter) {
+		ServiceReference[] refs = null;
+		try {
+			refs = bc.getServiceReferences(itf, filter);
+		} catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
+		if(refs == null) { return new ServiceReference[0]; }
+		else { return refs; }
+	}
+	
+	public static ServiceReference getServiceReference(BundleContext bc, String itf, String filter) {
+		ServiceReference[] refs = null;
+		try {
+			refs = bc.getServiceReferences(itf, filter);
+		} catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
+		if(refs == null) { return null; }
+		else { return refs[0]; }
+	}
+	
+	public static ServiceReference getServiceReferenceByName(BundleContext bc, String itf, String name) {
+		ServiceReference[] refs = null;
+		String filter = null;
+		if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
+		    filter = "("+"factory.name"+"="+name+")";
+		} else {
+		    filter = "("+"instance.name"+"="+name+")";   
+		}
+		try {
+			refs = bc.getServiceReferences(itf, filter);
+		} catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
+		if(refs == null) { return null; }
+		else { return refs[0]; }
+	}	
+	
+	public static Object getServiceObject(BundleContext bc, String itf, String filter) {
+		ServiceReference ref = getServiceReference(bc, itf, filter);
+		if(ref != null) { return bc.getService(ref); }
+		else { return null; }
+	}
+	
+	public static Object[] getServiceObjects(BundleContext bc, String itf, String filter) {
+		ServiceReference[] refs = getServiceReferences(bc, itf, filter);
+		if(refs != null) { 
+			Object[] list = new Object[refs.length];
+			for(int i = 0; i < refs.length; i++) {
+				list[i] = bc.getService(refs[i]);
+			}
+			return list;
+		}
+		else { return new Object[0]; }
+	}
+	
+	public static ServiceContext getServiceContext(ComponentInstance ci) {
+		if(ci instanceof CompositeManager) {
+			return ((CompositeManager) ci).getServiceContext();
+		} else {
+			throw new RuntimeException("Cannot get the service context form an non composite instance");
+		}
+	}
+	
+	public static Factory getFactoryByName(ServiceContext bc, String factoryName){
+		ServiceReference[] refs;
+		try {
+			refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name="+factoryName+")");
+			if(refs == null) { return null; }
+			return ((Factory) bc.getService(refs[0]));
+		} catch (InvalidSyntaxException e) {
+			System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
+			return null;
+		}
+	}
+	
+	public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
+		Factory fact = getFactoryByName(bc, factoryName);
+		
+		if (fact == null) { return null; }
+		
+		if(fact.isAcceptable(configuration)) {
+			try {
+				return fact.createComponentInstance(configuration);
+			} catch(Exception e) {
+				System.err.println(e.getMessage());
+				e.printStackTrace();
+				return null;
+			}
+		} 
+		else {
+			System.err.println("Configuration not accepted by : " + factoryName);
+			return null;
+		}
+	}
+	
+	public static ServiceReference[] getServiceReferences(ServiceContext bc, String itf, String filter) {
+		ServiceReference[] refs = null;
+		try {
+			refs = bc.getServiceReferences(itf, filter);
+		} catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
+		if(refs == null) { return new ServiceReference[0]; }
+		else { return refs; }
+	}
+	
+	public static ServiceReference getServiceReference(ServiceContext bc, String itf, String filter) {
+		ServiceReference[] refs = null;
+		try {
+			refs = bc.getServiceReferences(itf, filter);
+		} catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
+		if(refs == null) { return null; }
+		else { return refs[0]; }
+	}
+	
+	public static ServiceReference getServiceReferenceByName(ServiceContext bc, String itf, String name) {
+		ServiceReference[] refs = null;
+        String filter = null;
+        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
+            filter = "(" + "factory.name" + "=" + name + ")";
+        } else {
+            filter = "(" + "instance.name" + "=" + name + ")";
+        }
+		try {
+			refs = bc.getServiceReferences(itf, filter);
+		} catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
+		if(refs == null) { return null; }
+		else { return refs[0]; }
+	}
+	
+	public static Object getServiceObject(ServiceContext bc, String itf, String filter) {
+		ServiceReference ref = getServiceReference(bc, itf, filter);
+		if(ref != null) { return bc.getService(ref); }
+		else { return null; }
+	}
+	
+	public static Object[] getServiceObjects(ServiceContext bc, String itf, String filter) {
+		ServiceReference[] refs = getServiceReferences(bc, itf, filter);
+		if(refs != null) { 
+			Object[] list = new Object[refs.length];
+			for(int i = 0; i < refs.length; i++) {
+				list[i] = bc.getService(refs[i]);
+			}
+			return list;
+		}
+		else { return new Object[0]; }
+	}
+	
+	
+	
+
+}

Added: felix/sandbox/clement/Tests/Suite/src/main/resources/metadata.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/Tests/Suite/src/main/resources/metadata.xml?rev=579291&view=auto
==============================================================================
--- felix/sandbox/clement/Tests/Suite/src/main/resources/metadata.xml (added)
+++ felix/sandbox/clement/Tests/Suite/src/main/resources/metadata.xml Tue Sep 25 08:06:53 2007
@@ -0,0 +1,634 @@
+<ipojo xmlns:cs="org.apache.felix.ipojo.test.handler.CheckServiceHandler">
+	<component className="org.apache.felix.ipojo.test.iPOJOTestRunner" name="runner" factory="false" immediate="true" architecture="true">
+	</component>
+
+	<component classname="org.apache.felix.ipojo.test.log.LogImpl" factory="true" name="log">
+		<provides/>
+	</component>
+
+	<!-- Component Types used inside tests -->
+	<!--  Service Providing -->
+	<component className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1" factory="FooProviderType-1" architecture="true">
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1" name="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="strAProp" type="java.lang.String[]" value="{foo, bar}"/>
+			<property name="intAProp" type="int[]" value="{1,2,3}"/>
+		</provides>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn" name="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="strAProp" field="strAProp" value="{foo, bar}"/>
+			<property name="intAProp" field="intAProp" value="{ 1,2,3}"/>
+		</provides>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn2" name="FooProviderType-Dyn2" factory="true" 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>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn" factory="FooProviderType-Conf" architecture="true">
+		<provides/>
+		<properties propagation="false">
+			<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}"/>
+    	</properties>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1" factory="FooProviderType-3" 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>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1" factory="FooProviderType-itf" architecture="true">
+		<provides interface="org.apache.felix.ipojo.test.scenarios.service.FooService"/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1" factory="FooBarProviderType-1" architecture="true">
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1" factory="FooBarProviderType-2" architecture="true">
+		<provides interface="{org.apache.felix.ipojo.test.scenarios.service.FooService, org.apache.felix.ipojo.test.scenarios.service.BarService }"/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1" factory="FooBarProviderType-3" architecture="true">
+		<provides interface="{org.apache.felix.ipojo.test.scenarios.service.FooService}">
+			<property name="baz" type="java.lang.String" value="foo"/>
+		</provides>
+		<provides interface="{org.apache.felix.ipojo.test.scenarios.service.BarService}">
+			<property name="baz" type="java.lang.String" value="bar"/>
+		</provides>
+	</component>
+	
+	<!-- Immediate Component -->
+	<component className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1" factory="ImmediateFooProviderType" immediate="true" architecture="true">
+		<provides/>
+	</component>
+
+	<!--  Simple Dependencies -->
+	<component className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" factory="SimpleCheckServiceProvider" architecture="true">
+		<requires field="fs"/>
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" factory="VoidCheckServiceProvider" architecture="true">
+		<requires field="fs">
+			<callback type="bind" method="voidBind"/>
+			<callback type="unbind" method="voidUnbind"/>
+		</requires>
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" factory="ObjectCheckServiceProvider" architecture="true">
+		<requires field="fs">
+			<callback type="bind" method="objectBind"/>
+			<callback type="unbind" method="objectUnbind"/>
+		</requires>
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" factory="RefCheckServiceProvider" architecture="true">
+		<requires field="fs">
+			<callback type="bind" method="refBind"/>
+			<callback type="unbind" method="refUnbind"/>
+		</requires>
+     	<provides/>
+	</component>
+	
+	<component className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider" factory="MObjectCheckServiceProvider" architecture="true">
+		<requires>
+			<callback type="bind" method="objectBind"/>
+			<callback type="unbind" method="objectUnbind"/>
+		</requires>
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider" factory="MRefCheckServiceProvider" architecture="true">
+		<requires interface="org.apache.felix.ipojo.test.scenarios.service.FooService">
+			<callback type="bind" method="refBind"/>
+			<callback type="unbind" method="refUnbind"/>
+		</requires>
+     	<provides/>
+	</component>
+
+	<!-- Simple & Optional Dependencies -->
+	<component className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" factory="SimpleOptionalCheckServiceProvider" architecture="true">
+		<requires field="fs" optional="true"/>
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" factory="VoidOptionalCheckServiceProvider" architecture="true">
+		<requires field="fs" optional="true">
+			<callback type="bind" method="voidBind"/>
+			<callback type="unbind" method="voidUnbind"/>
+		</requires>
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" factory="ObjectOptionalCheckServiceProvider" architecture="true">
+		<requires field="fs" optional="true">
+			<callback type="bind" method="objectBind"/>
+			<callback type="unbind" method="objectUnbind"/>
+		</requires>
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" factory="RefOptionalCheckServiceProvider" architecture="true">
+		<requires field="fs" optional="true">
+			<callback type="bind" method="refBind"/>
+			<callback type="unbind" method="refUnbind"/>
+		</requires>
+		<provides/>
+	</component>
+	
+	<component className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider" factory="MObjectOptionalCheckServiceProvider" architecture="true">
+		<requires optional="true">
+			<callback type="bind" method="objectBind"/>
+			<callback type="unbind" method="objectUnbind"/>
+		</requires>
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider" factory="MRefOptionalCheckServiceProvider" architecture="true">
+		<requires interface="org.apache.felix.ipojo.test.scenarios.service.FooService" optional="true">
+			<callback type="bind" method="refBind"/>
+			<callback type="unbind" method="refUnbind"/>
+		</requires>
+		<provides/>
+	</component>
+
+	<!--  Multiple Dependencies -->
+	<component className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService" factory="SimpleMultipleCheckServiceProvider" architecture="true">
+		<requires field="fs"/>
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService" factory="VoidMultipleCheckServiceProvider" architecture="true">
+		<requires field="fs">
+			<callback type="bind" method="voidBind"/>
+			<callback type="unbind" method="voidUnbind"/>
+		</requires>
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService" factory="ObjectMultipleCheckServiceProvider" architecture="true">
+		<requires field="fs">
+			<callback type="bind" method="objectBind"/>
+			<callback type="unbind" method="objectUnbind"/>
+		</requires>
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService" factory="RefMultipleCheckServiceProvider" architecture="true">
+		<requires field="fs">
+			<callback type="bind" method="refBind"/>
+			<callback type="unbind" method="refUnbind"/>
+		</requires>
+		<provides/>
+	</component>
+		<component className="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService" factory="MObjectMultipleCheckServiceProvider" architecture="true">
+		<requires aggregate="true">
+			<callback type="bind" method="objectBind"/>
+			<callback type="unbind" method="objectUnbind"/>
+		</requires>
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService" factory="MRefMultipleCheckServiceProvider" architecture="true">
+		<requires interface="org.apache.felix.ipojo.test.scenarios.service.FooService" aggregate="true">
+			<callback type="bind" method="refBind"/>
+			<callback type="unbind" method="refUnbind"/>
+		</requires>
+		<provides/>
+	</component>
+		
+	
+	<!-- Multiple & Optional Dependencies -->
+    <component className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService" factory="SimpleOptionalMultipleCheckServiceProvider" architecture="true">
+		<requires field="fs" optional="true"/>
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService" factory="VoidOptionalMultipleCheckServiceProvider" architecture="true">
+		<requires field="fs" optional="true">
+			<callback type="bind" method="voidBind"/>
+			<callback type="unbind" method="voidUnbind"/>
+		</requires>
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService" factory="ObjectOptionalMultipleCheckServiceProvider" architecture="true">
+		<requires field="fs" optional="true">
+			<callback type="bind" method="objectBind"/>
+			<callback type="unbind" method="objectUnbind"/>
+		</requires>
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService" factory="RefOptionalMultipleCheckServiceProvider" architecture="true">
+		<requires field="fs" optional="true">
+			<callback type="bind" method="refBind"/>
+			<callback type="unbind" method="refUnbind"/>
+		</requires>
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService" factory="MObjectOptionalMultipleCheckServiceProvider" architecture="true">
+		<requires aggregate="true" optional="true">
+			<callback type="bind" method="objectBind"/>
+			<callback type="unbind" method="objectUnbind"/>
+		</requires>
+		<provides/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService" factory="MRefOptionalMultipleCheckServiceProvider" architecture="true">
+		<requires interface="org.apache.felix.ipojo.test.scenarios.service.FooService" aggregate="true" optional="true">
+			<callback type="bind" method="refBind"/>
+			<callback type="unbind" method="refUnbind"/>
+		</requires>
+		<provides/>
+	</component>	
+	
+	<!-- Lifecycle Callback -->
+	<component className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService" factory="CallbackCheckService" architecture="true">
+		<requires field="fs"/>
+		<provides/>
+		<callback transition="validate" method="start"/>
+		<callback transition="invalidate" method="stop"/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService" factory="ParentCallbackCheckService" architecture="true">
+		<requires field="fs"/>
+		<provides/>
+		<callback transition="validate" method="parentStart"/>
+		<callback transition="invalidate" method="parentStop"/>
+	</component>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService" immediate="true" factory="ImmediateCallbackCheckService" architecture="true">
+		<requires field="fs"/>
+		<provides/>
+		<callback transition="validate" method="start"/>
+		<callback transition="invalidate" method="stop"/>
+	</component>
+	
+	<!-- Manipulation -->
+	<component className="org.apache.felix.ipojo.test.scenarios.component.Manipulation23Tester" factory="PrimitiveManipulationTester" architecture="true">
+		<provides/>
+	</component>
+	
+	<component className="org.apache.felix.ipojo.test.scenarios.component.A123.Manipulation23Tester" factory="PrimitiveManipulationTesterA" architecture="true">
+		<provides/>
+	</component>
+	
+	<!-- Configuration Management Test -->
+	<component factory="FieldConfigurableCheckService" className="org.apache.felix.ipojo.test.scenarios.component.ConfigurableCheckServiceProvider" architecture="true">
+		<provides/>
+		<properties propagation="true">
+			<property field="b"/>
+			<property field="s"/>
+			<property field="i"/>
+			<property field="l"/>
+			<property field="d"/>
+			<property field="f"/>
+			<property field="c"/>
+			<property field="bool"/>
+			<property field="bs"/>
+			<property field="ss"/>
+			<property field="is"/>
+			<property field="ls"/>
+			<property field="ds"/>
+			<property field="fs"/>
+			<property field="cs"/>
+			<property field="bools"/>
+			<property field="string"/>
+			<property field="strings"/>
+		</properties> 
+	</component>
+	
+	<component factory="BothConfigurableCheckService" className="org.apache.felix.ipojo.test.scenarios.component.ConfigurableCheckServiceProvider" architecture="true">
+		<provides/>
+		<properties propagation="true">
+			<property field="b" method="updateB"/>
+			<property field="s" method="updateS"/>
+			<property field="i" method="updateI"/>
+			<property field="l" method="updateL"/>
+			<property field="d" method="updateD"/>
+			<property field="f" method="updateF"/>
+			<property field="c" method="updateC"/>
+			<property field="bool" method="updateBool"/>
+			<property field="bs" method="updateBs"/>
+			<property field="ss" method="updateSs"/>
+			<property field="is" method="updateIs"/>
+			<property field="ls" method="updateLs"/>
+			<property field="ds" method="updateDs"/>
+			<property field="fs" method="updateFs"/>
+			<property field="cs" method="updateCs"/>
+			<property field="bools" method="updateBools"/>
+			<property field="string" method="updateString"/>
+			<property field="strings" method="updateStrings"/>
+		</properties> 
+	</component>
+	
+	<component factory="MethodConfigurableCheckService" className="org.apache.felix.ipojo.test.scenarios.component.ConfigurableCheckServiceProvider" architecture="true">
+		<provides/>
+		<properties propagation="true">
+			<property method="updateB" name="b"/>
+			<property method="updateS" name="s"/>
+			<property method="updateI" name="i"/>
+			<property method="updateL" name="l"/>
+			<property method="updateD" name="d"/>
+			<property method="updateF" name="f"/>
+			<property method="updateC" name="c"/>
+			<property method="updateBool" name="bool"/>
+			<property method="updateBs" name="bs"/>
+			<property method="updateSs" name="ss"/>
+			<property method="updateIs" name="is"/>
+			<property method="updateLs" name="ls"/>
+			<property method="updateDs" name="ds"/>
+			<property method="updateFs" name="fs"/>
+			<property method="updateCs" name="cs"/>
+			<property method="updateBools" name="bools"/>
+			<property method="updateString" name="string"/>
+			<property method="updateStrings" name="strings"/>
+		</properties> 
+	</component>
+	
+	<component factory="ParentMethodConfigurableCheckService" className="org.apache.felix.ipojo.test.scenarios.component.ParentConfigurableCheckServiceProvider" architecture="true">
+		<provides/>
+		<properties propagation="true">
+			<property method="updateB" name="b"/>
+			<property method="updateS" name="s"/>
+			<property method="updateI" name="i"/>
+			<property method="updateL" name="l"/>
+			<property method="updateD" name="d"/>
+			<property method="updateF" name="f"/>
+			<property method="updateC" name="c"/>
+			<property method="updateBool" name="bool"/>
+			<property method="updateBs" name="bs"/>
+			<property method="updateSs" name="ss"/>
+			<property method="updateIs" name="is"/>
+			<property method="updateLs" name="ls"/>
+			<property method="updateDs" name="ds"/>
+			<property method="updateFs" name="fs"/>
+			<property method="updateCs" name="cs"/>
+			<property method="updateBools" name="bools"/>
+			<property method="updateString" name="string" type="string"/>
+			<property method="updateStrings" name="strings" type="java.lang.String[]"/>
+		</properties> 
+	</component>
+	
+	<!-- Handler test -->
+	<handler classname="org.apache.felix.ipojo.test.handler.CheckServiceHandler" name="check" namespace="org.apache.felix.ipojo.test.handler.CheckServiceHandler">
+		<controller field="isValid"/>
+	</handler>
+	<component className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1" factory="HandlerTester" architecture="true">
+	 <cs:check/>
+	</component>
+	<instance name="HandlerTest-2" component="HandlerTester">
+		<property name="csh.simple" value="Simple"/>
+		<property name="csh.map">
+			<property name="a" value="a"/>
+			<property name="b" value="b"/>
+			<property name="c" value="c"/>
+		</property>
+	</instance>
+	
+	<!--  Composite -->
+	<composite name="composite.empty" factory="true" architecture="true">
+	</composite>
+	
+	<composite name="composite.bar.1" architecture="true">
+		<service specification="org.apache.felix.ipojo.test.scenarios.service.BarService"/>
+	</composite>
+	
+	<composite name="bar.2" factory="composite.bar.2" architecture="true">
+		<service specification="org.apache.felix.ipojo.test.scenarios.service.BarService" aggregate="true"/>
+	</composite>
+	
+	<composite name="composite.bar.3" architecture="true">
+		<service specification="org.apache.felix.ipojo.test.scenarios.service.BarService" optional="true"/>
+	</composite>
+	
+	<composite name="composite.bar.4" architecture="true">
+		<service specification="org.apache.felix.ipojo.test.scenarios.service.FooService" aggregate="true" optional="true"/>
+	</composite>
+	
+	<composite name="composite.bar.5-accept" architecture="true">
+		<service specification="org.apache.felix.ipojo.test.scenarios.service.FooService">
+			<property name="boolean" value="true"/>
+			<property name="string" value="foo"/>
+			<property name="strAprop" value="{foo, bar, baz}"/>
+			<property name="int" value="5"/>
+		</service>
+	</composite>
+	
+	<composite name="composite.bar.5-refuse1" architecture="true">
+		<service specification="org.apache.felix.ipojo.test.scenarios.service.BarService">
+			<property name="foo" value="bar"/>
+			<property name="boolean" value="true"/>
+			<property name="string" value="foo"/>
+			<property name="strAprop" value="{foo, bar, baz}"/>
+			<property name="int" value="5"/>
+		</service>
+	</composite>
+	
+	<composite name="composite.bar.5-refuse2" architecture="true">
+		<service specification="org.apache.felix.ipojo.test.scenarios.service.BarService">
+			<property name="string" value="foo"/>
+			<property name="strAprop" value="{foo, bar, baz}"/>
+		</service>
+	</composite>
+	
+	<composite name="composite.inst.1" factory="true" architecture="true">
+		<instance component="FooProviderType-1" /> <!-- name="FooProv"  -->
+		<instance component="FooProviderType-Dyn2">
+			<property name="boolean" value="true"/>
+			<property name="string" value="foo"/>
+			<property name="strAProp" value="{a,b,c}"/>
+		</instance>
+	</composite>
+	
+	<composite name="composite.requires.1" architecture="true">
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.FooService" scope="composite"/>
+	</composite>
+	
+	<composite name="composite.requires.2" architecture="true">
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.FooService" aggregate="true" scope="composite"/>
+	</composite>
+	
+	<composite name="composite.requires.3" architecture="true">
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.FooService" optional="true" scope="composite"/>
+	</composite>
+	
+	<composite name="composite.requires.4" architecture="true">
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.FooService" optional="true" aggregate="true" scope="composite"/>
+	</composite>
+	
+	<composite name="composite.requires.5" architecture="true">
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.FooService" filter="(&amp;(int=2)(long=40))" scope="composite"/>
+	</composite>
+	
+	<component className="org.apache.felix.ipojo.test.scenarios.component.BazProviderType1" factory="BazProviderType" scope="composite">
+		<provides/>
+	</component>
+	
+	<composite name="composite.export.1" architecture="true">
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.BazService" aggregate="true" optional="true" filter="(!(instance.name=export))" scope="composite"/>
+		<exports specification="org.apache.felix.ipojo.test.scenarios.service.BazService"/>
+	</composite>
+	
+	<composite name="composite.export.2" architecture="true">
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.BazService" scope="composite" aggregate="true" optional="true" filter="(!(instance.name=export))"/>
+		<exports specification="org.apache.felix.ipojo.test.scenarios.service.BazService" optional="true"/>
+	</composite>
+	
+	<composite name="composite.export.3" architecture="true">
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.BazService" scope="composite" aggregate="true" optional="true" filter="(!(instance.name=export))"/>
+		<exports specification="org.apache.felix.ipojo.test.scenarios.service.BazService" aggregate="true"/>
+	</composite>
+	
+	<composite name="composite.export.4" architecture="true">
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.BazService" aggregate="true" optional="true" filter="(!(instance.name=export))" scope="composite"/>
+		<exports specification="org.apache.felix.ipojo.test.scenarios.service.BazService" aggregate="true" optional="true"/>
+	</composite>
+	
+	<composite name="composite.export.5" architecture="true">
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.BazService" aggregate="true" optional="true" filter="(!(instance.name=export))" scope="composite"/>
+		<exports specification="org.apache.felix.ipojo.test.scenarios.service.BazService" filter="(instance.name=foo1)"/>
+	</composite>
+	
+	<component className="org.apache.felix.ipojo.test.scenarios.component.Baz2CheckProvider" factory="Baz2CheckProvider" architecture="true">
+		<requires field="fs" scope="composite"/>
+		<provides/>
+	</component>
+
+	<composite name="composite.test.3" architecture="true">
+		<service specification="org.apache.felix.ipojo.test.scenarios.service.BazService" aggregate="true" filter="(factory.name=BazProviderType)"/>
+		<exports specification="org.apache.felix.ipojo.test.scenarios.service.BazService"/>
+	</composite>
+	
+	<composite name="composite.test.2" architecture="true">
+		<service specification="org.apache.felix.ipojo.test.scenarios.service.CheckService" filter="(factory.name=Baz2CheckProvider)"/>
+		<exports specification="org.apache.felix.ipojo.test.scenarios.service.CheckService"/>
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.BazService" scope="composite"/>
+	</composite>
+	
+	<composite name="composite.test.1" architecture="true">
+		<service specification="org.apache.felix.ipojo.test.scenarios.service.BazService" filter="(factory.name=composite.test.3)" />
+		<service specification="org.apache.felix.ipojo.test.scenarios.service.CheckService" filter="(factory.name=composite.test.2)"/>
+		<exports specification="org.apache.felix.ipojo.test.scenarios.service.CheckService"/>
+	</composite>
+
+	<composite name="composite.instantiator" architecture="true">
+				<service specification="org.apache.felix.ipojo.test.scenarios.service.BazService" filter="(factory.name=composite.test.3)"/>
+				<service specification="org.apache.felix.ipojo.test.scenarios.service.FooService"/>
+				<exports specification="org.apache.felix.ipojo.test.scenarios.service.BazService"/>
+				<exports specification="org.apache.felix.ipojo.test.scenarios.service.FooService"/>
+	</composite>
+
+	<!-- Test composition provides -->
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.TataProvider" factory="tata">
+		<provides/>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.TotoProvider" factory="toto" architecture="true">
+		<provides/>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.TotoProviderGlue" factory="totoglue">
+		<requires field="m_toto" scope="composite"/>
+	</component>
+	
+	<composite name="comp0" factory="comp-0" architecture="true">
+		<service specification="org.apache.felix.ipojo.test.scenarios.service.Tata"/>
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.Toto"/>
+		<provides specification="org.apache.felix.ipojo.test.scenarios.service.Tota"/>
+	</composite>
+	
+	<composite name="comp1" factory="comp-1" architecture="true">
+		<service specification="org.apache.felix.ipojo.test.scenarios.service.Tata"/>
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.Toto"/>
+		<provides specification="org.apache.felix.ipojo.test.scenarios.service.Tota">
+			<delegation method="tataInt" policy="One"/>
+			<delegation method="toto1" policy="All"/>
+		</provides>
+	</composite>
+
+	<composite name="comp2" factory="comp-2" architecture="true">
+		<service specification="org.apache.felix.ipojo.test.scenarios.service.Tata" aggregate="true"/>
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.Toto" aggregate="true"/>
+		<provides specification="org.apache.felix.ipojo.test.scenarios.service.Tota">
+			<delegation method="tataInt" policy="One"/>
+			<delegation method="toto1" policy="All"/>
+		</provides>
+	</composite>	
+	
+	<composite name="comp3" factory="comp-3" architecture="true">
+		<service specification="org.apache.felix.ipojo.test.scenarios.service.Tata"/>
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.Toto" optional="true"/>
+		<provides specification="org.apache.felix.ipojo.test.scenarios.service.Tota">
+		</provides>
+	</composite>
+	
+	<composite name="comp4" factory="comp-4" architecture="true">
+		<service specification="org.apache.felix.ipojo.test.scenarios.service.Tata"/>
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.Toto" optional="true"/>
+		<provides specification="org.apache.felix.ipojo.test.scenarios.service.Tota">
+			<delegation method="tataInt" policy="One"/>
+			<delegation method="toto1" policy="All"/>
+		</provides>
+	</composite>		
+	
+	<composite name="comp5" factory="comp-5" architecture="true">
+		<service specification="org.apache.felix.ipojo.test.scenarios.service.Tata" aggregate="true"/>
+		<!-- <requires specification="org.apache.felix.ipojo.test.scenarios.service.Toto" aggregate ="true" optional="true"/> -->
+		<provides specification="org.apache.felix.ipojo.test.scenarios.service.Tota">
+			<delegation method="tataInt" policy="One"/>
+			<delegation method="toto1" policy="All"/>
+		</provides>
+	</composite>	
+	
+	<composite name="compdouble" factory="comp-6" architecture="true">
+		<service specification="org.apache.felix.ipojo.test.scenarios.service.Tata" aggregate="true"/>
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.Toto" aggregate="true" optional="true"/>
+		<provides specification="org.apache.felix.ipojo.test.scenarios.service.Toto">
+			<delegation method="toto1" policy="All"/>
+		</provides>
+ 		<provides specification="org.apache.felix.ipojo.test.scenarios.service.Tata">
+			<delegation method="tataInt" policy="One"/>
+		</provides>
+	</composite>
+	
+	<composite name="compInstance1" factory="comp-7" architecture="true">
+		<instance component="tata"/>
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.Toto"/>
+		<provides specification="org.apache.felix.ipojo.test.scenarios.service.Tota"/>
+	</composite>
+	
+	<composite name="compInstance2" factory="comp-8" architecture="true">
+		<instance component="tata"/>
+		<instance component="totoglue"/>
+		<requires specification="org.apache.felix.ipojo.test.scenarios.service.Toto"/>
+		<provides specification="org.apache.felix.ipojo.test.scenarios.service.Tota"/>
+	</composite>
+	
+	<!-- Test lifecycle controller -->
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest" name="lcTest">
+		<provides/>
+		<controller field="m_state"/>
+		<properties>
+			<property name="conf" field="m_conf" method="setConf"/>
+		</properties>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest" name="lcTest2" immediate="true" architecture="true">
+		<provides/>
+		<controller field="m_state"/>
+		<properties>
+			<property name="conf" field="m_conf" method="setConf"/>
+		</properties>
+	</component>
+	
+	<!--  runner instance -->
+	<instance component="log" name="MyLogger"/>
+	
+	<instance component="runner"/>
+</ipojo>
\ No newline at end of file