Felix-3903 - Migrate service providing tests to pax exam 3

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1448797 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/pom.xml b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/pom.xml
new file mode 100644
index 0000000..52b7b49
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/pom.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <parent>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>org.apache.felix.ipojo.runtime.core-it</artifactId>
+        <version>1.9.0-SNAPSHOT</version>
+        <relativePath>../../../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.apache.felix</groupId>
+    <artifactId>ipojo-core-service-providing-test</artifactId>
+
+    <name>${project.artifactId}</name>
+    
+</project>
\ No newline at end of file
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckProviderParentClass.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckProviderParentClass.java
new file mode 100644
index 0000000..7d18712
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckProviderParentClass.java
@@ -0,0 +1,51 @@
+/* 

+ * 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.runtime.core.components;

+

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+import org.osgi.framework.ServiceReference;

+

+public abstract class CheckProviderParentClass {

+    

+    int simpleU = 0;

+    int objectU = 0;

+    int refU = 0;

+    int bothU = 0;

+    

+    

+    public void bothUnbind(FooService o, ServiceReference sr) {

+        if(sr != null && o != null && o instanceof FooService) { bothU++; }

+    }

+    

+    public void refUnbind(ServiceReference sr) {

+        if(sr != null) { refU++; }

+    }

+    

+    public void objectUnbind(FooService o) {

+        if(o != null && o instanceof FooService) { objectU++; }

+        else {

+            System.err.println("Unbind null : " + o);

+        }

+    }

+    

+    public void voidUnbind() {

+        simpleU++;

+    }

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckServiceProvider.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckServiceProvider.java
new file mode 100644
index 0000000..eee88a2
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/CheckServiceProvider.java
@@ -0,0 +1,83 @@
+/* 

+ * 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.runtime.core.components;

+

+import org.apache.felix.ipojo.runtime.core.services.CheckService;

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+import org.osgi.framework.ServiceReference;

+

+import java.util.Properties;

+

+public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {

+    

+	FooService fs;

+	

+	int simpleB = 0;

+	int objectB = 0;

+	int refB = 0;

+	int bothB = 0;

+

+	public boolean check() {

+		return fs.foo();

+	}

+

+	public Properties getProps() {

+		Properties props = new Properties();

+		props.put("voidB", new Integer(simpleB));

+		props.put("objectB", new Integer(objectB));

+		props.put("refB", new Integer(refB));

+		props.put("bothB", new Integer(bothB));

+		props.put("voidU", new Integer(simpleU));

+		props.put("objectU", new Integer(objectU));

+		props.put("refU", new Integer(refU));

+		props.put("bothU", new Integer(bothU));

+		if (fs != null) {

+		    props.put("result", new Boolean(fs.foo()));

+		    props.put("boolean", new Boolean(fs.getBoolean()));

+		    props.put("int", new Integer(fs.getInt()));

+		    props.put("long", new Long(fs.getLong()));

+		    props.put("double", new Double(fs.getDouble()));

+		    if(fs.getObject() != null) { props.put("object", fs.getObject()); }

+		}

+        props.put("static", CheckService.foo);

+        props.put("class", CheckService.class.getName());

+		return props;

+	}

+	

+	private void voidBind() {

+		simpleB++;

+	}

+	

+	protected void objectBind(FooService o) {

+	    if (o == null) {

+	        System.err.println("Bind receive null !!! ");

+	        return;

+	    }

+		if(o != null && o instanceof FooService) { objectB++; }

+	}

+	

+	public void refBind(ServiceReference sr) {

+		if(sr != null) { refB++; }

+	}

+	

+    public void bothBind(FooService o, ServiceReference sr) {

+	    if(sr != null && o != null && o instanceof FooService) { bothB++; }

+	}

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooBarProviderType1.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooBarProviderType1.java
new file mode 100644
index 0000000..03016d3
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooBarProviderType1.java
@@ -0,0 +1,54 @@
+/* 

+ * 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.runtime.core.components;

+

+import org.apache.felix.ipojo.runtime.core.services.BarService;

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+

+import java.util.Properties;

+

+public class FooBarProviderType1 implements FooService, BarService {

+

+	public boolean foo() {

+		return true;

+	}

+

+	public Properties fooProps() {

+		return new Properties();

+	}

+

+	public boolean bar() {

+		return true;

+	}

+

+	public Properties getProps() {

+		return new Properties();

+	}

+

+	public boolean getBoolean() { return true; }

+

+	public double getDouble() { return 1.0; }

+

+	public int getInt() { return 1; }

+

+	public long getLong() { return 1; }

+

+	public Boolean getObject() { return new Boolean(true); }

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderType1.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderType1.java
new file mode 100644
index 0000000..4d6add7
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderType1.java
@@ -0,0 +1,117 @@
+/* 

+ * 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.runtime.core.components;

+

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+import org.osgi.framework.BundleContext;

+

+import java.util.Properties;

+

+public class FooProviderType1 implements FooService {

+	

+	private int m_bar;

+	private String m_foo;

+    

+    private BundleContext m_context;

+    

+    private static FooProviderType1 singleton;

+    private static int count = 0;

+    

+    private static FooProviderType1 singleton(BundleContext bc) {

+        if (singleton == null) {

+            count++;

+            singleton = new FooProviderType1(bc);

+        }

+        return singleton;

+    }

+    

+    public static FooProviderType1 several(BundleContext bc) {

+        count++;

+        return new FooProviderType1(bc);

+    }

+        

+    public FooProviderType1(BundleContext bc) {

+        if (bc ==null) {

+            throw new RuntimeException("Injected bundle context null");

+        }

+        m_context = bc;

+    }

+

+	public boolean foo() {

+		return true;

+	}

+

+	public Properties fooProps() {

+		Properties p = new Properties();

+		p.put("bar", new Integer(m_bar));

+        if(m_foo != null) {

+            p.put("foo", m_foo);

+        }

+        p.put("context", m_context);

+        

+        p.put("count", new Integer(count));

+		return p;

+	}

+    

+	public void testException() throws Exception {

+        String a = "foobarbaz";

+	    throw new Exception("foo"+a);

+    }

+    

+    public void testTry() {

+            String a = "foo";

+            a.charAt(0);

+    }

+    

+    public void testTry2(String s) {

+            String a = "foo";

+            a.charAt(0);

+    }

+    

+    private void nexttry(String  s) {

+        try {

+            s += "foo";

+        } catch(RuntimeException e) {

+            

+        }

+    }

+    

+	public boolean getBoolean() { return true; }

+

+	public double getDouble() { return 1.0; }

+

+	public int getInt() { return 1; }

+

+	public long getLong() { return 1; }

+

+	public Boolean getObject() { return new Boolean(true); }

+	

+	/**

+	 * Custom constructor.

+	 * @param bar

+	 * @param foo

+	 * @param bc

+	 */

+	public FooProviderType1(int bar, String foo, BundleContext bc) {

+	    m_bar = bar;

+	    m_foo = foo;

+	    m_context = bc;

+	}

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn.java
new file mode 100644
index 0000000..9428190
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn.java
@@ -0,0 +1,64 @@
+/* 

+ * 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.runtime.core.components;

+

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+

+import java.util.Properties;

+

+

+public class FooProviderTypeDyn implements FooService {

+	

+	private int intProp;	

+	private String strProp;

+	private String[] strAProp;

+	private int[] intAProp;

+	private boolean boolProp;

+

+	public boolean foo() {

+		intProp = 3;

+		boolProp = true;

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

+		else { strProp = "foo"; }

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

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

+		return true;

+	}

+

+	public Properties fooProps() {

+		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);

+		return p;

+	}

+	

+	public boolean getBoolean() { return true; }

+

+	public double getDouble() { return 1.0; }

+

+	public int getInt() { return 1; }

+

+	public long getLong() { return 1; }

+

+	public Boolean getObject() { return new Boolean(true); }

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn2.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn2.java
new file mode 100644
index 0000000..efec5f0
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderTypeDyn2.java
@@ -0,0 +1,58 @@
+/* 

+ * 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.runtime.core.components;

+

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+

+import java.util.Properties;

+

+public class FooProviderTypeDyn2 implements FooService {

+	

+	private int intProp = 2;

+	private boolean boolProp = true;

+	private String strProp = "foo";

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

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

+

+	public boolean foo() {

+		intAProp = null;

+		return true;

+	}

+

+	public Properties fooProps() {

+		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);

+		return p;

+	}

+	

+	public boolean getBoolean() { return true; }

+

+	public double getDouble() { return 1.0; }

+

+	public int getInt() { return 1; }

+

+	public long getLong() { return 1; }

+

+	public Boolean getObject() { return new Boolean(true); }

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderWithAnonymousClass.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderWithAnonymousClass.java
new file mode 100644
index 0000000..363db26
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/FooProviderWithAnonymousClass.java
@@ -0,0 +1,97 @@
+/*

+ * 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.runtime.core.components;

+

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+

+import javax.swing.*;

+import java.util.Properties;

+

+public class FooProviderWithAnonymousClass implements FooService {

+

+	private int intProp;

+	private String strProp;

+	private String[] strAProp;

+	private int[] intAProp;

+	private boolean boolProp;

+

+	public boolean foo() {

+		Runnable runnable = new Runnable() {

+			public void run() {

+				intProp = 3;

+				boolProp = true;

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

+				else { strProp = "foo"; }

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

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

+			}

+		};

+		new Thread(runnable).start();

+

+		try {

+			Thread.sleep(500);

+		} catch (InterruptedException e) {

+			e.printStackTrace();

+		}

+

+		return true;

+	}

+

+	public Properties fooProps() {

+		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);

+		return p;

+	}

+

+	public boolean getBoolean() {

+		SwingUtilities.invokeLater(new Runnable() {

+			public void run() {

+				intProp = 3;

+				boolProp = true;

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

+				else { strProp = "foo"; }

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

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

+			}

+		});

+

+		try {

+			Thread.sleep(500);

+		} catch (InterruptedException e) {

+			e.printStackTrace();

+		}

+

+		return true;

+	}

+

+	public double getDouble() { return 1.0; }

+

+	public int getInt() { return 1; }

+

+	public long getLong() { return 1; }

+

+	public Boolean getObject() { return new Boolean(true); }

+

+

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/NullCheckServiceProvider.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/NullCheckServiceProvider.java
new file mode 100644
index 0000000..6d3f587
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/NullCheckServiceProvider.java
@@ -0,0 +1,57 @@
+package org.apache.felix.ipojo.runtime.core.components;
+
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import java.util.Properties;
+
+public class NullCheckServiceProvider implements FooService {
+    
+    private String prop1;
+    private String prop2;
+    
+    public NullCheckServiceProvider() {
+      if (prop1 == null) {
+          prop2= "0";
+      }
+    }
+    
+
+    public boolean foo() {
+        if (prop1 == null  && prop2 != null) {
+            prop1 = "0";
+            prop2 = null;
+            return true;
+        }
+        if (prop2 == null  && prop1 != null) {
+            prop1 = null;
+            prop2 = "0";
+            return true;
+        }
+        return false;
+    }
+
+    public Properties fooProps() {
+        return null;
+    }
+
+    public boolean getBoolean() {
+        return false;
+    }
+
+    public double getDouble() {
+        return 0;
+    }
+
+    public int getInt() {
+        return 0;
+    }
+
+    public long getLong() {
+        return 0;
+    }
+
+    public Boolean getObject() {
+        return null;
+    }
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/SimpleClass.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/SimpleClass.java
new file mode 100644
index 0000000..5c19dc4
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/SimpleClass.java
@@ -0,0 +1,11 @@
+package org.apache.felix.ipojo.runtime.core.components;
+
+public class SimpleClass {
+
+	// This class do not implement any interface, it will be exposed as SimpleClass
+
+	public String hello() {
+		return "Hello";
+	}
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/callbacks/CallbacksCheckService.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/callbacks/CallbacksCheckService.java
new file mode 100644
index 0000000..40cf0d6
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/callbacks/CallbacksCheckService.java
@@ -0,0 +1,92 @@
+package org.apache.felix.ipojo.runtime.core.components.callbacks;
+
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+import org.osgi.framework.ServiceReference;
+
+import java.util.Properties;
+
+public class CallbacksCheckService implements FooService, CheckService {
+
+	// 4 Counters
+	int registered = 0;
+	int unregistered = 0;
+	int registered2 = 0;
+	int unregistered2 = 0;
+
+	// 4 Methods
+	public void registered(ServiceReference ref) {
+		if (ref == null) {
+			throw new IllegalArgumentException("ref null");
+		}
+		registered++;
+	}
+
+	public void unregistered(ServiceReference ref) {
+		if (ref == null) {
+			throw new IllegalArgumentException("ref null");
+		}
+		unregistered++;
+	}
+
+	public void registered2(ServiceReference ref) {
+		if (ref == null) {
+			throw new IllegalArgumentException("ref null");
+		}
+		registered2++;
+	}
+
+	public void unregistered2(ServiceReference ref) {
+		if (ref == null) {
+			throw new IllegalArgumentException("ref null");
+		}
+		unregistered2++;
+	}
+
+    public boolean foo() {
+        return true;
+    }
+
+    public Properties fooProps() {
+        Properties props = new Properties();
+        props.put("registered", new Integer(registered));
+        props.put("registered2", new Integer(registered2));
+        props.put("unregistered", new Integer(unregistered));
+        props.put("unregistered2", new Integer(unregistered2));
+        return props;
+    }
+
+    public boolean getBoolean() {
+        return false;
+    }
+
+    public double getDouble() {
+        return 0;
+    }
+
+    public int getInt() {
+        return 0;
+    }
+
+    public long getLong() {
+        return 0;
+    }
+
+    public Boolean getObject() {
+        return null;
+    }
+
+    public boolean check() {
+       return true;
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("registered", new Integer(registered));
+        props.put("registered2", new Integer(registered2));
+        props.put("unregistered", new Integer(unregistered));
+        props.put("unregistered2", new Integer(unregistered2));
+        return props;
+    }
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/controller/ControllerCheckService.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/controller/ControllerCheckService.java
new file mode 100644
index 0000000..ea23560
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/controller/ControllerCheckService.java
@@ -0,0 +1,56 @@
+package org.apache.felix.ipojo.runtime.core.components.controller;
+
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import java.util.Properties;
+
+public class ControllerCheckService implements FooService, CheckService {
+    
+    
+    private boolean controller;
+
+    public boolean foo() {
+        return controller;
+    }
+
+    public Properties fooProps() {
+        Properties props = new Properties();
+        props.put("controller", new Boolean(controller));
+        return props;
+    }
+
+    public boolean getBoolean() {
+        return false;
+    }
+
+    public double getDouble() {
+        return 0;
+    }
+
+    public int getInt() {
+        return 0;
+    }
+
+    public long getLong() {
+        return 0;
+    }
+
+    public Boolean getObject() {
+        return null;
+    }
+
+    public boolean check() {
+        System.out.println("Before : " + controller);
+        controller = ! controller; // Change
+        System.out.println("After : " + controller);
+        return controller;
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("controller", new Boolean(controller));
+        return props;
+    }
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/controller/DoubleControllerCheckService.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/controller/DoubleControllerCheckService.java
new file mode 100644
index 0000000..d82cb34
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/controller/DoubleControllerCheckService.java
@@ -0,0 +1,66 @@
+package org.apache.felix.ipojo.runtime.core.components.controller;
+
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import java.util.Properties;
+
+public class DoubleControllerCheckService implements FooService, CheckService {
+    
+    
+    private boolean controllerFoo;
+    private boolean controllerCS;
+
+    public boolean foo() {
+        controllerFoo = ! controllerFoo;
+        return controllerFoo;
+    }
+
+    public Properties fooProps() {
+        Properties props = new Properties();
+        props.put("controller", new Boolean(controllerFoo));
+        
+        controllerCS = true;
+        controllerFoo = true;
+        
+        return props;
+    }
+
+    public boolean getBoolean() {
+        return false;
+    }
+
+    public double getDouble() {
+        return 0;
+    }
+
+    public int getInt() {
+        return 0;
+    }
+
+    public long getLong() {
+        return 0;
+    }
+
+    public Boolean getObject() {
+        return null;
+    }
+
+    public boolean check() {
+        controllerCS = ! controllerCS;
+        return controllerCS;
+    }
+
+    public Properties getProps() {
+        Properties props = new Properties();
+        props.put("controller", new Boolean(controllerCS));
+        
+        // Invert both
+        controllerCS = ! controllerCS;
+        controllerFoo = ! controllerFoo;
+        
+        return props;
+        
+    }
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/a/IA.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/a/IA.java
new file mode 100644
index 0000000..1ced960
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/a/IA.java
@@ -0,0 +1,7 @@
+package org.apache.felix.ipojo.runtime.core.components.inheritance.a;
+
+public interface IA {
+    
+    public String methOne();
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/b/IB.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/b/IB.java
new file mode 100644
index 0000000..96a6926
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/b/IB.java
@@ -0,0 +1,8 @@
+package org.apache.felix.ipojo.runtime.core.components.inheritance.b;
+
+import org.apache.felix.ipojo.runtime.core.components.inheritance.a.IA;
+
+public interface IB extends IA {
+
+    public String methTwo();
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/c/C.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/c/C.java
new file mode 100644
index 0000000..5b3f6d2
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/c/C.java
@@ -0,0 +1,19 @@
+package org.apache.felix.ipojo.runtime.core.components.inheritance.c;
+
+import org.apache.felix.ipojo.annotations.Component;
+import org.apache.felix.ipojo.annotations.Provides;
+import org.apache.felix.ipojo.runtime.core.components.inheritance.b.IB;
+
+@Component
+@Provides
+public class C implements IB {
+
+    public String methOne() {
+        return "one";
+    }
+
+    public String methTwo() {
+        return "two";
+    }
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/d/D.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/d/D.java
new file mode 100644
index 0000000..2ac3bb8
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inheritance/d/D.java
@@ -0,0 +1,39 @@
+package org.apache.felix.ipojo.runtime.core.components.inheritance.d;
+
+import org.apache.felix.ipojo.annotations.Component;
+import org.apache.felix.ipojo.annotations.Requires;
+import org.apache.felix.ipojo.annotations.Validate;
+import org.apache.felix.ipojo.runtime.core.components.inheritance.a.IA;
+import org.apache.felix.ipojo.runtime.core.components.inheritance.b.IB;
+
+@Component
+public class D {
+    @Requires
+    private IB[] cImpls;
+    private IB cImplDesired;
+
+    // works if I use following instead and cast to C type below
+    // in for loop
+    // but this creates dependency on bundle C instead of just
+    // the interface bundles A & B
+    // @Requires(default-implementation=C)
+    // private iB[] cImpls;
+    // private C cImplDesired;
+
+    @Validate
+    public void start() {
+        for (IB iimpl : cImpls) {
+
+            // works just fine
+            System.out.println(iimpl.methTwo());
+
+            // following produces 
+            // invalid D instance with NoMethodFoundError
+            // unless I cast to C instead of iA
+            if (((IA) iimpl).methOne().equals("one")) {
+                cImplDesired = iimpl;
+                System.out.println(iimpl.methOne());
+            }
+        }
+    }
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation1.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation1.java
new file mode 100644
index 0000000..786674f
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation1.java
@@ -0,0 +1,45 @@
+/* 

+ * 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.runtime.core.components.inherited;

+

+import org.apache.felix.ipojo.runtime.core.services.ChildInterface;

+

+public class ProcessImplementation1 implements ChildInterface {

+

+    public void processChild() {

+        // TODO Auto-generated method stub

+

+    }

+

+    public void processParent1() {

+        // TODO Auto-generated method stub

+

+    }

+

+    public void processParentParent() {

+        // TODO Auto-generated method stub

+

+    }

+

+    public void processParent2() {

+        // TODO Auto-generated method stub

+

+    }

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation2.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation2.java
new file mode 100644
index 0000000..056fbcc
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation2.java
@@ -0,0 +1,44 @@
+/* 

+ * 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.runtime.core.components.inherited;

+

+

+public class ProcessImplementation2 extends ProcessParentImplementation {

+

+    public void processChild() {

+        // TODO Auto-generated method stub

+

+    }

+

+    public void processParent1() {

+        // TODO Auto-generated method stub

+

+    }

+

+    public void processParentParent() {

+        // TODO Auto-generated method stub

+

+    }

+

+    public void processParent2() {

+        // TODO Auto-generated method stub

+

+    }

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation3.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation3.java
new file mode 100644
index 0000000..88350bd
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation3.java
@@ -0,0 +1,82 @@
+/* 

+ * 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.runtime.core.components.inherited;

+

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+

+import java.util.Properties;

+

+public class ProcessImplementation3 extends ProcessParentImplementation  implements FooService {

+

+    public void processChild() {

+        // TODO Auto-generated method stub

+

+    }

+

+    public void processParent1() {

+        // TODO Auto-generated method stub

+

+    }

+

+    public void processParentParent() {

+        // TODO Auto-generated method stub

+

+    }

+

+    public void processParent2() {

+        // TODO Auto-generated method stub

+

+    }

+

+    public boolean foo() {

+        // TODO Auto-generated method stub

+        return false;

+    }

+

+    public Properties fooProps() {

+        // TODO Auto-generated method stub

+        return null;

+    }

+

+    public boolean getBoolean() {

+        // TODO Auto-generated method stub

+        return false;

+    }

+

+    public double getDouble() {

+        // TODO Auto-generated method stub

+        return 0;

+    }

+

+    public int getInt() {

+        // TODO Auto-generated method stub

+        return 0;

+    }

+

+    public long getLong() {

+        // TODO Auto-generated method stub

+        return 0;

+    }

+

+    public Boolean getObject() {

+        // TODO Auto-generated method stub

+        return null;

+    }

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation4.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation4.java
new file mode 100644
index 0000000..60fe83f
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessImplementation4.java
@@ -0,0 +1,82 @@
+/* 

+ * 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.runtime.core.components.inherited;

+

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+

+import java.util.Properties;

+

+public class ProcessImplementation4 extends ProcessImplementation2  implements FooService {

+

+    public void processChild() {

+        // TODO Auto-generated method stub

+

+    }

+

+    public void processParent1() {

+        // TODO Auto-generated method stub

+

+    }

+

+    public void processParentParent() {

+        // TODO Auto-generated method stub

+

+    }

+

+    public void processParent2() {

+        // TODO Auto-generated method stub

+

+    }

+

+    public boolean foo() {

+        // TODO Auto-generated method stub

+        return false;

+    }

+

+    public Properties fooProps() {

+        // TODO Auto-generated method stub

+        return null;

+    }

+

+    public boolean getBoolean() {

+        // TODO Auto-generated method stub

+        return false;

+    }

+

+    public double getDouble() {

+        // TODO Auto-generated method stub

+        return 0;

+    }

+

+    public int getInt() {

+        // TODO Auto-generated method stub

+        return 0;

+    }

+

+    public long getLong() {

+        // TODO Auto-generated method stub

+        return 0;

+    }

+

+    public Boolean getObject() {

+        // TODO Auto-generated method stub

+        return null;

+    }

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessParentImplementation.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessParentImplementation.java
new file mode 100644
index 0000000..56e9fe0
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/inherited/ProcessParentImplementation.java
@@ -0,0 +1,46 @@
+/* 

+ * 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.runtime.core.components.inherited;

+

+import org.apache.felix.ipojo.runtime.core.services.ChildInterface;

+

+public class ProcessParentImplementation implements ChildInterface {

+

+    public void processChild() {

+        // TODO Auto-generated method stub

+        

+    }

+

+    public void processParent1() {

+        // TODO Auto-generated method stub

+        

+    }

+

+    public void processParentParent() {

+        // TODO Auto-generated method stub

+        

+    }

+

+    public void processParent2() {

+        // TODO Auto-generated method stub

+        

+    }

+

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/BarConsumer.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/BarConsumer.java
new file mode 100644
index 0000000..bf8d823
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/BarConsumer.java
@@ -0,0 +1,23 @@
+package org.apache.felix.ipojo.runtime.core.components.strategies;
+
+import org.apache.felix.ipojo.runtime.core.services.BarService;
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+
+import java.util.Properties;
+
+public class BarConsumer implements CheckService {
+    
+    private BarService bs;
+
+
+    public boolean check() {
+        return bs.bar();
+    }
+
+    public Properties getProps() {
+        Properties props = bs.getProps();
+        props.put("object", bs);
+        return props;
+    }
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/Consumer.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/Consumer.java
new file mode 100644
index 0000000..52832a7
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/Consumer.java
@@ -0,0 +1,23 @@
+package org.apache.felix.ipojo.runtime.core.components.strategies;
+
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+
+import java.util.Properties;
+
+public class Consumer implements CheckService {
+    
+    private FooService fs;
+
+
+    public boolean check() {
+        return fs.foo();
+    }
+
+    public Properties getProps() {
+        Properties props = fs.fooProps();
+        props.put("object", fs);
+        return props;
+    }
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyCreationStrategy.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyCreationStrategy.java
new file mode 100644
index 0000000..c4103f5
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyCreationStrategy.java
@@ -0,0 +1,164 @@
+package org.apache.felix.ipojo.runtime.core.components.strategies;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.IPOJOServiceFactory;
+import org.apache.felix.ipojo.InstanceManager;
+import org.apache.felix.ipojo.handlers.providedservice.CreationStrategy;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.*;
+
+public class DummyCreationStrategy extends CreationStrategy implements InvocationHandler {
+
+    /**
+     * Map [ComponentInstance->ServiceObject] storing created service objects.
+     */
+    private Map/*<ComponentInstance, ServiceObject>*/ m_instances = new HashMap();
+    
+    private InstanceManager m_manager;
+
+    private String[] m_specs;
+
+    /**
+     * A method is invoked on the proxy object.
+     * If the method is the {@link org.apache.felix.ipojo.IPOJOServiceFactory#getService(org.apache.felix.ipojo.ComponentInstance)}
+     * method, this method creates a service object if no already created for the asking
+     * component instance.
+     * If the method is {@link org.apache.felix.ipojo.IPOJOServiceFactory#ungetService(org.apache.felix.ipojo.ComponentInstance, Object)}
+     * the service object is unget (i.e. removed from the map and deleted).
+     * In all other cases, a {@link UnsupportedOperationException} is thrown as this policy
+     * requires to use  the {@link org.apache.felix.ipojo.IPOJOServiceFactory} interaction pattern.
+     * @param arg0 the proxy object
+     * @param arg1 the called method
+     * @param arg2 the arguments
+     * @return the service object attached to the asking instance for 'get',
+     * <code>null</code> for 'unget',
+     * a {@link UnsupportedOperationException} for all other methods.
+     * @see java.lang.reflect.InvocationHandler#invoke(Object, java.lang.reflect.Method, Object[])
+     */
+    public Object invoke(Object arg0, Method arg1, Object[] arg2) {
+        if (isGetServiceMethod(arg1)) {
+            return getService((ComponentInstance) arg2[0]);
+        }
+
+        if (isUngetServiceMethod(arg1)) {
+            ungetService((ComponentInstance) arg2[0], arg2[1]);
+            return null;
+        }
+
+        throw new UnsupportedOperationException("This service requires an advanced creation policy. "
+                + "Before calling the service, call the getService(ComponentInstance) method to get "
+                + "the service object. " + arg1.getName());
+    }
+
+    /**
+     * A service object is required.
+     * This policy returns a service object per asking instance.
+     * @param instance the instance requiring the service object
+     * @return the service object for this instance
+     * @see org.apache.felix.ipojo.IPOJOServiceFactory#getService(org.apache.felix.ipojo.ComponentInstance)
+     */
+    public Object getService(ComponentInstance instance) {
+        Object obj = m_instances.get(instance);
+        if (obj == null) {
+            obj = m_manager.createPojoObject();
+            m_instances.put(instance, obj);
+        }
+        return obj;
+    }
+
+    /**
+     * A service object is unget.
+     * The service object is removed from the map and deleted.
+     * @param instance the instance releasing the service
+     * @param svcObject the service object
+     * @see org.apache.felix.ipojo.IPOJOServiceFactory#ungetService(org.apache.felix.ipojo.ComponentInstance, Object)
+     */
+    public void ungetService(ComponentInstance instance, Object svcObject) {
+        Object pojo = m_instances.remove(instance);
+        m_manager.deletePojoObject(pojo);
+    }
+
+    /**
+     * The service is going to be registered.
+     * @param im the instance manager
+     * @param interfaces the published interfaces
+     * @param props the properties
+     * @see org.apache.felix.ipojo.handlers.providedservice.CreationStrategy#onPublication(org.osgi.framework.BundleContext, String[], java.util.Properties)
+     */
+    public void onPublication(InstanceManager im, String[] interfaces,
+            Properties props) {
+
+        m_manager = im;
+        m_specs = interfaces;
+
+    }
+
+    /**
+     * The service is going to be unregistered.
+     * The instance map is cleared. Created object are disposed.
+     * @see org.apache.felix.ipojo.handlers.providedservice.CreationStrategy#onUnpublication()
+     */
+    public void onUnpublication() {
+        Collection col = m_instances.values();
+        Iterator it = col.iterator();
+        while (it.hasNext()) {
+            m_manager.deletePojoObject(it.next());
+        }
+        m_instances.clear();
+    }
+
+    /**
+     * OSGi Service Factory getService method.
+     * @param arg0 the asking bundle
+     * @param arg1 the service registration
+     * @return a proxy implementing the {@link org.apache.felix.ipojo.IPOJOServiceFactory}
+     * @see org.osgi.framework.ServiceFactory#getService(org.osgi.framework.Bundle, org.osgi.framework.ServiceRegistration)
+     */
+    public Object getService(Bundle arg0, ServiceRegistration arg1) {
+        Object proxy = Proxy.newProxyInstance(m_manager.getClazz().getClassLoader(),
+                getSpecificationsWithIPOJOServiceFactory(m_specs, m_manager.getContext()), this);
+        return proxy;
+    }
+
+    /**
+     * OSGi Service factory unget method.
+     * Does nothing.
+     * @param arg0 the asking bundle
+     * @param arg1 the service registration
+     * @param arg2 the service object created for this bundle.
+     * @see org.osgi.framework.ServiceFactory#ungetService(org.osgi.framework.Bundle, org.osgi.framework.ServiceRegistration, Object)
+     */
+    public void ungetService(Bundle arg0, ServiceRegistration arg1,
+            Object arg2) { }
+
+    /**
+     * Utility method returning the class array of provided service
+     * specification and the {@link org.apache.felix.ipojo.IPOJOServiceFactory} interface.
+     * @param specs the published service interface
+     * @param bc the bundle context, used to load classes
+     * @return the class array containing provided service specification and
+     * the {@link org.apache.felix.ipojo.IPOJOServiceFactory} class.
+     */
+    private Class[] getSpecificationsWithIPOJOServiceFactory(String[] specs, BundleContext bc) {
+        Class[] classes = new Class[specs.length + 1];
+        int i = 0;
+        for (i = 0; i < specs.length; i++) {
+            try {
+                classes[i] = bc.getBundle().loadClass(specs[i]);
+            } catch (ClassNotFoundException e) {
+                // Should not happen.
+            }
+        }
+        classes[i] = IPOJOServiceFactory.class;
+        return classes;
+    }
+    
+    
+}
+
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyCreationStrategy2.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyCreationStrategy2.java
new file mode 100644
index 0000000..621edb9
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyCreationStrategy2.java
@@ -0,0 +1,15 @@
+package org.apache.felix.ipojo.runtime.core.components.strategies;

+

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

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

+import org.apache.felix.ipojo.handlers.providedservice.strategy.ConfigurableCreationStrategy;

+

+public class DummyCreationStrategy2 extends ConfigurableCreationStrategy {

+

+	protected IPOJOServiceFactory getServiceFactory(InstanceManager manager) {

+		return new DummyServiceFactory(manager);

+	}

+    

+    

+}

+

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyServiceFactory.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyServiceFactory.java
new file mode 100644
index 0000000..b1efd70
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/DummyServiceFactory.java
@@ -0,0 +1,61 @@
+package org.apache.felix.ipojo.runtime.core.components.strategies;

+

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

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

+import org.apache.felix.ipojo.handlers.providedservice.strategy.ServiceObjectFactory;

+

+import java.util.Collection;

+import java.util.HashMap;

+import java.util.Iterator;

+import java.util.Map;

+

+public class DummyServiceFactory implements ServiceObjectFactory {

+

+    /**

+     * Map [ComponentInstance->ServiceObject] storing created service objects.

+     */

+    private Map/*<ComponentInstance, ServiceObject>*/ m_instances = new HashMap();

+    

+    private InstanceManager m_manager;

+

+    public DummyServiceFactory(InstanceManager manager) {

+        m_manager = manager;

+    }

+

+    /**

+     * A service object is required.

+     * This policy returns a service object per asking instance.

+     * @param instance the instance requiring the service object

+     * @return the service object for this instance

+     * @see org.apache.felix.ipojo.IPOJOServiceFactory#getService(org.apache.felix.ipojo.ComponentInstance)

+     */

+    public Object getService(ComponentInstance instance) {

+        Object obj = m_instances.get(instance);

+        if (obj == null) {

+            obj = m_manager.createPojoObject();

+            m_instances.put(instance, obj);

+        }

+        return obj;

+    }

+

+    /**

+     * A service object is unget.

+     * The service object is removed from the map and deleted.

+     * @param instance the instance releasing the service

+     * @param svcObject the service object

+     * @see org.apache.felix.ipojo.IPOJOServiceFactory#ungetService(org.apache.felix.ipojo.ComponentInstance, Object)

+     */

+    public void ungetService(ComponentInstance instance, Object svcObject) {

+        Object pojo = m_instances.remove(instance);

+        m_manager.deletePojoObject(pojo);

+    }

+

+    public void close() {

+        Collection col = m_instances.values();

+        Iterator it = col.iterator();

+        while (it.hasNext()) {

+            m_manager.deletePojoObject(it.next());

+        }

+        m_instances.clear();

+    }

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/FooBarProviderType1.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/FooBarProviderType1.java
new file mode 100644
index 0000000..2fd009f
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/FooBarProviderType1.java
@@ -0,0 +1,86 @@
+/* 

+ * 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.runtime.core.components.strategies;

+

+import org.apache.felix.ipojo.runtime.core.services.BarService;

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+

+import java.util.Properties;

+

+public class FooBarProviderType1 implements FooService, BarService {

+    

+    public static long id = 0;

+    

+    public static long getNewId() {

+        id++;

+        return id;

+    }

+    

+    public static long getReturnedIds() {

+        return id;

+    }

+    

+    public static void resetIds() {

+        id = 0;

+    }

+	

+	private int m_bar;

+	private String m_foo;

+        

+    private long myid = getNewId();

+    

+    

+    

+	public boolean foo() {

+		return true;

+	}

+

+	public Properties fooProps() {

+	    System.out.println(this + " - id : " + myid); //TODO DEBUG

+		Properties p = new Properties();

+		p.put("bar", new Integer(m_bar));

+        if(m_foo != null) {

+            p.put("foo", m_foo);

+        }

+        

+        p.put("id", new Long(myid));

+		return p;

+	}

+    

+    

+	public boolean getBoolean() { return true; }

+

+	public double getDouble() { return 1.0; }

+

+	public int getInt() { return 1; }

+

+	public long getLong() { return 1; }

+

+	public Boolean getObject() { return new Boolean(true); }

+

+    public boolean bar() {

+        return foo();

+    }

+

+    public Properties getProps() {

+        return fooProps();

+    }

+	

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/FooProviderType1.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/FooProviderType1.java
new file mode 100755
index 0000000..34c3eb1
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/components/strategies/FooProviderType1.java
@@ -0,0 +1,86 @@
+/* 

+ * 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.runtime.core.components.strategies;

+

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+

+import java.util.Properties;

+

+public class FooProviderType1 implements FooService {

+

+    public static long id = 0;

+

+    public static long getNewId() {

+        id++;

+        return id;

+    }

+

+    public static long getReturnedIds() {

+        return id;

+    }

+

+    public static void resetIds() {

+        id = 0;

+    }

+

+    private int m_bar;

+    private String m_foo;

+

+    private long myid = getNewId();

+

+

+    public boolean foo() {

+        return true;

+    }

+

+    public Properties fooProps() {

+        System.out.println(this + " - id : " + myid); //TODO DEBUG

+        Properties p = new Properties();

+        p.put("bar", new Integer(m_bar));

+        if (m_foo != null) {

+            p.put("foo", m_foo);

+        }

+

+        p.put("id", new Long(myid));

+        return p;

+    }

+

+

+    public boolean getBoolean() {

+        return true;

+    }

+

+    public double getDouble() {

+        return 1.0;

+    }

+

+    public int getInt() {

+        return 1;

+    }

+

+    public long getLong() {

+        return 1;

+    }

+

+    public Boolean getObject() {

+        return new Boolean(true);

+    }

+

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/BarService.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/BarService.java
new file mode 100644
index 0000000..f704138
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/BarService.java
@@ -0,0 +1,29 @@
+/* 

+ * 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.runtime.core.services;

+

+import java.util.Properties;

+

+public interface BarService {

+	

+	public boolean bar();

+	

+	public Properties getProps();

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/CheckService.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/CheckService.java
new file mode 100644
index 0000000..eca0faa
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/CheckService.java
@@ -0,0 +1,31 @@
+/* 

+ * 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.runtime.core.services;

+

+import java.util.Properties;

+

+public interface CheckService {

+    

+    public static final String foo = "foo";

+	

+	public boolean check();

+	

+	public Properties getProps();

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/ChildInterface.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/ChildInterface.java
new file mode 100644
index 0000000..c7608e1
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/ChildInterface.java
@@ -0,0 +1,25 @@
+/* 

+ * 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.runtime.core.services;

+

+public interface ChildInterface extends ParentInterface1, ParentInterface2 {

+    

+    public void processChild();

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/FooService.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/FooService.java
new file mode 100644
index 0000000..37c1a65
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/FooService.java
@@ -0,0 +1,39 @@
+/* 

+ * 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.runtime.core.services;

+

+import java.util.Properties;

+

+public interface FooService {

+

+	boolean foo();

+	

+	Properties fooProps();

+	

+	Boolean getObject();

+	

+	boolean getBoolean();

+	

+	int getInt();

+	

+	long getLong();

+	

+	double getDouble();

+	

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/ParentInterface1.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/ParentInterface1.java
new file mode 100644
index 0000000..f6391a4
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/ParentInterface1.java
@@ -0,0 +1,25 @@
+/* 

+ * 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.runtime.core.services;

+

+public interface ParentInterface1 extends ParentParentInterface {

+    

+    public void processParent1();

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/ParentInterface2.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/ParentInterface2.java
new file mode 100644
index 0000000..3080f3f
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/ParentInterface2.java
@@ -0,0 +1,25 @@
+/* 

+ * 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.runtime.core.services;

+

+public interface ParentInterface2 {

+    

+    public void processParent2();

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/ParentParentInterface.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/ParentParentInterface.java
new file mode 100644
index 0000000..4332077
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/java/org/apache/felix/ipojo/runtime/core/services/ParentParentInterface.java
@@ -0,0 +1,25 @@
+/* 

+ * 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.runtime.core.services;

+

+public interface ParentParentInterface {

+    

+    public void processParentParent();

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/basics.xml b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/basics.xml
new file mode 100644
index 0000000..54155c3
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/basics.xml
@@ -0,0 +1,121 @@
+<ipojo

+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

+ xmlns="org.apache.felix.ipojo"

+>

+    <!-- Simple provider  -->

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.FooProviderType1"

+     name="PS-FooProviderType-1" architecture="true">

+        <provides/>

+    </component>

+

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.FooProviderType1"

+     name="PS-FooProviderType-itf" architecture="true">

+        <provides

+         specifications="org.apache.felix.ipojo.runtime.core.services.FooService"/>

+    </component>

+

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.FooProviderType1"

+     name="PS-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>

+

+    <!-- Providers providing 2 services -->

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.FooBarProviderType1"

+     name="PS-FooBarProviderType-1" architecture="true">

+        <provides/>

+    </component>

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.FooBarProviderType1"

+     name="PS-FooBarProviderType-2" architecture="true">

+        <provides

+         specifications="{org.apache.felix.ipojo.runtime.core.services.FooService, org.apache.felix.ipojo.runtime.core.services.BarService }"/>

+    </component>

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.FooBarProviderType1"

+     name="PS-FooBarProviderType-3" architecture="true">

+        <provides

+         specifications="{org.apache.felix.ipojo.runtime.core.services.FooService}">

+            <property name="baz" type="java.lang.String" value="foo"/>

+        </provides>

+        <provides

+         specifications="{org.apache.felix.ipojo.runtime.core.services.BarService}">

+            <property name="baz" type="java.lang.String" value="bar"/>

+        </provides>

+    </component>

+

+

+    <!-- Provider with dynamic property -->

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.FooProviderTypeDyn"

+     name="PS-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.runtime.core.components.FooProviderType1"

+     name="PS-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.runtime.core.components.FooProviderTypeDyn2"

+     name="PS-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="intAProp" field="intAProp"

+             value="{1, 2,3 }"/>

+        </provides>

+    </component>

+

+    <!--  Null Check -->

+    <component classname="org.apache.felix.ipojo.runtime.core.components.NullCheckServiceProvider" immediate="true"

+     name="PS-Null">

+        <provides>

+            <property field="prop1"/>

+            <property field="prop2"/>

+        </provides>

+    </component>

+

+    <!-- Anonymous classes -->

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.FooProviderWithAnonymousClass"

+     name="PS-FooProviderTypeAnonymous-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>

+</ipojo>

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/callbacks/callbacks.xml b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/callbacks/callbacks.xml
new file mode 100644
index 0000000..33146c1
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/callbacks/callbacks.xml
@@ -0,0 +1,41 @@
+<ipojo

+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

+ xmlns="org.apache.felix.ipojo"

+>

+    <!-- Registration callbacks -->

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.callbacks.CallbacksCheckService"

+     name="PS-Callbacks-reg-only">

+        <provides post-registration="registered"/>

+    </component>

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.callbacks.CallbacksCheckService"

+     name="PS-Callbacks-both">

+        <provides post-registration="registered" post-unregistration="unregistered"/>

+    </component>

+	<component

+     classname="org.apache.felix.ipojo.runtime.core.components.callbacks.CallbacksCheckService"

+     name="PS-Callbacks-unreg-only">

+        <provides post-unregistration="unregistered"/>

+    </component>

+	<component

+     classname="org.apache.felix.ipojo.runtime.core.components.callbacks.CallbacksCheckService"

+     name="PS-Callbacks-both-2">

+        <provides

+			specifications="org.apache.felix.ipojo.runtime.core.services.FooService"

+			post-unregistration="unregistered" post-registration="registered"/>

+		<provides

+			specifications="org.apache.felix.ipojo.runtime.core.services.CheckService"

+			post-unregistration="unregistered2" post-registration="registered2"/>

+    </component>

+	<component

+     classname="org.apache.felix.ipojo.runtime.core.components.callbacks.CallbacksCheckService"

+     name="PS-Callbacks-both-1">

+        <provides

+			specifications="org.apache.felix.ipojo.runtime.core.services.FooService"

+			post-unregistration="unregistered" post-registration="registered"/>

+		<provides

+			specifications="org.apache.felix.ipojo.runtime.core.services.CheckService"

+			post-unregistration="unregistered" post-registration="registered"/>

+    </component>

+</ipojo>

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/concrete-abstract.xml b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/concrete-abstract.xml
new file mode 100644
index 0000000..bba0508
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/concrete-abstract.xml
@@ -0,0 +1,33 @@
+<ipojo

+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

+ xmlns="org.apache.felix.ipojo"

+>

+

+    <!-- Concrete and abstract class -->

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.inherited.ProcessParentImplementation"

+     name="PS-PI4" architecture="true">

+        <provides specifications="org.apache.felix.ipojo.runtime.core.components.inherited.ProcessParentImplementation"/>

+    </component>

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.inherited.ProcessImplementation2"

+     name="PS-PI5" architecture="true">

+        <provides specifications="org.apache.felix.ipojo.runtime.core.components.inherited.ProcessParentImplementation"/>

+    </component>

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.inherited.ProcessImplementation4"

+     name="PS-PI6" architecture="true">

+        <provides specifications="org.apache.felix.ipojo.runtime.core.components.inherited.ProcessParentImplementation"/>

+    </component>

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.inherited.ProcessImplementation3"

+     name="PS-PI7" architecture="true">

+        <provides specifications="[org.apache.felix.ipojo.runtime.core.components.inherited.ProcessParentImplementation, org.apache.felix.ipojo.runtime.core.services.FooService]"/>

+    </component>

+

+	<component

+	classname="org.apache.felix.ipojo.runtime.core.components.SimpleClass">

+		<provides/>

+	</component>

+

+</ipojo>

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/controller/service-controller.xml b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/controller/service-controller.xml
new file mode 100644
index 0000000..bc79b71
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/controller/service-controller.xml
@@ -0,0 +1,86 @@
+<ipojo

+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

+ xmlns="org.apache.felix.ipojo"

+>

+    <!--  Service Controller -->

+    <component classname="org.apache.felix.ipojo.runtime.core.components.controller.ControllerCheckService"

+     name="PS-Controller-1-default">

+        <provides specifications="org.apache.felix.ipojo.runtime.core.services.FooService">

+            <controller field="controller"/>

+        </provides>

+        <provides specifications="org.apache.felix.ipojo.runtime.core.services.CheckService">

+        </provides>

+    </component>

+    <component classname="org.apache.felix.ipojo.runtime.core.components.controller.ControllerCheckService"

+     name="PS-Controller-1-false">

+        <provides specifications="org.apache.felix.ipojo.runtime.core.services.FooService">

+            <property name="test2" type="string" value="test2"/>

+            <controller field="controller" value="false"/>

+            <property name="test" type="string" value="test"/>

+        </provides>

+        <provides specifications="org.apache.felix.ipojo.runtime.core.services.CheckService">

+        </provides>

+    </component>

+    <component classname="org.apache.felix.ipojo.runtime.core.components.controller.DoubleControllerCheckService"

+     name="PS-Controller-2-truetrue">

+        <provides specifications="org.apache.felix.ipojo.runtime.core.services.FooService">

+            <property name="test2" type="string" value="test2"/>

+            <controller field="controllerFoo" value="true"/>

+            <property name="test" type="string" value="test"/>

+        </provides>

+        <provides specifications="org.apache.felix.ipojo.runtime.core.services.CheckService">

+            <controller field="controllerCS" value="true"/>

+        </provides>

+    </component>

+    <component classname="org.apache.felix.ipojo.runtime.core.components.controller.DoubleControllerCheckService"

+     name="PS-Controller-2-truefalse">

+        <provides specifications="org.apache.felix.ipojo.runtime.core.services.FooService">

+            <property name="test2" type="string" value="test2"/>

+            <controller field="controllerFoo" value="false"/>

+            <property name="test" type="string" value="test"/>

+        </provides>

+        <provides specifications="org.apache.felix.ipojo.runtime.core.services.CheckService">

+            <controller field="controllerCS" value="true"/>

+        </provides>

+    </component>

+

+    <component classname="org.apache.felix.ipojo.runtime.core.components.controller.DoubleControllerCheckService"

+     name="PS-Controller-2-spec1">

+        <provides>

+            <property name="test2" type="string" value="test2"/>

+            <controller field="controllerFoo" value="false" specification="org.apache.felix.ipojo.runtime.core.services.FooService"/>

+            <controller field="controllerCS" value="true" specification="org.apache.felix.ipojo.runtime.core.services.CheckService"/>

+            <property name="test" type="string" value="test"/>

+        </provides>

+    </component>

+

+    <component classname="org.apache.felix.ipojo.runtime.core.components.controller.DoubleControllerCheckService"

+     name="PS-Controller-2-spec2">

+        <provides>

+            <property name="test2" type="string" value="test2"/>

+            <controller field="controllerFoo" value="true" specification="org.apache.felix.ipojo.runtime.core.services.FooService"/>

+            <controller field="controllerCS" value="true" specification="org.apache.felix.ipojo.runtime.core.services.CheckService"/>

+            <property name="test" type="string" value="test"/>

+        </provides>

+    </component>

+

+    <component classname="org.apache.felix.ipojo.runtime.core.components.controller.DoubleControllerCheckService"

+     name="PS-Controller-2-spec3">

+        <provides>

+            <property name="test2" type="string" value="test2"/>

+            <controller field="controllerFoo" value="true" specification="org.apache.felix.ipojo.runtime.core.services.FooService"/>

+            <controller field="controllerCS" value="true"/>

+            <property name="test" type="string" value="test"/>

+        </provides>

+    </component>

+

+    <component classname="org.apache.felix.ipojo.runtime.core.components.controller.DoubleControllerCheckService"

+     name="PS-Controller-2-spec4">

+        <provides>

+            <property name="test2" type="string" value="test2"/>

+            <controller field="controllerFoo" value="false" specification="org.apache.felix.ipojo.runtime.core.services.FooService"/>

+            <controller field="controllerCS" value="true"/>

+            <property name="test" type="string" value="test"/>

+        </provides>

+    </component>

+</ipojo>

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/inheritance/cons.xml b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/inheritance/cons.xml
new file mode 100644
index 0000000..c7d5ecf
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/inheritance/cons.xml
@@ -0,0 +1,3 @@
+<ipojo>
+<instance component="org.apache.felix.ipojo.runtime.core.components.inheritance.d.D" name="d"/>
+</ipojo>
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/inheritance/inheritance.xml b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/inheritance/inheritance.xml
new file mode 100644
index 0000000..13350ea
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/inheritance/inheritance.xml
@@ -0,0 +1,45 @@
+<ipojo

+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

+ xmlns="org.apache.felix.ipojo"

+>

+

+    <!--  Inherited Provides -->

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.inherited.ProcessImplementation1"

+     name="PS-PI1" architecture="true">

+        <provides/>

+    </component>

+

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.inherited.ProcessImplementation1"

+     name="PS-PI1-1" architecture="true">

+        <provides

+         specifications="org.apache.felix.ipojo.runtime.core.services.ParentParentInterface"/>

+    </component>

+

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.inherited.ProcessImplementation1"

+     name="PS-PI1-2" architecture="true">

+        <provides

+         specifications="{org.apache.felix.ipojo.runtime.core.services.ParentParentInterface, org.apache.felix.ipojo.runtime.core.services.ParentInterface2}"/>

+    </component>

+

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.inherited.ProcessImplementation2"

+     name="PS-PI2" architecture="true">

+        <provides/>

+    </component>

+

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.inherited.ProcessImplementation2"

+     name="PS-PI2-1" architecture="true">

+        <provides

+         specifications="org.apache.felix.ipojo.runtime.core.services.ParentParentInterface"/>

+    </component>

+

+    <component

+     classname="org.apache.felix.ipojo.runtime.core.components.inherited.ProcessImplementation3"

+     name="PS-PI3" architecture="true">

+        <provides/>

+    </component>

+</ipojo>

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/inheritance/provider.xml b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/inheritance/provider.xml
new file mode 100644
index 0000000..ec48205
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/inheritance/provider.xml
@@ -0,0 +1,3 @@
+<ipojo>
+<instance component="org.apache.felix.ipojo.runtime.core.components.inheritance.c.C" name="c"/>
+</ipojo>
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/strategies/metadata-strategies.xml b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/strategies/metadata-strategies.xml
new file mode 100755
index 0000000..11dabcb
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/main/resources/strategies/metadata-strategies.xml
@@ -0,0 +1,58 @@
+<ipojo

+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

+    xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"

+    xmlns="org.apache.felix.ipojo"

+>

+  <!-- Simple provider  -->

+  <component

+    classname="org.apache.felix.ipojo.runtime.core.components.strategies.FooProviderType1"

+    name="PSS-FooProviderType-Instance" architecture="true">

+    <provides strategy="instance"/>

+  </component>

+  

+  <component

+    classname="org.apache.felix.ipojo.runtime.core.components.strategies.Consumer"

+    name="PSS-Cons" architecture="true">

+    <requires field="fs" proxy="false"/>

+    <provides/>

+  </component>

+  

+  <component

+    classname="org.apache.felix.ipojo.runtime.core.components.strategies.BarConsumer"

+    name="PSS-ConsBar" architecture="true">

+    <requires field="bs" proxy="false"/>

+    <provides/>

+  </component>

+  

+  <component

+    classname="org.apache.felix.ipojo.runtime.core.components.strategies.FooBarProviderType1"

+    name="PSS-FooBarProviderType-Instance" architecture="true">

+    <provides strategy="instance"/>

+  </component>

+  

+    <component

+        classname="org.apache.felix.ipojo.runtime.core.components.strategies.FooProviderType1"

+        name="PSS-FooProviderType-Custom" architecture="true">

+        <provides strategy="org.apache.felix.ipojo.runtime.core.components.strategies.DummyCreationStrategy"/>

+    </component>

+

+    <component

+        classname="org.apache.felix.ipojo.runtime.core.components.strategies.FooBarProviderType1"

+        name="PSS-FooBarProviderType-Custom" architecture="true">

+        <provides strategy="org.apache.felix.ipojo.runtime.core.components.strategies.DummyCreationStrategy"/>

+    </component>

+

+    <component

+        classname="org.apache.felix.ipojo.runtime.core.components.strategies.FooProviderType1"

+        name="PSS-FooProviderType-Custom2" architecture="true">

+        <provides strategy="org.apache.felix.ipojo.runtime.core.components.strategies.DummyCreationStrategy2"/>

+    </component>

+

+    <component

+        classname="org.apache.felix.ipojo.runtime.core.components.strategies.FooBarProviderType1"

+        name="PSS-FooBarProviderType-Custom2" architecture="true">

+        <provides strategy="org.apache.felix.ipojo.runtime.core.components.strategies.DummyCreationStrategy2"/>

+    </component>

+

+

+</ipojo>

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java
new file mode 100644
index 0000000..9377467
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/Common.java
@@ -0,0 +1,214 @@
+package org.apache.felix.ipojo.runtime.core;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.Logger;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.filefilter.TrueFileFilter;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.CoreOptions;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.options.CompositeOption;
+import org.ops4j.pax.exam.options.DefaultCompositeOption;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.ops4j.pax.tinybundles.core.TinyBundle;
+import org.ops4j.pax.tinybundles.core.TinyBundles;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.ow2.chameleon.testing.helpers.IPOJOHelper;
+import org.ow2.chameleon.testing.helpers.OSGiHelper;
+import org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOStrategy;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import static junit.framework.Assert.fail;
+import static org.ops4j.pax.exam.CoreOptions.*;
+
+/**
+ * Bootstrap the test from this project
+ */
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
+public class Common {
+
+    @Inject
+    protected
+    BundleContext bc;
+
+    protected OSGiHelper osgiHelper;
+    protected IPOJOHelper ipojoHelper;
+
+    protected boolean deployTestedBundle = true;
+
+    @Configuration
+    public Option[] config() throws IOException {
+        Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
+        root.setLevel(Level.INFO);
+
+        if (deployTestedBundle) {
+            return options(
+                    ipojoBundles(),
+                    junitBundles(),
+                    testedBundle(),
+                    systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("WARN")
+            );
+        } else {
+            return options(
+                    ipojoBundles(),
+                    junitBundles(),
+                    systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("WARN")
+            );
+        }
+    }
+
+    public static Option junitAndMockitoBundles() {
+        return new DefaultCompositeOption(
+                // Repository required to load harmcrest (OSGi-fied version).
+                repository("http://repository.springsource.com/maven/bundles/external").id(
+                        "com.springsource.repository.bundles.external"),
+
+                // Mockito without Hamcrest and Objenesis
+                mavenBundle("org.mockito", "mockito-core", "1.9.5"),
+
+                // Hamcrest with a version matching the range expected by Mockito
+                mavenBundle("org.hamcrest", "com.springsource.org.hamcrest.core", "1.1.0"),
+
+                // Objenesis with a version matching the range expected by Mockito
+                wrappedBundle(mavenBundle("org.objenesis", "objenesis", "1.2"))
+                        .exports("*;version=1.2"),
+
+                // The default JUnit bundle also exports Hamcrest, but with an (incorrect) version of
+                // 4.9 which does not match the Mockito import.
+                CoreOptions.junitBundles(),
+
+                /*
+                 * Felix has implicit boot delegation enabled by default. It conflicts with Mockito:
+                 * java.lang.LinkageError: loader constraint violation in interface itable initialization:
+                 * when resolving method "org.osgi.service.useradmin.User$$EnhancerByMockitoWithCGLIB$$dd2f81dc
+                 * .newInstance(Lorg/mockito/cglib/proxy/Callback;)Ljava/lang/Object;" the class loader
+                 * (instance of org/mockito/internal/creation/jmock/SearchingClassLoader) of the current class,
+                 * org/osgi/service/useradmin/User$$EnhancerByMockitoWithCGLIB$$dd2f81dc, and the class loader
+                 * (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) for interface
+                 * org/mockito/cglib/proxy/Factory have different Class objects for the type org/mockito/cglib/
+                 * proxy/Callback used in the signature
+                 *
+                 * So we disable the bootdelegation.
+                 */
+                frameworkProperty("felix.bootdelegation.implicit").value("false")
+        );
+    }
+
+
+    @Before
+    public void commonSetUp() {
+        osgiHelper = new OSGiHelper(bc);
+        ipojoHelper = new IPOJOHelper(bc);
+
+        // Dump OSGi Framework information
+        String vendor = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_VENDOR);
+        if (vendor == null) {
+            vendor = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_SYMBOLICNAME);
+        }
+        String version = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_VERSION);
+        System.out.println("OSGi Framework : " + vendor + " - " + version);
+    }
+
+    @After
+    public void commonTearDown() {
+        ipojoHelper.dispose();
+        osgiHelper.dispose();
+    }
+
+    public CompositeOption ipojoBundles() {
+        return new DefaultCompositeOption(
+                mavenBundle("org.apache.felix", "org.apache.felix.ipojo").versionAsInProject(),
+                mavenBundle("org.ow2.chameleon.testing", "osgi-helpers").versionAsInProject(),
+                // harmcrest-all
+                //mavenBundle("de.twentyeleven.skysail", "org.hamcrest.hamcrest-all-osgi").versionAsInProject(),
+                // configuration admin
+                mavenBundle("org.apache.felix",  "org.apache.felix.configadmin").versionAsInProject()
+        );
+    }
+
+    public Option testedBundle() throws MalformedURLException {
+        File out = new File("target/tested/bundle.jar");
+        if (out.exists()) {
+            return bundle(out.toURI().toURL().toExternalForm());
+        }
+
+        TinyBundle tested = TinyBundles.bundle();
+
+        // We look inside target/classes to find the class and resources
+        File classes = new File("target/classes");
+        Collection<File> files = FileUtils.listFilesAndDirs(classes, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
+        List<File> services = new ArrayList<File>();
+        for (File file : files) {
+            if (file.isDirectory()) {
+                // By convention we export of .services and .service package
+                if (file.getName().endsWith("services")  || file.getName().endsWith("service")) {
+                    services.add(file);
+                }
+            } else {
+                // We need to compute the path
+                String path = file.getAbsolutePath().substring(classes.getAbsolutePath().length() +1);
+                tested.add(path, file.toURI().toURL());
+                System.out.println(file.getName() + " added to " + path);
+            }
+        }
+
+        // Export the inherited package, components and strategies
+        String export = "org.apache.felix.ipojo.runtime.core.components.inherited";
+        export += ", org.apache.felix.ipojo.runtime.core.components";
+        export += ", org.apache.felix.ipojo.runtime.core.components.strategies";
+        // Inheritance.
+        export += ", org.apache.felix.ipojo.runtime.core.components.inheritance.a";
+        export += ", org.apache.felix.ipojo.runtime.core.components.inheritance.b";
+        for (File file : services) {
+            if (export.length() > 0) { export += ", "; }
+            String path = file.getAbsolutePath().substring(classes.getAbsolutePath().length() +1);
+            String packageName = path.replace('/', '.');
+            export += packageName;
+        }
+
+        System.out.println("Exported packages : " + export);
+
+        InputStream inputStream = tested
+                .set(Constants.BUNDLE_SYMBOLICNAME, "test.bundle")
+                .set(Constants.IMPORT_PACKAGE, "*")
+                .set(Constants.EXPORT_PACKAGE, export)
+                .build(IPOJOStrategy.withiPOJO(new File("src/main/resources")));
+
+        try {
+            org.apache.commons.io.FileUtils.copyInputStreamToFile(inputStream, out);
+            return bundle(out.toURI().toURL().toExternalForm());
+        } catch (MalformedURLException e) {
+            throw new RuntimeException("Cannot compute the url of the manipulated bundle");
+        } catch (IOException e) {
+            throw new RuntimeException("Cannot write of the manipulated bundle");
+        }
+    }
+
+    public void assertContains(String s, String[] arrays, String object) {
+        for (String suspect : arrays) {
+            if (object.equals(suspect)) {
+                return;
+            }
+        }
+        fail("Assertion failed : " + s);
+    }
+
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestCallbacks.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestCallbacks.java
new file mode 100644
index 0000000..55aa2d5
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestCallbacks.java
@@ -0,0 +1,173 @@
+/*

+ * 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.runtime.core;

+

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

+import org.apache.felix.ipojo.runtime.core.services.CheckService;

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+import org.junit.Test;

+

+import static junit.framework.Assert.assertEquals;

+import static org.junit.Assert.assertNotNull;

+

+public class TestCallbacks extends Common {

+

+    @Test

+    public void testWithPostRegistrationOnly() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance("PS-Callbacks-reg-only");

+        // Controller set to true.

+        osgiHelper.waitForService(FooService.class.getName(), null, 5000);

+        osgiHelper.waitForService(CheckService.class.getName(), null, 5000);

+

+        CheckService check = (CheckService) osgiHelper.getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+

+        Integer reg = (Integer) check.getProps().get("registered");

+        Integer unreg = (Integer) check.getProps().get("unregistered");

+        assertNotNull(reg);

+        assertNotNull(unreg);

+        assertEquals(new Integer(1), reg);

+        assertEquals(new Integer(0), unreg);

+

+        ci.stop();

+

+        reg = (Integer) check.getProps().get("registered");

+        unreg = (Integer) check.getProps().get("unregistered");

+        assertNotNull(reg);

+        assertNotNull(unreg);

+        assertEquals(new Integer(1), reg);

+        assertEquals(new Integer(0), unreg);

+    }

+

+    @Test

+    public void testWithBoth() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance("PS-Callbacks-both");

+        // Controller set to true.

+        osgiHelper.waitForService(FooService.class.getName(), null, 5000);

+        osgiHelper.waitForService(CheckService.class.getName(), null, 5000);

+

+        CheckService check = (CheckService) osgiHelper.getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+

+        Integer reg = (Integer) check.getProps().get("registered");

+        Integer unreg = (Integer) check.getProps().get("unregistered");

+        assertNotNull(reg);

+        assertNotNull(unreg);

+        assertEquals(new Integer(1), reg);

+        assertEquals(new Integer(0), unreg);

+

+        ci.stop();

+

+        reg = (Integer) check.getProps().get("registered");

+        unreg = (Integer) check.getProps().get("unregistered");

+        assertNotNull(reg);

+        assertNotNull(unreg);

+        assertEquals(new Integer(1), reg);

+        assertEquals(new Integer(1), unreg);

+    }

+

+    @Test

+    public void testWithPostUnregistrationOnly() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance("PS-Callbacks-unreg-only");

+        // Controller set to true.

+        osgiHelper.waitForService(FooService.class.getName(), null, 5000);

+        osgiHelper.waitForService(CheckService.class.getName(), null, 5000);

+

+        CheckService check = (CheckService) osgiHelper.getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+

+        Integer reg = (Integer) check.getProps().get("registered");

+        Integer unreg = (Integer) check.getProps().get("unregistered");

+        assertNotNull(reg);

+        assertNotNull(unreg);

+        assertEquals(new Integer(0), reg);

+        assertEquals(new Integer(0), unreg);

+

+        ci.stop();

+

+        reg = (Integer) check.getProps().get("registered");

+        unreg = (Integer) check.getProps().get("unregistered");

+        assertNotNull(reg);

+        assertNotNull(unreg);

+        assertEquals(new Integer(0), reg);

+        assertEquals(new Integer(1), unreg);

+    }

+

+    @Test

+    public void testWithTwoPairsOfCallbacks() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance("PS-Callbacks-both-2");

+        // Controller set to true.

+        osgiHelper.waitForService(FooService.class.getName(), null, 5000);

+        osgiHelper.waitForService(CheckService.class.getName(), null, 5000);

+

+        CheckService check = (CheckService) osgiHelper.getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+

+        Integer reg = (Integer) check.getProps().get("registered");

+        Integer unreg = (Integer) check.getProps().get("unregistered");

+        Integer reg2 = (Integer) check.getProps().get("registered2");

+        Integer unreg2 = (Integer) check.getProps().get("unregistered2");

+        assertNotNull(reg);

+        assertNotNull(unreg);

+        assertNotNull(reg2);

+        assertNotNull(unreg2);

+        assertEquals(new Integer(1), reg);

+        assertEquals(new Integer(0), unreg);

+        assertEquals(new Integer(1), reg2);

+        assertEquals(new Integer(0), unreg2);

+

+        ci.stop();

+

+        reg = (Integer) check.getProps().get("registered");

+        unreg = (Integer) check.getProps().get("unregistered");

+        reg2 = (Integer) check.getProps().get("registered2");

+        unreg2 = (Integer) check.getProps().get("unregistered2");

+        assertNotNull(reg2);

+        assertNotNull(unreg2);

+        assertEquals(new Integer(1), reg);

+        assertEquals(new Integer(1), unreg);

+        assertEquals(new Integer(1), reg2);

+        assertEquals(new Integer(1), unreg2);

+    }

+

+    @Test

+    public void testWithOnePairForTwoService() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance("PS-Callbacks-both-1");

+        // Controller set to true.

+        osgiHelper.waitForService(FooService.class.getName(), null, 5000);

+        osgiHelper.waitForService(CheckService.class.getName(), null, 5000);

+

+        CheckService check = (CheckService) osgiHelper.getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+

+        Integer reg = (Integer) check.getProps().get("registered");

+        Integer unreg = (Integer) check.getProps().get("unregistered");

+        assertNotNull(reg);

+        assertNotNull(unreg);

+        assertEquals(new Integer(2), reg);

+        assertEquals(new Integer(0), unreg);

+

+        ci.stop();

+

+        reg = (Integer) check.getProps().get("registered");

+        unreg = (Integer) check.getProps().get("unregistered");

+        assertEquals(new Integer(2), reg);

+        assertEquals(new Integer(2), unreg);

+    }

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestClass.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestClass.java
new file mode 100644
index 0000000..d2f80c7
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestClass.java
@@ -0,0 +1,93 @@
+/* 

+ * 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.runtime.core;

+

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

+import org.apache.felix.ipojo.runtime.core.components.inherited.ProcessParentImplementation;

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+import org.junit.Before;

+import org.junit.Test;

+import org.osgi.framework.ServiceReference;

+

+import static org.junit.Assert.assertNotNull;

+

+public class TestClass extends Common {

+

+    private Factory pi4, pi5, pi6, pi7;

+

+    @Before

+    public void setUp() {

+        pi4 = ipojoHelper.getFactory("PS-PI4");

+        pi5 = ipojoHelper.getFactory("PS-PI5");

+        pi6 = ipojoHelper.getFactory("PS-PI6");

+        pi7 = ipojoHelper.getFactory("PS-PI7");

+    }

+

+    @Test

+    public void testIP4() {

+        ipojoHelper.createComponentInstance(pi4.getName(), "ci");

+

+        ServiceReference ref1 = ipojoHelper.getServiceReferenceByName("org.apache.felix.ipojo.runtime.core.components.inherited.ProcessParentImplementation", "ci");

+        assertNotNull("Check itself", ref1);

+

+        ProcessParentImplementation itself = (ProcessParentImplementation) osgiHelper.getServiceObject(ref1);

+

+        itself.processChild();

+    }

+

+    @Test

+    public void testIP5() {

+        ipojoHelper.createComponentInstance(pi5.getName(), "ci");

+

+        ServiceReference ref1 = ipojoHelper.getServiceReferenceByName("org.apache.felix.ipojo.runtime.core.components.inherited.ProcessParentImplementation", "ci");

+        assertNotNull("Check parent", ref1);

+

+        ProcessParentImplementation itself = (ProcessParentImplementation) osgiHelper.getServiceObject(ref1);

+

+        itself.processChild();

+

+    }

+

+    @Test

+    public void testIP6() {

+        ipojoHelper.createComponentInstance(pi6.getName(), "ci");

+

+        ServiceReference ref1 = ipojoHelper.getServiceReferenceByName("org.apache.felix.ipojo.runtime.core.components.inherited.ProcessParentImplementation", "ci");

+        assertNotNull("Check parent-parent", ref1);

+

+        ProcessParentImplementation itself = (ProcessParentImplementation) osgiHelper.getServiceObject(ref1);

+

+        itself.processChild();

+    }

+

+    @Test

+    public void testIP7() {

+        ipojoHelper.createComponentInstance(pi7.getName(), "ci");

+

+        ServiceReference ref1 = ipojoHelper.getServiceReferenceByName("org.apache.felix.ipojo.runtime.core.components.inherited.ProcessParentImplementation", "ci");

+        assertNotNull("Check parent-parent", ref1);

+

+        ProcessParentImplementation itself = (ProcessParentImplementation) osgiHelper.getServiceObject(ref1);

+

+        itself.processChild();

+

+        ServiceReference ref5 = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), "ci");

+        assertNotNull("Check FS", ref5);

+    }

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestDynamicProps.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestDynamicProps.java
new file mode 100644
index 0000000..36f3090
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestDynamicProps.java
@@ -0,0 +1,294 @@
+/* 

+ * 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.runtime.core;

+

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+import org.junit.Before;

+import org.junit.Test;

+import org.osgi.framework.ServiceReference;

+

+import java.util.Properties;

+

+import static junit.framework.Assert.assertEquals;

+import static org.junit.Assert.*;

+

+public class TestDynamicProps extends Common {

+

+    @Before

+    public void setUp() {

+        String type = "PS-FooProviderType-Dyn";

+        ipojoHelper.createComponentInstance(type, "FooProvider-1");

+

+        Properties p2 = new Properties();

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

+        p2.put("int", new Integer(4));

+        p2.put("boolean", new Boolean(false));

+        p2.put("string", new String("bar"));

+        p2.put("strAProp", new String[]{"bar", "foo"});

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

+        ipojoHelper.createComponentInstance(type, p2);

+

+        String type2 = "PS-FooProviderType-Dyn2";

+        Properties p3 = new Properties();

+        p3.put("instance.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]);

+        ipojoHelper.createComponentInstance(type2, p3);

+

+        Properties p4 = new Properties();

+        p4.put("instance.name", "FooProvider-4");

+        ipojoHelper.createComponentInstance(type2, p4);

+

+    }

+

+    @Test

+    public void testProperties1() {

+        ServiceReference sr = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-1");

+        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 (1)", intProp, new Integer(2));

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

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

+        assertNotNull("Check strAProp not nullity (1)", 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 (1)");

+            }

+        }

+        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 (1)");

+            }

+        }

+

+        // Invoke

+        FooService fs = (FooService) osgiHelper.getServiceObject(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 (2)", intProp, new Integer(3));

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

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

+        assertNotNull("Check strAProp not nullity (2)", 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 (2)");

+            }

+        }

+        assertNotNull("Check intAProp not nullity (2)", 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 (2)");

+            }

+        }

+

+        fs = null;

+    }

+

+    @Test

+    public void testProperties2() {

+        ServiceReference sr = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-2");

+        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(4));

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

+        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");

+            }

+        }

+

+        // Invoke

+        FooService fs = (FooService) osgiHelper.getServiceObject(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(3));

+        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[]{3, 2, 1};

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

+            if (intAProp[i] != v2[i]) {

+                fail("Check the intAProp Equality");

+            }

+        }

+

+        fs = null;

+    }

+

+    @Test

+    public void testProperties3() {

+        ServiceReference sr = ipojoHelper.getServiceReferenceByName(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");

+            }

+        }

+

+        // Invoke

+        FooService fs = (FooService) osgiHelper.getServiceObject(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);

+

+        fs = null;

+    }

+

+    @Test

+    public void testProperties4() {

+        ServiceReference sr = ipojoHelper.getServiceReferenceByName(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) osgiHelper.getServiceObject(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;

+    }

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestDynamicPropsReconfiguration.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestDynamicPropsReconfiguration.java
new file mode 100644
index 0000000..c0f50b4
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestDynamicPropsReconfiguration.java
@@ -0,0 +1,770 @@
+/* 

+ * 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.runtime.core;

+

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

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

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+import org.junit.Before;

+import org.junit.Test;

+import org.osgi.framework.ServiceReference;

+import org.osgi.service.cm.ConfigurationException;

+import org.osgi.service.cm.ManagedServiceFactory;

+

+import java.util.Properties;

+

+import static junit.framework.Assert.assertEquals;

+import static org.junit.Assert.*;

+

+public class TestDynamicPropsReconfiguration extends Common {

+    ComponentInstance fooProvider3, fooProvider4;

+

+

+    @Before

+    public void setUp() {

+        String type2 = "PS-FooProviderType-Dyn2";

+        Properties p3 = new Properties();

+        p3.put("instance.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 = ipojoHelper.createComponentInstance(type2, p3);

+

+        fooProvider4 = ipojoHelper.createComponentInstance(type2, "FooProvider-4");

+    }

+

+    @Test

+    public void testFactoryReconf() {

+        ServiceReference sr = ipojoHelper.getServiceReferenceByName(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 = ipojoHelper.getServiceReferenceByName(Factory.class.getName(), "PS-FooProviderType-Dyn2");

+        Factory fact = (Factory) osgiHelper.getServiceObject(fact_ref);

+        Properties 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 = ipojoHelper.getServiceReferenceByName(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) osgiHelper.getServiceObject(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 = ipojoHelper.getServiceReferenceByName(Factory.class.getName(), "PS-FooProviderType-Dyn2");

+        fact = (Factory) osgiHelper.getServiceObject(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 = ipojoHelper.getServiceReferenceByName(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;

+        fs = null;

+    }

+

+    @Test

+    public void testFactoryReconfString() {

+        ServiceReference sr = ipojoHelper.getServiceReferenceByName(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 = ipojoHelper.getServiceReferenceByName(Factory.class.getName(), "PS-FooProviderType-Dyn2");

+        Factory fact = (Factory) osgiHelper.getServiceObject(fact_ref);

+        Properties p3 = new Properties();

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

+        p3.put("int", "1");

+        p3.put("boolean", "true");

+        p3.put("string", "foo");

+        p3.put("strAProp", "{foo, bar, baz}");

+        p3.put("intAProp", "{1, 2, 3}");

+        try {

+            fact.reconfigure(p3);

+        } catch (Exception e) {

+            fail("Unable to reconfigure the instance with : " + p3);

+        }

+

+        sr = ipojoHelper.getServiceReferenceByName(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) osgiHelper.getServiceObject(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 = ipojoHelper.getServiceReferenceByName(Factory.class.getName(), "PS-FooProviderType-Dyn2");

+        fact = (Factory) osgiHelper.getServiceObject(fact_ref);

+        p3 = new Properties();

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

+        p3.put("int", "1");

+        p3.put("boolean", "true");

+        p3.put("string", "foo");

+        p3.put("strAProp", "{foo, bar, baz}");

+        p3.put("intAProp", "{ 1, 2, 3}");

+        try {

+            fact.reconfigure(p3);

+        } catch (Exception e) {

+            fail("Unable to reconfigure the instance with : " + p3);

+        }

+

+        sr = ipojoHelper.getServiceReferenceByName(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;

+        fs = null;

+    }

+

+    @Test

+    public void testMSFReconf() {

+        ServiceReference sr = ipojoHelper.getServiceReferenceByName(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 = ipojoHelper.getServiceReferenceByName(ManagedServiceFactory.class.getName(), "PS-FooProviderType-Dyn2");

+        ManagedServiceFactory fact = (ManagedServiceFactory) osgiHelper.getServiceObject(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 = ipojoHelper.getServiceReferenceByName(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) osgiHelper.getServiceObject(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 = ipojoHelper.getServiceReferenceByName(ManagedServiceFactory.class.getName(), "PS-FooProviderType-Dyn2");

+        fact = (ManagedServiceFactory) osgiHelper.getServiceObject(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 = ipojoHelper.getServiceReferenceByName(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;

+        fs = null;

+    }

+

+    @Test

+    public void testMSFReconfString() {

+        ServiceReference sr = ipojoHelper.getServiceReferenceByName(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 = ipojoHelper.getServiceReferenceByName(ManagedServiceFactory.class.getName(), "PS-FooProviderType-Dyn2");

+        ManagedServiceFactory fact = (ManagedServiceFactory) osgiHelper.getServiceObject(fact_ref);

+        Properties p3 = new Properties();

+        p3.put("int", "1");

+        p3.put("boolean", "true");

+        p3.put("string", "foo");

+        p3.put("strAProp", "{foo, bar, baz}");

+        p3.put("intAProp", "{ 1, 2, 3}");

+        try {

+            fact.updated("FooProvider-3", p3);

+        } catch (ConfigurationException e) {

+            fail("Unable to reconfigure the instance with : " + p3);

+        }

+

+        sr = ipojoHelper.getServiceReferenceByName(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) osgiHelper.getServiceObject(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 = ipojoHelper.getServiceReferenceByName(ManagedServiceFactory.class.getName(), "PS-FooProviderType-Dyn2");

+        fact = (ManagedServiceFactory) osgiHelper.getServiceObject(fact_ref);

+        p3 = new Properties();

+        p3.put("int", "1");

+        p3.put("boolean", "true");

+        p3.put("string", "foo");

+        p3.put("strAProp", "{foo, bar, baz}");

+        p3.put("intAProp", "{ 1, 2, 3}");

+        try {

+            fact.updated("FooProvider-3", p3);

+        } catch (ConfigurationException e) {

+            fail("Unable to reconfigure the instance with : " + p3);

+        }

+

+        sr = ipojoHelper.getServiceReferenceByName(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;

+        fs = null;

+    }

+

+    @Test

+    public void testFactoryReconfNoValue() {

+        ServiceReference sr = ipojoHelper.getServiceReferenceByName(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 = ipojoHelper.getServiceReferenceByName(Factory.class.getName(), "PS-FooProviderType-Dyn2");

+        Factory fact = (Factory) osgiHelper.getServiceObject(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 = ipojoHelper.getServiceReferenceByName(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) osgiHelper.getServiceObject(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 = ipojoHelper.getServiceReferenceByName(Factory.class.getName(), "PS-FooProviderType-Dyn2");

+        fact = (Factory) osgiHelper.getServiceObject(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 = ipojoHelper.getServiceReferenceByName(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;

+        fs = null;

+    }

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestExposition.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestExposition.java
new file mode 100644
index 0000000..e02ee28
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestExposition.java
@@ -0,0 +1,168 @@
+/* 

+ * 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.runtime.core;

+

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

+import org.apache.felix.ipojo.runtime.core.services.BarService;

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+import org.junit.Before;

+import org.junit.Test;

+import org.osgi.framework.ServiceReference;

+

+import static org.junit.Assert.*;

+

+public class TestExposition extends Common {

+

+    private ComponentInstance fooProviderSimple;

+    private ComponentInstance fooProviderItf;

+    private ComponentInstance fooBarProvider;

+    private ComponentInstance fooBarProvider2;

+    private ComponentInstance fooBarProvider3;

+

+    @Before

+    public void setUp() {

+        fooProviderSimple = ipojoHelper.createComponentInstance("PS-FooProviderType-1", "fooProviderSimple");

+

+        fooProviderItf = ipojoHelper.createComponentInstance("PS-FooProviderType-itf", "fooProviderItf");

+

+        fooBarProvider = ipojoHelper.createComponentInstance("PS-FooBarProviderType-1", "fooProviderItfs");

+

+        fooBarProvider2 = ipojoHelper.createComponentInstance("PS-FooBarProviderType-2", "fooProviderItfs2");

+

+        fooBarProvider3 = ipojoHelper.createComponentInstance("PS-FooBarProviderType-3", "fooProviderItfs3");

+

+        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);

+

+    }

+

+

+    @Test

+    public void testSimpleExposition() {

+        ServiceReference ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), fooProviderSimple.getInstanceName());

+        assertNotNull("Check the availability of the FS from " + fooProviderSimple.getInstanceName(), ref);

+        FooService fs = (FooService) osgiHelper.getServiceObject(ref);

+        assertTrue("Check fs invocation", fs.foo());

+        fs = null;

+        fooProviderSimple.stop();

+        ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), fooProviderSimple.getInstanceName());

+        assertNull("Check the absence of the FS from " + fooProviderSimple.getInstanceName(), ref);

+

+    }

+

+    @Test

+    public void testItfExposition() {

+        ServiceReference ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), fooProviderItf.getInstanceName());

+        assertNotNull("Check the availability of the FS from " + fooProviderItf.getInstanceName(), ref);

+        FooService fs = (FooService) osgiHelper.getServiceObject(ref);

+        assertTrue("Check fs invocation", fs.foo());

+        fs = null;

+        fooProviderItf.stop();

+

+        ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), fooProviderItf.getInstanceName());

+        assertNull("Check the absence of the FS from " + fooProviderItf.getInstanceName(), ref);

+    }

+

+    @Test

+    public void testItfsExposition() {

+        ServiceReference refFoo = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), fooBarProvider.getInstanceName());

+        assertNotNull("Check the availability of the FS from " + fooBarProvider.getInstanceName(), refFoo);

+        ServiceReference refBar = ipojoHelper.getServiceReferenceByName(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) osgiHelper.getServiceObject(refFoo);

+        assertTrue("Check fs invocation", fs.foo());

+        fs = null;

+

+        BarService bs = (BarService) osgiHelper.getServiceObject(refBar);

+        assertTrue("Check bs invocation", bs.bar());

+        bs = null;

+

+        fooBarProvider.stop();

+

+        refFoo = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), fooBarProvider.getInstanceName());

+        refBar = ipojoHelper.getServiceReferenceByName(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);

+    }

+

+    @Test

+    public void testItfsExposition2() {

+        ServiceReference refFoo = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), fooBarProvider2.getInstanceName());

+        assertNotNull("Check the availability of the FS from " + fooBarProvider2.getInstanceName(), refFoo);

+        ServiceReference refBar = ipojoHelper.getServiceReferenceByName(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) osgiHelper.getServiceObject(refFoo);

+        assertTrue("Check fs invocation", fs.foo());

+        fs = null;

+

+        BarService bs = (BarService) osgiHelper.getServiceObject(refBar);

+        assertTrue("Check bs invocation", bs.bar());

+        bs = null;

+

+        fooBarProvider2.stop();

+

+        refFoo = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), fooBarProvider2.getInstanceName());

+        refBar = ipojoHelper.getServiceReferenceByName(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);

+    }

+

+    @Test

+    public void testItfsExposition3() {

+        ServiceReference refFoo = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), fooBarProvider3.getInstanceName());

+        assertNotNull("Check the availability of the FS from " + fooBarProvider3.getInstanceName(), refFoo);

+        ServiceReference refBar = ipojoHelper.getServiceReferenceByName(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) osgiHelper.getServiceObject(refFoo);

+        assertTrue("Check fs invocation", fs.foo());

+        fs = null;

+

+        BarService bs = (BarService) osgiHelper.getServiceObject(refBar);

+        assertTrue("Check bs invocation", bs.bar());

+        bs = null;

+

+        // 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 = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), fooBarProvider3.getInstanceName());

+        refBar = ipojoHelper.getServiceReferenceByName(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);

+    }

+

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestInheritedClasses.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestInheritedClasses.java
new file mode 100644
index 0000000..0196273
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestInheritedClasses.java
@@ -0,0 +1,204 @@
+/* 

+ * 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.runtime.core;

+

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

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

+import org.apache.felix.ipojo.runtime.core.services.*;

+import org.junit.Before;

+import org.junit.Test;

+import org.osgi.framework.ServiceReference;

+

+import static junit.framework.Assert.assertEquals;

+import static org.junit.Assert.assertNotNull;

+import static org.junit.Assert.assertTrue;

+

+public class TestInheritedClasses extends Common {

+

+    private Factory pi1, pi11, pi12, pi2, pi21, pi3;

+

+    @Before

+    public void setUp() {

+        pi1 = ipojoHelper.getFactory("PS-PI1");

+        pi11 = ipojoHelper.getFactory("PS-PI1-1");

+        pi12 = ipojoHelper.getFactory("PS-PI1-2");

+

+        pi2 = ipojoHelper.getFactory("PS-PI2");

+        pi21 = ipojoHelper.getFactory("PS-PI2-1");

+

+        pi3 = ipojoHelper.getFactory("PS-PI3");

+    }

+

+    private boolean contains(String[] arr, String txt) {

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

+            if (arr[i].equals(txt)) {

+                return true;

+            }

+        }

+        return false;

+    }

+

+    @Test

+    public void testPI1Factory() {

+        String[] specs = pi1.getComponentDescription().getprovidedServiceSpecification();

+        assertEquals("Check provides count", specs.length, 4);

+        assertTrue("Check Child", contains(specs, ChildInterface.class.getName()));

+        assertTrue("Check Parent1", contains(specs, ParentInterface1.class.getName()));

+        assertTrue("Check Parent2", contains(specs, ParentInterface2.class.getName()));

+        assertTrue("Check ParentParent", contains(specs, ParentParentInterface.class.getName()));

+    }

+

+    @Test

+    public void testPI11Factory() {

+        String[] specs = pi11.getComponentDescription().getprovidedServiceSpecification();

+        assertEquals("Check provides count", specs.length, 1);

+        assertTrue("Check ParentParent", contains(specs, ParentParentInterface.class.getName()));

+    }

+

+    @Test

+    public void testPI12Factory() {

+        String[] specs = pi12.getComponentDescription().getprovidedServiceSpecification();

+        assertEquals("Check provides count", specs.length, 2);

+        assertTrue("Check Parent2", contains(specs, ParentInterface2.class.getName()));

+        assertTrue("Check ParentParent", contains(specs, ParentParentInterface.class.getName()));

+    }

+

+    @Test

+    public void testPI2Factory() {

+        String[] specs = pi2.getComponentDescription().getprovidedServiceSpecification();

+        assertEquals("Check provides count (" + specs.length + ")", specs.length, 4);

+        assertTrue("Check Child", contains(specs, ChildInterface.class.getName()));

+        assertTrue("Check Parent1", contains(specs, ParentInterface1.class.getName()));

+        assertTrue("Check Parent2", contains(specs, ParentInterface2.class.getName()));

+        assertTrue("Check ParentParent", contains(specs, ParentParentInterface.class.getName()));

+    }

+

+    @Test

+    public void testPI21Factory() {

+        String[] specs = pi21.getComponentDescription().getprovidedServiceSpecification();

+        assertEquals("Check provides count", specs.length, 1);

+        assertTrue("Check ParentParent", contains(specs, ParentParentInterface.class.getName()));

+    }

+

+    @Test

+    public void testPI3Factory() {

+        String[] specs = pi3.getComponentDescription().getprovidedServiceSpecification();

+        assertEquals("Check provides count", specs.length, 5);

+        assertTrue("Check Child", contains(specs, ChildInterface.class.getName()));

+        assertTrue("Check Parent1", contains(specs, ParentInterface1.class.getName()));

+        assertTrue("Check Parent2", contains(specs, ParentInterface2.class.getName()));

+        assertTrue("Check ParentParent", contains(specs, ParentParentInterface.class.getName()));

+        assertTrue("Check FS", contains(specs, FooService.class.getName()));

+    }

+

+    @Test

+    public void testIP1() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance(pi1.getName(), "ci");

+

+        ServiceReference ref1 = ipojoHelper.getServiceReferenceByName(ChildInterface.class.getName(), "ci");

+        assertNotNull("Check Child", ref1);

+

+        ServiceReference ref2 = ipojoHelper.getServiceReferenceByName(ParentInterface1.class.getName(), "ci");

+        assertNotNull("Check Parent1", ref2);

+

+        ServiceReference ref3 = ipojoHelper.getServiceReferenceByName(ParentInterface2.class.getName(), "ci");

+        assertNotNull("Check Parent2", ref3);

+

+        ServiceReference ref4 = ipojoHelper.getServiceReferenceByName(ParentParentInterface.class.getName(), "ci");

+        assertNotNull("Check PP", ref4);

+

+        ci.dispose();

+    }

+

+    @Test

+    public void testIP11() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance(pi11.getName(), "ci");

+

+        ServiceReference ref4 = ipojoHelper.getServiceReferenceByName(ParentParentInterface.class.getName(), "ci");

+        assertNotNull("Check PP", ref4);

+

+        ci.dispose();

+    }

+

+    @Test

+    public void testIP12() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance(pi12.getName(), "ci");

+

+        ServiceReference ref3 = ipojoHelper.getServiceReferenceByName(ParentInterface2.class.getName(), "ci");

+        assertNotNull("Check Parent2", ref3);

+

+        ServiceReference ref4 = ipojoHelper.getServiceReferenceByName(ParentParentInterface.class.getName(), "ci");

+        assertNotNull("Check PP", ref4);

+

+        ci.dispose();

+    }

+

+    @Test

+    public void testIP2() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance(pi2.getName(), "ci");

+

+        ServiceReference ref1 = ipojoHelper.getServiceReferenceByName(ChildInterface.class.getName(), "ci");

+        assertNotNull("Check Child", ref1);

+

+        ServiceReference ref2 = ipojoHelper.getServiceReferenceByName(ParentInterface1.class.getName(), "ci");

+        assertNotNull("Check Parent1", ref2);

+

+        ServiceReference ref3 = ipojoHelper.getServiceReferenceByName(ParentInterface2.class.getName(), "ci");

+        assertNotNull("Check Parent2", ref3);

+

+        ServiceReference ref4 = ipojoHelper.getServiceReferenceByName(ParentParentInterface.class.getName(), "ci");

+        assertNotNull("Check PP", ref4);

+

+        ci.dispose();

+    }

+

+    @Test

+    public void testIP21() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance(pi21.getName(), "ci");

+

+        ServiceReference ref4 = ipojoHelper.getServiceReferenceByName(ParentParentInterface.class.getName(), "ci");

+        assertNotNull("Check PP", ref4);

+

+        ci.dispose();

+    }

+

+    @Test

+    public void testIP3() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance(pi3.getName(), "ci");

+

+        ServiceReference ref1 = ipojoHelper.getServiceReferenceByName(ChildInterface.class.getName(), "ci");

+        assertNotNull("Check Child", ref1);

+

+        ServiceReference ref2 = ipojoHelper.getServiceReferenceByName(ParentInterface1.class.getName(), "ci");

+        assertNotNull("Check Parent1", ref2);

+

+        ServiceReference ref3 = ipojoHelper.getServiceReferenceByName(ParentInterface2.class.getName(), "ci");

+        assertNotNull("Check Parent2", ref3);

+

+        ServiceReference ref4 = ipojoHelper.getServiceReferenceByName(ParentParentInterface.class.getName(), "ci");

+        assertNotNull("Check PP", ref4);

+

+        ServiceReference ref5 = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), "ci");

+        assertNotNull("Check FS", ref5);

+

+        ci.dispose();

+    }

+

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestNullCheck.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestNullCheck.java
new file mode 100644
index 0000000..8df81f5
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestNullCheck.java
@@ -0,0 +1,77 @@
+/* 

+ * 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.runtime.core;

+

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

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+import org.junit.Test;

+import org.osgi.framework.ServiceReference;

+

+import static org.junit.Assert.assertNotNull;

+import static org.junit.Assert.assertNull;

+import static org.junit.Assert.assertTrue;

+

+public class TestNullCheck extends Common {

+

+    @Test

+    public void testNull() {

+

+        String factName = "PS-Null";

+        String compName = "NullCheck";

+        ServiceReference ref = null;

+

+        // Check that no Foo Service are available

+        ref = osgiHelper.getServiceReference(FooService.class.getName());

+        assertNull("FS already available", ref);

+

+        // Get the factory to create a component instance

+        Factory fact = ipojoHelper.getFactory(factName);

+        assertNotNull("Cannot find the factory FooProvider-1", fact);

+

+        // Don't give any configuration so, properties are null.

+        ipojoHelper.createComponentInstance(factName, compName);

+

+        // Get a FooService provider

+        ref = osgiHelper.getServiceReference(FooService.class.getName(), "(" + "instance.name" + "=" + compName + ")");

+

+        assertNotNull("FS not available", ref);

+

+        // Check service properties

+        assertNull(ref.getProperty("prop1"));

+        assertNotNull(ref.getProperty("prop2"));

+

+        // Test foo invocation

+        FooService fs = (FooService) osgiHelper.getServiceObject(ref);

+        assertTrue("FooService invocation failed", fs.foo());

+

+        ref = osgiHelper.getServiceReference(FooService.class.getName(), "(" + "instance.name" + "=" + compName + ")");

+        // Check service properties

+        assertNotNull(ref.getProperty("prop1"));

+        assertNull(ref.getProperty("prop2"));

+

+        ipojoHelper.dispose();

+

+        // Check that there is no more FooService

+        ref = osgiHelper.getServiceReference(FooService.class.getName(), null);

+

+        assertNull("FS available, but component instance stopped", ref);

+

+    }

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestOSGiProperties.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestOSGiProperties.java
new file mode 100644
index 0000000..0ae81d1
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestOSGiProperties.java
@@ -0,0 +1,85 @@
+/* 

+ * 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.runtime.core;

+

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

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+import org.junit.Test;

+import org.osgi.framework.Constants;

+import org.osgi.framework.ServiceReference;

+

+import java.util.Dictionary;

+import java.util.Properties;

+

+import static junit.framework.Assert.assertEquals;

+import static org.junit.Assert.*;

+

+public class TestOSGiProperties extends Common {

+

+    @Test

+    public void testOSGiProperties() {

+        String factName = "PS-FooProviderType-1";

+        String compName = "FooProvider-1";

+        ServiceReference ref = null;

+

+        // Check that no Foo Service are available

+        ref = osgiHelper.getServiceReference(FooService.class.getName());

+

+        assertNull("FS already available", ref);

+

+        // Get the factory to create a component instance

+        Factory fact = ipojoHelper.getFactory(factName);

+        assertNotNull("Cannot find the factory FooProvider-1", fact);

+

+        Dictionary conf = new Properties();

+        conf.put(Constants.SERVICE_DESCRIPTION, "description");

+        conf.put(Constants.SERVICE_RANKING, "10");

+        conf.put(Constants.SERVICE_VENDOR, "ASF");

+        conf.put(Constants.SERVICE_PID, "my.pid");

+

+        ipojoHelper.createComponentInstance(factName, compName, conf);

+

+        // Get a FooService provider

+        ref = osgiHelper.getServiceReference(FooService.class.getName(), "(" + "instance.name" + "=" + compName + ")");

+

+        assertNotNull("FS not available", ref);

+

+        // Check properties

+        assertEquals("description", ref.getProperty(Constants.SERVICE_DESCRIPTION));

+        assertEquals(new Integer(10), ref.getProperty(Constants.SERVICE_RANKING));

+        assertEquals("ASF", ref.getProperty(Constants.SERVICE_VENDOR));

+        assertEquals("my.pid", ref.getProperty(Constants.SERVICE_PID));

+

+

+        // Test foo invocation

+        FooService fs = (FooService) osgiHelper.getServiceObject(ref);

+        assertTrue("FooService invocation failed", fs.foo());

+

+        ipojoHelper.dispose();

+

+

+        // Check that there is no more FooService

+        ref = osgiHelper.getServiceReference(FooService.class.getName(), null);

+

+

+        assertNull("FS available, but component instance stopped", ref);

+

+    }

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestPropertiesInAnonymousClass.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestPropertiesInAnonymousClass.java
new file mode 100644
index 0000000..0a3d3a0
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestPropertiesInAnonymousClass.java
@@ -0,0 +1,147 @@
+package org.apache.felix.ipojo.runtime.core;
+
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.ServiceReference;
+
+import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.*;
+
+public class TestPropertiesInAnonymousClass extends Common {
+
+    @Before
+    public void setUp() {
+        String type = "PS-FooProviderTypeAnonymous-Dyn";
+        ipojoHelper.createComponentInstance(type, "FooProviderAno-1");
+
+    }
+
+
+    @Test
+    public void testRunnable() {
+        ServiceReference sr = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), "FooProviderAno-1");
+        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 (1)", intProp, new Integer(2));
+        assertEquals("Check longProp equality (1)", boolProp, new Boolean(false));
+        assertEquals("Check strProp equality (1)", strProp, new String("foo"));
+        assertNotNull("Check strAProp not nullity (1)", 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 (1)");
+            }
+        }
+        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 (1)");
+            }
+        }
+
+        // Invoke
+        FooService fs = (FooService) osgiHelper.getServiceObject(sr);
+        assertTrue("invoke fs", fs.foo());
+
+        sr = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), "FooProviderAno-1");
+        // 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 (2)", intProp, new Integer(3));
+        assertEquals("Check longProp equality (2)", boolProp, new Boolean(true));
+        assertEquals("Check strProp equality (2)", strProp, new String("bar"));
+        assertNotNull("Check strAProp not nullity (2)", 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 (2)");
+            }
+        }
+        assertNotNull("Check intAProp not nullity (2)", 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 (2)");
+            }
+        }
+
+        fs = null;
+    }
+
+    @Test
+    public void testSwingWorker() {
+        ServiceReference sr = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), "FooProviderAno-1");
+        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 (1)", intProp, new Integer(2));
+        assertEquals("Check longProp equality (1)", boolProp, new Boolean(false));
+        assertEquals("Check strProp equality (1)", strProp, new String("foo"));
+        assertNotNull("Check strAProp not nullity (1)", 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 (1)");
+            }
+        }
+        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 (1)");
+            }
+        }
+
+        // Invoke
+        FooService fs = (FooService) osgiHelper.getServiceObject(sr);
+        assertTrue("invoke fs", fs.getBoolean());
+
+        sr = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), "FooProviderAno-1");
+        // 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 (2)", intProp, new Integer(3));
+        assertEquals("Check longProp equality (2)", boolProp, new Boolean(true));
+        assertEquals("Check strProp equality (2)", strProp, new String("bar"));
+        assertNotNull("Check strAProp not nullity (2)", 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 (2)");
+            }
+        }
+        assertNotNull("Check intAProp not nullity (2)", 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 (2)");
+            }
+        }
+
+        fs = null;
+    }
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestProvidedServiceArchitecture.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestProvidedServiceArchitecture.java
new file mode 100644
index 0000000..c236d21
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestProvidedServiceArchitecture.java
@@ -0,0 +1,232 @@
+/* 

+ * 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.runtime.core;

+

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

+import org.apache.felix.ipojo.architecture.Architecture;

+import org.apache.felix.ipojo.architecture.HandlerDescription;

+import org.apache.felix.ipojo.architecture.InstanceDescription;

+import org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceDescription;

+import org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandlerDescription;

+import org.apache.felix.ipojo.runtime.core.services.BarService;

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+import org.junit.Test;

+import org.osgi.framework.ServiceReference;

+

+import java.util.Properties;

+

+import static junit.framework.Assert.assertEquals;

+import static org.junit.Assert.assertNotNull;

+

+public class TestProvidedServiceArchitecture extends Common {

+

+    @Test

+    public void testExposition() {

+        String factName = "PS-FooProviderType-1";

+        String compName = "FooProvider-1";

+

+        // Get the factory to create a component instance

+        Factory fact = ipojoHelper.getFactory(factName);

+        assertNotNull("Cannot find the factory FooProvider-1", fact);

+

+        ipojoHelper.createComponentInstance(factName, compName);

+

+        ServiceReference arch_ref = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), compName);

+        assertNotNull("Architecture not available", arch_ref);

+

+        Architecture arch = (Architecture) osgiHelper.getServiceObject(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.runtime.core.components.FooProviderType1");

+

+        HandlerDescription[] handlers = id.getHandlers();

+        assertEquals("Number of handlers", handlers.length, 2);

+

+        //Look for the ProvidedService Handler

+        ProvidedServiceHandlerDescription pshd = null;

+        pshd = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");

+

+//		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].getServiceSpecifications().length, 1);

+        assertEquals("Check Provided Service Specs - 2", ps[0].getServiceSpecifications()[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.size(), 2);

+        assertEquals("Check instance.name property", prop.getProperty("instance.name"), compName);

+        assertEquals("Check factory.name property", prop.getProperty("factory.name"), factName);

+    }

+

+    @Test

+    public void testProps() {

+        String factName = "PS-FooProviderType-3";

+        String compName = "FooProvider";

+

+        // Get the factory to create a component instance

+        Factory fact = ipojoHelper.getFactory(factName);

+        assertNotNull("Cannot find the factory FooProvider", fact);

+

+        Properties props = new Properties();

+        props.put("instance.name", compName);

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

+        props.put("bar", "2");

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

+        ipojoHelper.createComponentInstance(factName, props);

+

+        ServiceReference arch_ref = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), compName);

+        assertNotNull("Architecture not available", arch_ref);

+

+        Architecture arch = (Architecture) osgiHelper.getServiceObject(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.runtime.core.components.FooProviderType1");

+

+        HandlerDescription[] handlers = id.getHandlers();

+        assertEquals("Number of handlers", handlers.length, 3);

+

+        //Look for the ProvidedService Handler

+        ProvidedServiceHandlerDescription pshd = null;

+        pshd = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");

+

+

+        assertNotNull("Check ProvidedServiceHandlerDescription", pshd);

+        ProvidedServiceDescription[] ps = pshd.getProvidedServices();

+

+        assertEquals("Check ProvidedService number", ps.length, 1);

+        assertEquals("Check Provided Service Specs - 1", ps[0].getServiceSpecifications().length, 1);

+        assertEquals("Check Provided Service Specs - 2", ps[0].getServiceSpecifications()[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(), 5);

+        assertEquals("Check instance.name property", prop.getProperty("instance.name"), compName);

+        assertEquals("Check factory.name property", prop.getProperty("factory.name"), factName);

+        assertEquals("Check foo property", prop.get("foo"), "foo");

+        assertEquals("Check bar property", prop.get("bar"), new Integer(2));

+        assertEquals("Check baz property", prop.get("baz"), "baz");

+

+    }

+

+    @Test

+    public void testDoubleProviding() {

+        String factName = "PS-FooBarProviderType-1";

+        String compName = "FooProvider";

+

+        // Get the factory to create a component instance

+        Factory fact = ipojoHelper.getFactory(factName);

+        assertNotNull("Cannot find the factory FooProvider", fact);

+

+        ipojoHelper.createComponentInstance(factName, compName);

+

+        ServiceReference arch_ref = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), compName);

+        assertNotNull("Architecture not available", arch_ref);

+

+        Architecture arch = (Architecture) osgiHelper.getServiceObject(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.runtime.core.components.FooBarProviderType1");

+

+        HandlerDescription[] handlers = id.getHandlers();

+        assertEquals("Number of handlers", handlers.length, 2);

+

+        //Look for the ProvidedService Handler

+        ProvidedServiceHandlerDescription pshd = null;

+        pshd = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");

+

+//		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].getServiceSpecifications().length, 2);

+        assertContains("Check provided service specs - 2", ps[0].getServiceSpecifications(), FooService.class.getName());

+        ;

+        assertContains("Check provided service specs - 2", ps[0].getServiceSpecifications(), BarService.class.getName());

+        assertEquals("Check Provided Service availability", ps[0].getState(), ProvidedServiceDescription.REGISTERED);

+

+    }

+

+    @Test

+    public void testPropsNoValue() {

+        String factName = "PS-FooProviderType-3";

+        String compName = "FooProvider";

+

+        // Get the factory to create a component instance

+        Factory fact = ipojoHelper.getFactory(factName);

+        assertNotNull("Cannot find the factory FooProvider", fact);

+

+        ipojoHelper.createComponentInstance(factName, compName);

+

+        ServiceReference arch_ref = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), compName);

+        assertNotNull("Architecture not available", arch_ref);

+

+        Architecture arch = (Architecture) osgiHelper.getServiceObject(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.runtime.core.components.FooProviderType1");

+

+        HandlerDescription[] handlers = id.getHandlers();

+        assertEquals("Number of handlers", handlers.length, 3);

+

+        //Look for the ProvidedService Handler

+        ProvidedServiceHandlerDescription pshd = null;

+        pshd = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");

+

+//    	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].getServiceSpecifications().length, 1);

+        assertEquals("Check Provided Service Specs - 2", ps[0].getServiceSpecifications()[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);

+

+    }

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestServiceController.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestServiceController.java
new file mode 100644
index 0000000..76820a6
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestServiceController.java
@@ -0,0 +1,260 @@
+/* 

+ * 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.runtime.core;

+

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

+import org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceDescription;

+import org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandlerDescription;

+import org.apache.felix.ipojo.runtime.core.services.CheckService;

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+import org.junit.Test;

+

+import static org.junit.Assert.*;

+

+public class TestServiceController extends Common {

+

+    @Test

+    public void testComponentWithAController() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance("PS-Controller-1-default");

+        // Controller set to true.

+        osgiHelper.waitForService(FooService.class.getName(), null, 5000);

+        osgiHelper.waitForService(CheckService.class.getName(), null, 5000);

+

+        CheckService check = (CheckService) osgiHelper.getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+

+        assertFalse(check.check());

+

+        // FooService should not be there anymore

+        assertNull(osgiHelper.getServiceReference(FooService.class.getName()));

+

+        assertTrue(check.check());

+

+        assertNotNull(osgiHelper.getServiceReference(FooService.class.getName()));

+

+        ci.dispose();

+    }

+

+    @Test

+    public void testComponentWithAControllerSetToFalse() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance("PS-Controller-1-false");

+        // Controller set to false.

+        osgiHelper.waitForService(CheckService.class.getName(), null, 5000);

+        assertNull(osgiHelper.getServiceReference(FooService.class.getName()));

+

+        CheckService check = (CheckService) osgiHelper.getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+

+        assertTrue(check.check());

+        assertNotNull(osgiHelper.getServiceReference(FooService.class.getName()));

+

+        assertFalse(check.check());

+        // FooService should not be there anymore

+        assertNull(osgiHelper.getServiceReference(FooService.class.getName()));

+

+        ci.dispose();

+    }

+

+    @Test

+    public void testComponentWithTwoControllersSetToTrue() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance("PS-Controller-2-truetrue");

+

+        osgiHelper.waitForService(CheckService.class.getName(), null, 5000);

+        osgiHelper.waitForService(FooService.class.getName(), null, 5000);

+

+        CheckService check = (CheckService) osgiHelper.getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+

+        check.check();

+

+        assertNull(osgiHelper.getServiceReference(CheckService.class.getName()));

+        assertNotNull(osgiHelper.getServiceReference(FooService.class.getName()));

+

+        FooService fs = (FooService) osgiHelper.getServiceObject(FooService.class.getName(), null);

+        fs.foo();

+

+        assertNull(osgiHelper.getServiceReference(CheckService.class.getName()));

+        assertNull(osgiHelper.getServiceReference(FooService.class.getName()));

+

+        ci.dispose();

+    }

+

+    @Test

+    public void testComponentWithTwoControllersSetToTrueAndFalse() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance("PS-Controller-2-truefalse");

+

+        osgiHelper.waitForService(CheckService.class.getName(), null, 5000);

+

+        assertFalse(osgiHelper.isServiceAvailable(FooService.class.getName()));

+

+        CheckService check = (CheckService) osgiHelper.getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+

+        check.getProps();

+

+        assertFalse(osgiHelper.isServiceAvailable(CheckService.class.getName()));

+        assertTrue(osgiHelper.isServiceAvailable(FooService.class.getName()));

+

+        FooService fs = (FooService) osgiHelper.getServiceObject(FooService.class.getName(), null);

+        fs.fooProps();

+

+        assertTrue(osgiHelper.isServiceAvailable(CheckService.class.getName()));

+        assertTrue(osgiHelper.isServiceAvailable(FooService.class.getName()));

+

+        ci.dispose();

+    }

+

+    @Test

+    public void testComponentWithTwoControllersUsingBothSpecificationsTrueFalse() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance("PS-Controller-2-spec1");

+

+        osgiHelper.waitForService(CheckService.class.getName(), null, 5000);

+

+        assertFalse(osgiHelper.isServiceAvailable(FooService.class.getName()));

+

+        CheckService check = (CheckService) osgiHelper.getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+

+        check.getProps();

+

+        assertFalse(osgiHelper.isServiceAvailable(CheckService.class.getName()));

+        assertTrue(osgiHelper.isServiceAvailable(FooService.class.getName()));

+

+        FooService fs = (FooService) osgiHelper.getServiceObject(FooService.class.getName(), null);

+        fs.fooProps();

+

+        assertTrue(osgiHelper.isServiceAvailable(CheckService.class.getName()));

+        assertTrue(osgiHelper.isServiceAvailable(FooService.class.getName()));

+

+        ci.dispose();

+    }

+

+    @Test

+    public void testComponentWithTwoControllersUsingBothSpecificationsTrueTrue() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance("PS-Controller-2-spec2");

+

+        osgiHelper.waitForService(CheckService.class.getName(), null, 5000);

+        osgiHelper.waitForService(FooService.class.getName(), null, 5000);

+

+        CheckService check = (CheckService) osgiHelper.getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+

+        check.check();

+        // CheckService not available

+        assertNull(osgiHelper.getServiceReference(CheckService.class.getName()));

+        assertNotNull(osgiHelper.getServiceReference(FooService.class.getName()));

+

+        FooService fs = (FooService) osgiHelper.getServiceObject(FooService.class.getName(), null);

+        fs.foo();

+

+        assertNull(osgiHelper.getServiceReference(CheckService.class.getName()));

+        assertNull(osgiHelper.getServiceReference(FooService.class.getName()));

+

+        ci.dispose();

+    }

+

+    @Test

+    public void testComponentWithTwoControllersUsingSpecificationAndAllTrueTrue() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance("PS-Controller-2-spec3");

+

+        osgiHelper.waitForService(CheckService.class.getName(), null, 5000);

+        osgiHelper.waitForService(FooService.class.getName(), null, 5000);

+

+        CheckService check = (CheckService) osgiHelper.getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+

+        check.check();

+        // CheckService not available

+        assertNull(osgiHelper.getServiceReference(CheckService.class.getName()));

+        assertNotNull(osgiHelper.getServiceReference(FooService.class.getName()));

+

+        FooService fs = (FooService) osgiHelper.getServiceObject(FooService.class.getName(), null);

+        fs.foo();

+

+        assertNull(osgiHelper.getServiceReference(CheckService.class.getName()));

+        assertNull(osgiHelper.getServiceReference(FooService.class.getName()));

+

+        ci.dispose();

+    }

+

+    @Test

+    public void testComponentWithTwoControllersUsingSpecificationAndAllTrueFalse() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance("PS-Controller-2-spec4");

+

+        osgiHelper.waitForService(CheckService.class.getName(), null, 5000);

+

+        assertFalse(osgiHelper.isServiceAvailable(FooService.class.getName()));

+

+        CheckService check = (CheckService) osgiHelper.getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+

+        check.getProps();

+

+        assertFalse(osgiHelper.isServiceAvailable(CheckService.class.getName()));

+        assertTrue(osgiHelper.isServiceAvailable(FooService.class.getName()));

+

+        FooService fs = (FooService) osgiHelper.getServiceObject(FooService.class.getName(), null);

+        fs.fooProps();

+

+        assertTrue(osgiHelper.isServiceAvailable(CheckService.class.getName()));

+        assertTrue(osgiHelper.isServiceAvailable(FooService.class.getName()));

+

+        ci.dispose();

+    }

+

+    @Test

+    public void testArchitecture() {

+        ComponentInstance ci = ipojoHelper.createComponentInstance("PS-Controller-1-default");

+        // Controller set to true.

+        osgiHelper.waitForService(FooService.class.getName(), null, 5000);

+        osgiHelper.waitForService(CheckService.class.getName(), null, 5000);

+

+        ProvidedServiceHandlerDescription pshd = null;

+        pshd = (ProvidedServiceHandlerDescription) ci.getInstanceDescription()

+                .getHandlerDescription("org.apache.felix.ipojo:provides");

+

+        ProvidedServiceDescription ps = getPS(FooService.class.getName(), pshd.getProvidedServices());

+        assertEquals("true", ps.getController());

+

+        CheckService check = (CheckService) osgiHelper.getServiceObject(CheckService.class.getName(), null);

+        assertNotNull(check);

+

+        assertFalse(check.check());

+

+        ps = getPS(FooService.class.getName(), pshd.getProvidedServices());

+        assertEquals("false", ps.getController());

+

+        assertTrue(check.check());

+

+        ps = getPS(FooService.class.getName(), pshd.getProvidedServices());

+        assertEquals("true", ps.getController());

+

+    }

+

+    private ProvidedServiceDescription getPS(String itf, ProvidedServiceDescription[] svc) {

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

+            if (svc[i].getServiceSpecifications()[0].equals(itf)) {

+                return svc[i];

+            }

+        }

+

+        fail("Service : " + itf + " not found");

+        return null;

+    }

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestSimplePS.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestSimplePS.java
new file mode 100644
index 0000000..1437b03
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestSimplePS.java
@@ -0,0 +1,80 @@
+/*

+ * 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.runtime.core;

+

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

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

+import org.apache.felix.ipojo.runtime.core.components.SimpleClass;

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+import org.junit.Test;

+import org.osgi.framework.ServiceReference;

+

+import static junit.framework.Assert.assertEquals;

+import static org.junit.Assert.*;

+

+public class TestSimplePS extends Common {

+

+    @Test

+    public void testPS() {

+        String factName = "PS-FooProviderType-1";

+        String compName = "FooProvider-1";

+        ServiceReference ref;

+

+        // Check that no Foo Service are available

+        ref = osgiHelper.getServiceReference(FooService.class.getName());

+

+        assertNull("FS already available", ref);

+

+        // Get the factory to create a component instance

+        Factory fact = ipojoHelper.getFactory(factName);

+        assertNotNull("Cannot find the factory FooProvider-1", fact);

+

+        ipojoHelper.createComponentInstance(factName, compName);

+

+        // Get a FooService provider

+        ref = osgiHelper.getServiceReference(FooService.class.getName(), "(" + "instance.name" + "=" + compName + ")");

+

+        assertNotNull("FS not available", ref);

+

+        // Test foo invocation

+        FooService fs = (FooService) osgiHelper.getServiceObject(ref);

+        assertTrue("FooService invocation failed", fs.foo());

+

+        ipojoHelper.dispose();

+

+

+        // Check that there is no more FooService

+        ref = osgiHelper.getServiceReference(FooService.class.getName(), null);

+

+

+        assertNull("FS available, but component instance stopped", ref);

+

+    }

+

+    @Test

+    public void testWhenNoInterface() {

+        String factoryName = "org.apache.felix.ipojo.runtime.core.components.SimpleClass";

+        ComponentInstance ci = ipojoHelper.createComponentInstance(factoryName);

+        osgiHelper.waitForService(SimpleClass.class.getName(), null, 5000);

+        SimpleClass simple = (SimpleClass) osgiHelper.getServiceObject(SimpleClass.class.getName(), null);

+        assertEquals("Hello", simple.hello());

+        ci.dispose();

+    }

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestStaticProps.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestStaticProps.java
new file mode 100644
index 0000000..79511d2
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestStaticProps.java
@@ -0,0 +1,115 @@
+/* 

+ * 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.runtime.core;

+

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+import org.junit.Before;

+import org.junit.Test;

+import org.osgi.framework.ServiceReference;

+

+import java.util.Properties;

+

+import static junit.framework.Assert.assertEquals;

+import static org.junit.Assert.assertNotNull;

+import static org.junit.Assert.fail;

+

+public class TestStaticProps extends Common {

+

+    @Before

+    public void setUp() {

+        String type = "PS-FooProviderType-2";

+

+        ipojoHelper.createComponentInstance(type, "FooProvider-1");

+

+        Properties p2 = new Properties();

+        p2.put("instance.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});

+        ipojoHelper.createComponentInstance(type, p2);

+

+    }

+

+

+    @Test

+    public void testProperties1() {

+        ServiceReference sr = ipojoHelper.getServiceReferenceByName(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");

+            }

+        }

+

+    }

+

+    @Test

+    public void testProperties2() {

+        ServiceReference sr = ipojoHelper.getServiceReferenceByName(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");

+            }

+        }

+    }

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestStaticPropsReconfiguration.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestStaticPropsReconfiguration.java
new file mode 100644
index 0000000..3894e97
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/TestStaticPropsReconfiguration.java
@@ -0,0 +1,355 @@
+/* 

+ * 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.runtime.core;

+

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

+import org.apache.felix.ipojo.runtime.core.services.FooService;

+import org.junit.Before;

+import org.junit.Test;

+import org.osgi.framework.ServiceReference;

+import org.osgi.service.cm.ConfigurationException;

+import org.osgi.service.cm.ManagedServiceFactory;

+

+import java.util.Dictionary;

+import java.util.Properties;

+

+import static junit.framework.Assert.assertEquals;

+import static org.junit.Assert.assertNotNull;

+import static org.junit.Assert.fail;

+

+public class TestStaticPropsReconfiguration extends Common {

+

+    @Before

+    public void setUp() {

+        String type = "PS-FooProviderType-2";

+        ipojoHelper.createComponentInstance(type, "FooProvider-1");

+

+        Properties p2 = new Properties();

+        p2.put("instance.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});

+        ipojoHelper.createComponentInstance(type, p2);

+    }

+

+    @Test

+    public void testReconfFactory1() {

+        ServiceReference sr = ipojoHelper.getServiceReferenceByName(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 = ipojoHelper.getServiceReferenceByName(Factory.class.getName(), "PS-FooProviderType-2");

+        Dictionary reconf = new Properties();

+        reconf.put("instance.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) osgiHelper.getServiceObject(fact_ref);

+        try {

+            fact.reconfigure(reconf);

+        } catch (Exception e) {

+            fail("Configuration non acceptable : " + reconf);

+        }

+

+        sr = ipojoHelper.getServiceReferenceByName(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");

+            }

+        }

+

+        fact = null;

+

+    }

+

+    @Test

+    public void testReconfFactory2() {

+        ServiceReference sr = ipojoHelper.getServiceReferenceByName(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 = ipojoHelper.getServiceReferenceByName(Factory.class.getName(), "PS-FooProviderType-2");

+        Dictionary reconf = new Properties();

+        reconf.put("instance.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) osgiHelper.getServiceObject(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");

+            }

+        }

+        fact = null;

+    }

+

+    @Test

+    public void testMSFFactory1() {

+        ServiceReference sr = ipojoHelper.getServiceReferenceByName(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 = ipojoHelper.getServiceReferenceByName(ManagedServiceFactory.class.getName(), "PS-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) osgiHelper.getServiceObject(fact_ref);

+        try {

+            fact.updated("FooProvider-1", reconf);

+        } catch (ConfigurationException e) {

+            fail("Configuration non acceptable : " + reconf);

+        }

+

+        sr = ipojoHelper.getServiceReferenceByName(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");

+            }

+        }

+

+        fact = null;

+

+    }

+

+    @Test

+    public void testReconfMSF2() {

+        ServiceReference sr = ipojoHelper.getServiceReferenceByName(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 = ipojoHelper.getServiceReferenceByName(ManagedServiceFactory.class.getName(), "PS-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) osgiHelper.getServiceObject(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");

+            }

+        }

+    }

+

+

+}

diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/inheritence/InheritanceTest.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/inheritence/InheritanceTest.java
new file mode 100644
index 0000000..6e97a10
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/inheritence/InheritanceTest.java
@@ -0,0 +1,134 @@
+package org.apache.felix.ipojo.runtime.core.inheritence;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.architecture.Architecture;
+import org.apache.felix.ipojo.handlers.dependency.DependencyDescription;
+import org.apache.felix.ipojo.handlers.dependency.DependencyHandlerDescription;
+import org.apache.felix.ipojo.runtime.core.Common;
+import org.apache.felix.ipojo.runtime.core.components.inheritance.a.IA;
+import org.apache.felix.ipojo.runtime.core.components.inheritance.b.IB;
+import org.apache.felix.ipojo.runtime.core.components.inheritance.c.C;
+import org.apache.felix.ipojo.runtime.core.components.inheritance.d.D;
+import org.junit.Assert;
+import org.junit.Test;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.OptionUtils;
+import org.ops4j.pax.tinybundles.core.TinyBundles;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
+import org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOStrategy;
+
+import java.io.File;
+import java.io.IOException;
+
+import static org.ops4j.pax.exam.CoreOptions.streamBundle;
+import static org.ops4j.pax.tinybundles.core.TinyBundles.withBnd;
+
+public class InheritanceTest extends Common {
+
+    @Configuration
+    public Option[] config() throws IOException {
+        deployTestedBundle = false;
+        Option[] options = super.config();
+
+        return OptionUtils.combine(
+                options,
+                streamBundle(
+                        // Bundle A
+                        TinyBundles.bundle()
+                                .add(IA.class)
+                                .set(Constants.BUNDLE_SYMBOLICNAME, "A")
+                                .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.runtime.core.components.inheritance.a")
+                                .build(withBnd())
+                ),
+                streamBundle(
+                        // Bundle B
+                        TinyBundles.bundle()
+                                .add(IB.class)
+                                .set(Constants.BUNDLE_SYMBOLICNAME, "B")
+                                .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.runtime.core.components.inheritance.a")
+                                .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.runtime.core.components" +
+                                        ".inheritance.b")
+                                .build(withBnd())
+                ),
+                streamBundle(
+                        // Bundle C
+                        TinyBundles.bundle()
+                                .add(C.class)
+                                .set(Constants.BUNDLE_SYMBOLICNAME, "C")
+                                .set(Constants.IMPORT_PACKAGE,
+                                        "org.apache.felix.ipojo.runtime.core.components.inheritance.a, " +
+                                                "org.apache.felix.ipojo.runtime.core.components.inheritance.b")
+                                .build(IPOJOStrategy.withiPOJO(new File("src/main/resources/inheritance/provider" +
+                                        ".xml")))
+                ),
+                streamBundle(
+                        // Bundle D
+                        TinyBundles.bundle()
+                                .add(D.class)
+                                .set(Constants.BUNDLE_SYMBOLICNAME, "D")
+                                .set(Constants.IMPORT_PACKAGE,
+                                        "org.apache.felix.ipojo.runtime.core.components.inheritance.a, " +
+                                                "org.apache.felix.ipojo.runtime.core.components.inheritance.b")
+                                .build(IPOJOStrategy.withiPOJO(new File("src/main/resources/inheritance/cons" +
+                                        ".xml")))
+                )
+
+
+        );
+    }
+
+    @Test
+    public void testDeploy() {
+        Bundle[] bundles = bc.getBundles();
+        for (int i = 0; i < bundles.length; i++) {
+            Assert.assertEquals(bundles[i].getSymbolicName() + " is not active", Bundle.ACTIVE, bundles[i].getState());
+        }
+
+        osgiHelper.waitForService(Architecture.class.getName(), "(architecture.instance=c)", 2000);
+        osgiHelper.waitForService(Architecture.class.getName(), "(architecture.instance=d)", 2000);
+
+        Object[] arch = osgiHelper.getServiceObjects(Architecture.class.getName(), null);
+        for (Object o : arch) {
+            Architecture a = (Architecture) o;
+            if (a.getInstanceDescription().getState() != ComponentInstance.VALID) {
+                Assert.fail("Instance " + a.getInstanceDescription().getName() + " not valid : " + a.getInstanceDescription().getDescription());
+            }
+        }
+    }
+
+    @Test
+    public void testArchitecture() {
+        osgiHelper.waitForService(Architecture.class.getName(), "(architecture.instance=d)", 2000);
+        ServiceReference ref = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), "d");
+        Assert.assertNotNull(ref);
+
+        Architecture arch = (Architecture) osgiHelper.getServiceObject(ref);
+
+        System.out.println(arch.getInstanceDescription().getDescription());
+
+        Assert.assertEquals(ComponentInstance.VALID, arch.getInstanceDescription().getState());
+        DependencyDescription dd = getDependency(arch, "org.apache.felix.ipojo.runtime.core.components.inheritance.b.IB");
+
+        Assert.assertTrue(!dd.getServiceReferences().isEmpty());
+
+        ServiceReference dref = (ServiceReference) dd.getServiceReferences().get(0);
+        Assert.assertEquals(dref.getBundle().getSymbolicName(), "C");
+
+    }
+
+    private DependencyDescription getDependency(Architecture arch, String id) {
+        DependencyHandlerDescription hd = (DependencyHandlerDescription) arch.getInstanceDescription().getHandlerDescription("org.apache.felix.ipojo:requires");
+        Assert.assertNotNull(hd);
+        for (DependencyDescription dd : hd.getDependencies()) {
+            if (dd.getId().equals(id)) {
+                return dd;
+            }
+        }
+        Assert.fail("Dependency " + id + " not found");
+        return null;
+    }
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/strategies/CustomStrategy2Test.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/strategies/CustomStrategy2Test.java
new file mode 100644
index 0000000..996ba5e
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/strategies/CustomStrategy2Test.java
@@ -0,0 +1,209 @@
+package org.apache.felix.ipojo.runtime.core.strategies;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.PrimitiveInstanceDescription;
+import org.apache.felix.ipojo.runtime.core.Common;
+import org.apache.felix.ipojo.runtime.core.components.strategies.FooBarProviderType1;
+import org.apache.felix.ipojo.runtime.core.components.strategies.FooProviderType1;
+import org.apache.felix.ipojo.runtime.core.services.BarService;
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.ServiceReference;
+
+import java.util.Properties;
+
+import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+
+public class CustomStrategy2Test extends Common {
+
+
+    private ComponentInstance cons1, cons2, prov;
+    private ComponentInstance cons3, prov2;
+
+    @Before
+    public void setUp() {
+        cons1 = ipojoHelper.createComponentInstance("PSS-Cons");
+        assertEquals("cons1 invalid", ComponentInstance.INVALID, cons1.getState());
+        cons2 = ipojoHelper.createComponentInstance("PSS-Cons");
+        assertEquals("cons2 invalid", ComponentInstance.INVALID, cons2.getState());
+        prov = ipojoHelper.createComponentInstance("PSS-FooProviderType-Custom2");
+        prov2 = ipojoHelper.createComponentInstance("PSS-FooBarProviderType-Custom2");
+        cons3 = ipojoHelper.createComponentInstance("PSS-ConsBar");
+        prov2.stop();
+        prov.stop();
+    }
+
+    @After
+    public void tearDown() {
+        reset();
+    }
+
+
+    private void reset() {
+        FooProviderType1.resetIds();
+        FooBarProviderType1.resetIds();
+    }
+
+    private void checkCreatedObjects(ComponentInstance ci, int expected) {
+        assertEquals("Number of created objects", expected, ((PrimitiveInstanceDescription) ci.getInstanceDescription()).getCreatedObjects().length);
+    }
+
+    @Test
+    public void testOneService() {
+        prov.start();
+        cons2.stop();
+        cons1.stop();
+        assertEquals("Prov valid", ComponentInstance.VALID, prov.getState());
+        ServiceReference ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), prov.getInstanceName());
+        assertNotNull("Service available", ref);
+        checkCreatedObjects(prov, 0);
+
+        // Step 1 : create start one consumer
+        cons1.start();
+        ServiceReference refcons1 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
+        assertNotNull("Cons1 Service available", refcons1);
+
+        CheckService cs_cons1 = (CheckService) osgiHelper.getServiceObject(refcons1);
+        Properties props = cs_cons1.getProps();
+        Long id = (Long) props.get("id");
+        FooService fscons1 = (FooService) props.get("object");
+        assertEquals("id 1", 1, id.intValue());
+        checkCreatedObjects(prov, 1);
+
+
+        // Step 2 : create a second consumer
+        cons2.start();
+        ServiceReference refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
+        assertNotNull("Cons2 Service available", refcons2);
+
+        CheckService cs_cons2 = (CheckService) osgiHelper.getServiceObject(refcons2);
+        Properties props2 = cs_cons2.getProps();
+        Long id2 = (Long) props2.get("id");
+        FooService fscons2 = (FooService) props2.get("object");
+        assertEquals("id 2", 2, id2.intValue());
+        checkCreatedObjects(prov, 2);
+
+        assertNotSame("Two objects", fscons1, fscons2);
+
+        // Step 3 : stop the second provider
+        System.out.println("cons2 stopping");
+        cons2.stop();
+        System.out.println("cons2 stopped");
+        checkCreatedObjects(prov, 1);
+
+        // Step 4 : stop the first consumer
+        cons1.stop();
+        checkCreatedObjects(prov, 0);
+    }
+
+    @Test
+    public void testObjectCreation() {
+        prov.start();
+
+        // The two consumers are started and use their own objects.
+        ServiceReference refcons1 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
+        assertNotNull("Cons1 Service available", refcons1);
+        CheckService cs_cons1 = (CheckService) osgiHelper.getServiceObject(refcons1);
+        Properties props = cs_cons1.getProps();
+        FooService fscons1 = (FooService) props.get("object");
+
+        ServiceReference refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
+        assertNotNull("Cons2 Service available", refcons2);
+        CheckService cs_cons2 = (CheckService) osgiHelper.getServiceObject(refcons2);
+        Properties props2 = cs_cons2.getProps();
+        FooService fscons2 = (FooService) props2.get("object");
+
+        checkCreatedObjects(prov, 2);
+        assertNotSame("Two objects", fscons1, fscons2);
+
+        // Stop the provider
+        prov.stop();
+        // Cons1 and 2 are invalid.
+        assertEquals("Cons1 invalidity", ComponentInstance.INVALID, cons1.getState());
+        assertEquals("Cons2 invalidity", ComponentInstance.INVALID, cons2.getState());
+
+        // No object created in prov
+        checkCreatedObjects(prov, 0);
+
+        // Restart the provider
+        prov.start();
+
+        // Consumers are valid.
+        assertEquals("Cons1 validity", ComponentInstance.VALID, cons1.getState());
+        assertEquals("Cons2 validity", ComponentInstance.VALID, cons2.getState());
+
+        // Check objects
+        refcons1 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
+        assertNotNull("Cons1 Service available", refcons1);
+        cs_cons1 = (CheckService) osgiHelper.getServiceObject(refcons1);
+        props = cs_cons1.getProps();
+        Object fscons3 = (FooService) props.get("object");
+
+        refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
+        assertNotNull("Cons2 Service available", refcons2);
+        cs_cons2 = (CheckService) osgiHelper.getServiceObject(refcons2);
+        props2 = cs_cons2.getProps();
+        Object fscons4 = (FooService) props2.get("object");
+
+        checkCreatedObjects(prov, 2);
+        assertNotSame("Two objects", fscons3, fscons4);
+        assertNotSame("Two new objects - 1", fscons3, fscons1);
+        assertNotSame("Two new objects - 2", fscons4, fscons2);
+
+    }
+
+    @Test
+    public void testTwoServices() {
+        cons3.stop();
+        prov2.start();
+        cons1.stop();
+        assertEquals("Prov valid", ComponentInstance.VALID, prov2.getState());
+        ServiceReference ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), prov2.getInstanceName());
+        assertNotNull("Service available", ref);
+        ServiceReference refBar = ipojoHelper.getServiceReferenceByName(BarService.class.getName(), prov2.getInstanceName());
+        assertNotNull("Service available", refBar);
+        checkCreatedObjects(prov2, 0);
+
+        // Step 1 : create start one consumer
+        cons1.start();
+        ServiceReference refcons1 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
+        assertNotNull("Cons1 Service available", refcons1);
+
+        CheckService cs_cons1 = (CheckService) osgiHelper.getServiceObject(refcons1);
+        Properties props = cs_cons1.getProps();
+        Long id = (Long) props.get("id");
+        FooService fscons1 = (FooService) props.get("object");
+        assertEquals("id 1", 1, id.intValue());
+        checkCreatedObjects(prov2, 1);
+
+
+        // Step 2 : create a second consumer
+        cons3.start();
+        ServiceReference refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons3.getInstanceName());
+        assertNotNull("Cons2 Service available", refcons2);
+
+        CheckService cs_cons2 = (CheckService) osgiHelper.getServiceObject(refcons2);
+        Properties props2 = cs_cons2.getProps();
+        Long id2 = (Long) props2.get("id");
+        FooService fscons2 = (FooService) props2.get("object");
+        assertEquals("id 2", 2, id2.intValue());
+        checkCreatedObjects(prov2, 2);
+
+
+        assertNotSame("Two objects", fscons1, fscons2);
+
+        // Step 3 : stop the second provider
+        cons3.stop();
+        checkCreatedObjects(prov2, 1);
+
+        // Step 4 : stop the first consumer
+        cons1.stop();
+        checkCreatedObjects(prov, 0);
+    }
+
+}
\ No newline at end of file
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/strategies/CustomStrategyTest.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/strategies/CustomStrategyTest.java
new file mode 100644
index 0000000..69ec9d2
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/strategies/CustomStrategyTest.java
@@ -0,0 +1,210 @@
+package org.apache.felix.ipojo.runtime.core.strategies;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.PrimitiveInstanceDescription;
+import org.apache.felix.ipojo.runtime.core.Common;
+import org.apache.felix.ipojo.runtime.core.components.strategies.FooBarProviderType1;
+import org.apache.felix.ipojo.runtime.core.components.strategies.FooProviderType1;
+import org.apache.felix.ipojo.runtime.core.services.BarService;
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.ServiceReference;
+
+import java.util.Properties;
+
+import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+
+public class CustomStrategyTest extends Common {
+
+
+    private ComponentInstance cons1, cons2, prov;
+    private ComponentInstance cons3, prov2;
+
+    @Before
+    public void setUp() {
+        cons1 = ipojoHelper.createComponentInstance("PSS-Cons");
+        assertEquals("cons1 invalid", ComponentInstance.INVALID, cons1.getState());
+        cons2 = ipojoHelper.createComponentInstance("PSS-Cons");
+        assertEquals("cons2 invalid", ComponentInstance.INVALID, cons2.getState());
+        prov = ipojoHelper.createComponentInstance("PSS-FooProviderType-Custom");
+        prov2 = ipojoHelper.createComponentInstance("PSS-FooBarProviderType-Custom");
+        cons3 = ipojoHelper.createComponentInstance("PSS-ConsBar");
+        prov2.stop();
+        prov.stop();
+    }
+
+    @After
+    public void tearDown() {
+        reset();
+    }
+
+
+    private void reset() {
+        FooProviderType1.resetIds();
+        FooBarProviderType1.resetIds();
+    }
+
+    private void checkCreatedObjects(ComponentInstance ci, int expected) {
+        assertEquals("Number of created objects", expected, ((PrimitiveInstanceDescription) ci.getInstanceDescription()).getCreatedObjects().length);
+    }
+
+    @Test
+    public void testOneService() {
+        prov.start();
+        cons2.stop();
+        cons1.stop();
+        assertEquals("Prov valid", ComponentInstance.VALID, prov.getState());
+        ServiceReference ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), prov.getInstanceName());
+        assertNotNull("Service available", ref);
+        checkCreatedObjects(prov, 0);
+
+        // Step 1 : create start one consumer
+        cons1.start();
+        ServiceReference refcons1 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
+        assertNotNull("Cons1 Service available", refcons1);
+
+        CheckService cs_cons1 = (CheckService) osgiHelper.getServiceObject(refcons1);
+        Properties props = cs_cons1.getProps();
+        Long id = (Long) props.get("id");
+        FooService fscons1 = (FooService) props.get("object");
+        assertEquals("id 1", 1, id.intValue());
+        checkCreatedObjects(prov, 1);
+
+
+        // Step 2 : create a second consumer
+        cons2.start();
+        ServiceReference refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
+        assertNotNull("Cons2 Service available", refcons2);
+
+        CheckService cs_cons2 = (CheckService) osgiHelper.getServiceObject(refcons2);
+        Properties props2 = cs_cons2.getProps();
+        Long id2 = (Long) props2.get("id");
+        FooService fscons2 = (FooService) props2.get("object");
+        assertEquals("id 2", 2, id2.intValue());
+        checkCreatedObjects(prov, 2);
+
+        assertNotSame("Two objects", fscons1, fscons2);
+
+        // Step 3 : stop the second provider
+        System.out.println("cons2 stopping");
+        cons2.stop();
+        System.out.println("cons2 stopped");
+        checkCreatedObjects(prov, 1);
+
+        // Step 4 : stop the first consumer
+        cons1.stop();
+        checkCreatedObjects(prov, 0);
+    }
+
+    @Test
+    public void testObjectCreation() {
+        prov.start();
+
+        // The two consumers are started and use their own objects.
+        ServiceReference refcons1 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
+        assertNotNull("Cons1 Service available", refcons1);
+        CheckService cs_cons1 = (CheckService) osgiHelper.getServiceObject(refcons1);
+        Properties props = cs_cons1.getProps();
+        FooService fscons1 = (FooService) props.get("object");
+
+        ServiceReference refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
+        assertNotNull("Cons2 Service available", refcons2);
+        CheckService cs_cons2 = (CheckService) osgiHelper.getServiceObject(refcons2);
+        Properties props2 = cs_cons2.getProps();
+        FooService fscons2 = (FooService) props2.get("object");
+
+        checkCreatedObjects(prov, 2);
+        assertNotSame("Two objects", fscons1, fscons2);
+
+        // Stop the provider
+        prov.stop();
+        // Cons1 and 2 are invalid.
+        assertEquals("Cons1 invalidity", ComponentInstance.INVALID, cons1.getState());
+        assertEquals("Cons2 invalidity", ComponentInstance.INVALID, cons2.getState());
+
+        // No object created in prov
+        checkCreatedObjects(prov, 0);
+
+        // Restart the provider
+        prov.start();
+
+        // Consumers are valid.
+        assertEquals("Cons1 validity", ComponentInstance.VALID, cons1.getState());
+        assertEquals("Cons2 validity", ComponentInstance.VALID, cons2.getState());
+
+        // Check objects
+        refcons1 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
+        assertNotNull("Cons1 Service available", refcons1);
+        cs_cons1 = (CheckService) osgiHelper.getServiceObject(refcons1);
+        props = cs_cons1.getProps();
+        Object fscons3 = (FooService) props.get("object");
+
+        refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
+        assertNotNull("Cons2 Service available", refcons2);
+        cs_cons2 = (CheckService) osgiHelper.getServiceObject(refcons2);
+        props2 = cs_cons2.getProps();
+        Object fscons4 = (FooService) props2.get("object");
+
+        checkCreatedObjects(prov, 2);
+        assertNotSame("Two objects", fscons3, fscons4);
+        assertNotSame("Two new objects - 1", fscons3, fscons1);
+        assertNotSame("Two new objects - 2", fscons4, fscons2);
+
+    }
+
+    @Test
+    public void testTwoServices() {
+        cons3.stop();
+        prov2.start();
+        cons1.stop();
+        assertEquals("Prov valid", ComponentInstance.VALID, prov2.getState());
+        ServiceReference ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), prov2.getInstanceName());
+        assertNotNull("Service available", ref);
+        ServiceReference refBar;
+        refBar = ipojoHelper.getServiceReferenceByName(BarService.class.getName(), prov2.getInstanceName());
+        assertNotNull("Service available", refBar);
+        checkCreatedObjects(prov2, 0);
+
+        // Step 1 : create start one consumer
+        cons1.start();
+        ServiceReference refcons1 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
+        assertNotNull("Cons1 Service available", refcons1);
+
+        CheckService cs_cons1 = (CheckService) osgiHelper.getServiceObject(refcons1);
+        Properties props = cs_cons1.getProps();
+        Long id = (Long) props.get("id");
+        FooService fscons1 = (FooService) props.get("object");
+        assertEquals("id 1", 1, id.intValue());
+        checkCreatedObjects(prov2, 1);
+
+
+        // Step 2 : create a second consumer
+        cons3.start();
+        ServiceReference refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons3.getInstanceName());
+        assertNotNull("Cons2 Service available", refcons2);
+
+        CheckService cs_cons2 = (CheckService) osgiHelper.getServiceObject(refcons2);
+        Properties props2 = cs_cons2.getProps();
+        Long id2 = (Long) props2.get("id");
+        FooService fscons2 = (FooService) props2.get("object");
+        assertEquals("id 2", 2, id2.intValue());
+        checkCreatedObjects(prov2, 2);
+
+
+        assertNotSame("Two objects", fscons1, fscons2);
+
+        // Step 3 : stop the second provider
+        cons3.stop();
+        checkCreatedObjects(prov2, 1);
+
+        // Step 4 : stop the first consumer
+        cons1.stop();
+        checkCreatedObjects(prov, 0);
+    }
+
+}
diff --git a/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/strategies/PerInstanceStrategyTest.java b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/strategies/PerInstanceStrategyTest.java
new file mode 100644
index 0000000..80a6c83
--- /dev/null
+++ b/ipojo/runtime/core-it/src/it/ipojo-core-service-providing-test/src/test/java/org/apache/felix/ipojo/runtime/core/strategies/PerInstanceStrategyTest.java
@@ -0,0 +1,208 @@
+package org.apache.felix.ipojo.runtime.core.strategies;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.PrimitiveInstanceDescription;
+import org.apache.felix.ipojo.runtime.core.Common;
+import org.apache.felix.ipojo.runtime.core.components.strategies.FooBarProviderType1;
+import org.apache.felix.ipojo.runtime.core.components.strategies.FooProviderType1;
+import org.apache.felix.ipojo.runtime.core.services.BarService;
+import org.apache.felix.ipojo.runtime.core.services.CheckService;
+import org.apache.felix.ipojo.runtime.core.services.FooService;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.ServiceReference;
+
+import java.util.Properties;
+
+import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+
+public class PerInstanceStrategyTest extends Common {
+
+    private ComponentInstance cons1, cons2, prov;
+    private ComponentInstance cons3, prov2;
+
+    @Before
+    public void setUp() {
+        cons1 = ipojoHelper.createComponentInstance("PSS-Cons");
+        assertEquals("cons1 invalid", ComponentInstance.INVALID, cons1.getState());
+        cons2 = ipojoHelper.createComponentInstance("PSS-Cons");
+        assertEquals("cons2 invalid", ComponentInstance.INVALID, cons2.getState());
+        prov = ipojoHelper.createComponentInstance("PSS-FooProviderType-Instance");
+        prov2 = ipojoHelper.createComponentInstance("PSS-FooBarProviderType-Instance");
+        cons3 = ipojoHelper.createComponentInstance("PSS-ConsBar");
+        prov2.stop();
+        prov.stop();
+    }
+
+    @After
+    public void tearDown() {
+        reset();
+    }
+
+
+    private void reset() {
+        FooProviderType1.resetIds();
+        FooBarProviderType1.resetIds();
+    }
+
+    private void checkCreatedObjects(ComponentInstance ci, int expected) {
+        assertEquals("Number of created objects", expected, ((PrimitiveInstanceDescription) ci.getInstanceDescription()).getCreatedObjects().length);
+    }
+
+    @Test
+    public void testOneService() {
+        prov.start();
+        cons2.stop();
+        cons1.stop();
+        assertEquals("Prov valid", ComponentInstance.VALID, prov.getState());
+        ServiceReference ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), prov.getInstanceName());
+        assertNotNull("Service available", ref);
+        checkCreatedObjects(prov, 0);
+
+        // Step 1 : create start one consumer
+        cons1.start();
+        ServiceReference refcons1 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
+        assertNotNull("Cons1 Service available", refcons1);
+
+        CheckService cs_cons1 = (CheckService) osgiHelper.getServiceObject(refcons1);
+        Properties props = cs_cons1.getProps();
+        Long id = (Long) props.get("id");
+        FooService fscons1 = (FooService) props.get("object");
+        assertEquals("id 1", 1, id.intValue());
+        checkCreatedObjects(prov, 1);
+
+
+        // Step 2 : create a second consumer
+        cons2.start();
+        ServiceReference refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
+        assertNotNull("Cons2 Service available", refcons2);
+
+        CheckService cs_cons2 = (CheckService) osgiHelper.getServiceObject(refcons2);
+        Properties props2 = cs_cons2.getProps();
+        Long id2 = (Long) props2.get("id");
+        FooService fscons2 = (FooService) props2.get("object");
+        assertEquals("id 2", 2, id2.intValue());
+        checkCreatedObjects(prov, 2);
+
+        assertNotSame("Two objects", fscons1, fscons2);
+
+        // Step 3 : stop the second provider
+        System.out.println("cons2 stopping");
+        cons2.stop();
+        System.out.println("cons2 stopped");
+        checkCreatedObjects(prov, 1);
+
+        // Step 4 : stop the first consumer
+        cons1.stop();
+        checkCreatedObjects(prov, 0);
+    }
+
+    @Test
+    public void testObjectCreation() {
+        prov.start();
+
+        // The two consumers are started and use their own objects.
+        ServiceReference refcons1 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
+        assertNotNull("Cons1 Service available", refcons1);
+        CheckService cs_cons1 = (CheckService) osgiHelper.getServiceObject(refcons1);
+        Properties props = cs_cons1.getProps();
+        FooService fscons1 = (FooService) props.get("object");
+
+        ServiceReference refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
+        assertNotNull("Cons2 Service available", refcons2);
+        CheckService cs_cons2 = (CheckService) osgiHelper.getServiceObject(refcons2);
+        Properties props2 = cs_cons2.getProps();
+        FooService fscons2 = (FooService) props2.get("object");
+
+        checkCreatedObjects(prov, 2);
+        assertNotSame("Two objects", fscons1, fscons2);
+
+        // Stop the provider
+        prov.stop();
+        // Cons1 and 2 are invalid.
+        assertEquals("Cons1 invalidity", ComponentInstance.INVALID, cons1.getState());
+        assertEquals("Cons2 invalidity", ComponentInstance.INVALID, cons2.getState());
+
+        // No object created in prov
+        checkCreatedObjects(prov, 0);
+
+        // Restart the provider
+        prov.start();
+
+        // Consumers are valid.
+        assertEquals("Cons1 validity", ComponentInstance.VALID, cons1.getState());
+        assertEquals("Cons2 validity", ComponentInstance.VALID, cons2.getState());
+
+        // Check objects
+        refcons1 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
+        assertNotNull("Cons1 Service available", refcons1);
+        cs_cons1 = (CheckService) osgiHelper.getServiceObject(refcons1);
+        props = cs_cons1.getProps();
+        Object fscons3 = (FooService) props.get("object");
+
+        refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
+        assertNotNull("Cons2 Service available", refcons2);
+        cs_cons2 = (CheckService) osgiHelper.getServiceObject(refcons2);
+        props2 = cs_cons2.getProps();
+        Object fscons4 = (FooService) props2.get("object");
+
+        checkCreatedObjects(prov, 2);
+        assertNotSame("Two objects", fscons3, fscons4);
+        assertNotSame("Two new objects - 1", fscons3, fscons1);
+        assertNotSame("Two new objects - 2", fscons4, fscons2);
+
+    }
+
+    @Test
+    public void testTwoServices() {
+        cons3.stop();
+        prov2.start();
+        cons1.stop();
+        assertEquals("Prov valid", ComponentInstance.VALID, prov2.getState());
+        ServiceReference ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), prov2.getInstanceName());
+        assertNotNull("Service available", ref);
+        ServiceReference refBar = ipojoHelper.getServiceReferenceByName(BarService.class.getName(), prov2.getInstanceName());
+        assertNotNull("Service available", refBar);
+        checkCreatedObjects(prov2, 0);
+
+        // Step 1 : create start one consumer
+        cons1.start();
+        ServiceReference refcons1 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
+        assertNotNull("Cons1 Service available", refcons1);
+
+        CheckService cs_cons1 = (CheckService) osgiHelper.getServiceObject(refcons1);
+        Properties props = cs_cons1.getProps();
+        Long id = (Long) props.get("id");
+        FooService fscons1 = (FooService) props.get("object");
+        assertEquals("id 1", 1, id.intValue());
+        checkCreatedObjects(prov2, 1);
+
+
+        // Step 2 : create a second consumer
+        cons3.start();
+        ServiceReference refcons2 = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), cons3.getInstanceName());
+        assertNotNull("Cons2 Service available", refcons2);
+
+        CheckService cs_cons2 = (CheckService) osgiHelper.getServiceObject(refcons2);
+        Properties props2 = cs_cons2.getProps();
+        Long id2 = (Long) props2.get("id");
+        FooService fscons2 = (FooService) props2.get("object");
+        assertEquals("id 2", 2, id2.intValue());
+        checkCreatedObjects(prov2, 2);
+
+
+        assertNotSame("Two objects", fscons1, fscons2);
+
+        // Step 3 : stop the second provider
+        cons3.stop();
+        checkCreatedObjects(prov2, 1);
+
+        // Step 4 : stop the first consumer
+        cons1.stop();
+        checkCreatedObjects(prov, 0);
+    }
+
+}