diff --git a/ipojo/examples/junit4osgi/felix-command/metadata.xml b/ipojo/examples/junit4osgi/felix-command/metadata.xml
index 4021649..b1524c5 100644
--- a/ipojo/examples/junit4osgi/felix-command/metadata.xml
+++ b/ipojo/examples/junit4osgi/felix-command/metadata.xml
@@ -16,7 +16,6 @@
 	specific language governing permissions and limitations
 	under the License.
 -->
-<?xml version="1.0" encoding="UTF-8"?>
 <iPOJO>
 	<component
 		className="org.apache.felix.ipojo.junit4osgi.command.JunitCommand"
diff --git a/ipojo/examples/junit4osgi/felix-command/pom.xml b/ipojo/examples/junit4osgi/felix-command/pom.xml
index 6b912ad..0b49f1d 100644
--- a/ipojo/examples/junit4osgi/felix-command/pom.xml
+++ b/ipojo/examples/junit4osgi/felix-command/pom.xml
@@ -17,13 +17,17 @@
 	under the License.
 -->
 <project>
+	<parent>
+		<groupId>org.apache.felix</groupId>
+		<artifactId>felix</artifactId>
+		<version>1.0.2</version>
+	</parent>
 	<modelVersion>4.0.0</modelVersion>
 	<packaging>bundle</packaging>
 	<name>Junit4Osgi-Felix-Command</name>
 	<artifactId>
 		org.apache.felix.ipojo.junit4osgi.felix-command
 	</artifactId>
-	<groupId>org.apache.felix</groupId>
 	<version>1.1.0-SNAPSHOT</version>
 	<dependencies>
 		<dependency>
diff --git a/ipojo/examples/junit4osgi/immediate-launcher/metadata.xml b/ipojo/examples/junit4osgi/immediate-launcher/metadata.xml
index 4d7392a..9f3da35 100644
--- a/ipojo/examples/junit4osgi/immediate-launcher/metadata.xml
+++ b/ipojo/examples/junit4osgi/immediate-launcher/metadata.xml
@@ -16,7 +16,6 @@
 	specific language governing permissions and limitations
 	under the License.
 -->
-<?xml version="1.0" encoding="UTF-8"?>
 <iPOJO>
 	<component
 		className="org.apache.felix.ipojo.junit4osgi.command.ImmediateRunner"
diff --git a/ipojo/examples/junit4osgi/immediate-launcher/pom.xml b/ipojo/examples/junit4osgi/immediate-launcher/pom.xml
index 0328d91..c13726a 100644
--- a/ipojo/examples/junit4osgi/immediate-launcher/pom.xml
+++ b/ipojo/examples/junit4osgi/immediate-launcher/pom.xml
@@ -17,13 +17,17 @@
 	under the License.
 -->
 <project>
+	<parent>
+		<groupId>org.apache.felix</groupId>
+		<artifactId>felix</artifactId>
+		<version>1.0.2</version>
+	</parent>
 	<modelVersion>4.0.0</modelVersion>
 	<packaging>bundle</packaging>
 	<name>Junit4Osgi-Immediate-Runner</name>
 	<artifactId>
 		org.apache.felix.ipojo.junit4osgi.immediate-runner
 	</artifactId>
-	<groupId>org.apache.felix</groupId>
 	<version>1.1.0-SNAPSHOT</version>
 	<dependencies>
 		<dependency>
diff --git a/ipojo/examples/junit4osgi/junit4osgi/metadata.xml b/ipojo/examples/junit4osgi/junit4osgi/metadata.xml
index db0dc94..7d59467 100644
--- a/ipojo/examples/junit4osgi/junit4osgi/metadata.xml
+++ b/ipojo/examples/junit4osgi/junit4osgi/metadata.xml
@@ -16,7 +16,6 @@
 	specific language governing permissions and limitations
 	under the License.
 -->
-<?xml version="1.0" encoding="UTF-8"?>
 <ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="org.apache.felix.ipojo http://people.apache.org/~clement/ipojo/schemas/core.xsd 
 	    org.apache.felix.ipojo.extender http://people.apache.org/~clement/ipojo/schemas/extender-pattern.xsd"
diff --git a/ipojo/examples/junit4osgi/junit4osgi/pom.xml b/ipojo/examples/junit4osgi/junit4osgi/pom.xml
index 26db137..b7b7774 100644
--- a/ipojo/examples/junit4osgi/junit4osgi/pom.xml
+++ b/ipojo/examples/junit4osgi/junit4osgi/pom.xml
@@ -17,11 +17,15 @@
 	under the License.
 -->
 <project>
+	<parent>
+		<groupId>org.apache.felix</groupId>
+		<artifactId>felix</artifactId>
+		<version>1.0.2</version>
+	</parent>
 	<modelVersion>4.0.0</modelVersion>
 	<packaging>bundle</packaging>
 	<name>Junit4Osgi</name>
 	<artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-	<groupId>org.apache.felix</groupId>
 	<version>1.1.0-SNAPSHOT</version>
 	<dependencies>
 		<dependency>
diff --git a/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/pom.xml b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/pom.xml
index 729d27d..4e60f93 100644
--- a/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/pom.xml
+++ b/ipojo/examples/junit4osgi/maven-junit4osgi-plugin/pom.xml
@@ -18,8 +18,12 @@
 -->
 <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/maven-v4_0_0.xsd">
+	<parent>
+		<groupId>org.apache.felix</groupId>
+		<artifactId>felix</artifactId>
+		<version>1.0.2</version>
+	</parent>
 	<modelVersion>4.0.0</modelVersion>
-	<groupId>org.apache.felix</groupId>
 	<artifactId>maven-junit4osgi-plugin</artifactId>
 	<packaging>maven-plugin</packaging>
 	<version>1.1.0-SNAPSHOT</version>
diff --git a/ipojo/examples/junit4osgi/swing-runner/metadata.xml b/ipojo/examples/junit4osgi/swing-runner/metadata.xml
index 2a5a610..958bfc4 100644
--- a/ipojo/examples/junit4osgi/swing-runner/metadata.xml
+++ b/ipojo/examples/junit4osgi/swing-runner/metadata.xml
@@ -16,7 +16,6 @@
 	specific language governing permissions and limitations
 	under the License.
 -->
-<?xml version="1.0" encoding="UTF-8"?>
 <iPOJO>
 	<component
 		classname="org.apache.felix.ipojo.junit4osgi.command.SwingRunner">
diff --git a/ipojo/examples/junit4osgi/swing-runner/pom.xml b/ipojo/examples/junit4osgi/swing-runner/pom.xml
index 4931067..137e93b 100644
--- a/ipojo/examples/junit4osgi/swing-runner/pom.xml
+++ b/ipojo/examples/junit4osgi/swing-runner/pom.xml
@@ -17,11 +17,15 @@
 	under the License.
 -->
 <project>
+	<parent>
+		<groupId>org.apache.felix</groupId>
+		<artifactId>felix</artifactId>
+		<version>1.0.2</version>
+	</parent>
 	<modelVersion>4.0.0</modelVersion>
 	<packaging>bundle</packaging>
 	<name>Junit4Osgi-Swing-GUI</name>
 	<artifactId>org.apache.felix.ipojo.junit4osgi.swing-gui</artifactId>
-	<groupId>org.apache.felix</groupId>
 	<version>1.1.0-SNAPSHOT</version>
 	<dependencies>
 		<dependency>
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderType1.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderType1.java
index fc2ea2b..509e5d1 100644
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderType1.java
+++ b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderType1.java
@@ -37,7 +37,7 @@
         if (bc ==null) {
             throw new RuntimeException("Injected bundle context null");
         }
-            m_context = bc;
+        m_context = bc;
     }
 
 	public boolean foo() {
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/EmptyCompositeTest.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/EmptyCompositeTest.java
index 4ae87c5..3a02f60 100644
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/EmptyCompositeTest.java
+++ b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/EmptyCompositeTest.java
@@ -33,7 +33,7 @@
 public class EmptyCompositeTest extends OSGiTestCase {
 	
 	public void testEmptyCompositeCreation() {
-		Factory factory = Utils.getFactoryByName(context, "composite.empty");
+		Factory factory = Utils.getFactoryByName(getContext(), "composite.empty");
 		Properties props = new Properties();
 		props.put("instance.name","empty");
 		
@@ -61,7 +61,7 @@
 		CompositeManager cm = (CompositeManager) ci;
 		ServiceContext sc = cm.getServiceContext();
 		try {
-			assertEquals("Check number of factories imported", sc.getServiceReferences(Factory.class.getName(), null).length, context.getServiceReferences(Factory.class.getName(), null).length);
+			assertEquals("Check number of factories imported", sc.getServiceReferences(Factory.class.getName(), null).length, getContext().getServiceReferences(Factory.class.getName(), null).length);
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e.getMessage());
 		}
@@ -69,7 +69,7 @@
 	}
 	
 	public void testInstanceCreation1() {
-		Factory factory = Utils.getFactoryByName(context, "composite.empty");
+		Factory factory = Utils.getFactoryByName(getContext(), "composite.empty");
 		Properties props = new Properties();
 		props.put("instance.name","empty");
 		
@@ -85,7 +85,7 @@
 		CompositeManager cm = (CompositeManager) ci;
 		ServiceContext sc = cm.getServiceContext();
 		try {
-			assertEquals("Check number of factories imported", sc.getServiceReferences(Factory.class.getName(), null).length, context.getServiceReferences(Factory.class.getName(), null).length);
+			assertEquals("Check number of factories imported", sc.getServiceReferences(Factory.class.getName(), null).length, getContext().getServiceReferences(Factory.class.getName(), null).length);
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e.getMessage());
 		}
@@ -119,7 +119,7 @@
 	}
 	
 	public void testInstanceCreation2() {
-		Factory factory = Utils.getFactoryByName(context, "composite.empty");
+		Factory factory = Utils.getFactoryByName(getContext(), "composite.empty");
 		Properties props = new Properties();
 		props.put("instance.name","empty");
 		
@@ -134,7 +134,7 @@
 		CompositeManager cm = (CompositeManager) ci;
 		ServiceContext sc = cm.getServiceContext();
 		try {
-			assertEquals("Check number of factories imported", sc.getServiceReferences(Factory.class.getName(), null).length, context.getServiceReferences(Factory.class.getName(), null).length);
+			assertEquals("Check number of factories imported", sc.getServiceReferences(Factory.class.getName(), null).length, getContext().getServiceReferences(Factory.class.getName(), null).length);
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e.getMessage());
 		}
@@ -169,7 +169,7 @@
 	}
 	
 	public void testInstanceCreation3() {
-		Factory factory = Utils.getFactoryByName(context, "composite.empty");
+		Factory factory = Utils.getFactoryByName(getContext(), "composite.empty");
 		Properties props = new Properties();
 		props.put("instance.name","empty");
 		
@@ -184,7 +184,7 @@
 		CompositeManager cm = (CompositeManager) ci;
 		ServiceContext sc = cm.getServiceContext();
 		try {
-			assertEquals("Check number of factories imported", sc.getServiceReferences(Factory.class.getName(), null).length, context.getServiceReferences(Factory.class.getName(), null).length);
+			assertEquals("Check number of factories imported", sc.getServiceReferences(Factory.class.getName(), null).length, getContext().getServiceReferences(Factory.class.getName(), null).length);
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e.getMessage());
 		}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/FactoryManagementTest.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/FactoryManagementTest.java
index 1137f92..c70b643 100644
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/FactoryManagementTest.java
+++ b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/FactoryManagementTest.java
@@ -62,12 +62,12 @@
         public ComponentTypeDescription getComponentDescription() { return null; }
         public String getClassName() { return ""; }
         public int getState() { return Factory.VALID; }
-        public BundleContext getBundleContext() { return context; }
+        public BundleContext getBundleContext() { return getContext(); }
 
 	}
 	
 	public void setUp() {
-		emptyFactory = Utils.getFactoryByName(context, "composite.empty");
+		emptyFactory = Utils.getFactoryByName(getContext(), "composite.empty");
 		Properties props = new Properties();
 		props.put("instance.name","empty-1");
 		try {
@@ -81,20 +81,20 @@
 	}
 	
 	public void testOneLevelExposition() {
-		ServiceReference[] parentsFactoryReferences = Utils.getServiceReferences(context, Factory.class.getName(), null);
+		ServiceReference[] parentsFactoryReferences = Utils.getServiceReferences(getContext(), Factory.class.getName(), null);
 		ServiceContext sc = Utils.getServiceContext(empty);
 		ServiceReference[] internalFactoryReferences = Utils.getServiceReferences(sc, Factory.class.getName(), null);
 		
 		assertEquals("Check the number of available factories", parentsFactoryReferences.length, internalFactoryReferences.length);
 		
 		for(int i = 0; i < parentsFactoryReferences.length; i++) {
-			Factory factory = (Factory) context.getService(parentsFactoryReferences[i]);
+			Factory factory = (Factory) getContext().getService(parentsFactoryReferences[i]);
 			assertTrue("Check the avaibility of " + factory.getName(), isExposed(factory, internalFactoryReferences, sc));
 		}
 	}
 	
 	public void testTwoLevelExposition() {
-		ServiceReference[] parentsFactoryReferences = Utils.getServiceReferences(context, Factory.class.getName(), null);
+		ServiceReference[] parentsFactoryReferences = Utils.getServiceReferences(getContext(), Factory.class.getName(), null);
 		ServiceContext sc1 = Utils.getServiceContext(empty);
 		ServiceReference[] Level1FactoryReferences = Utils.getServiceReferences(sc1, Factory.class.getName(), null);
 		
@@ -116,7 +116,7 @@
 		assertEquals("Check the number of available factories - 3", Level1FactoryReferences.length, Level2FactoryReferences.length);
 		
 		for(int i = 0; i < Level1FactoryReferences.length; i++) {
-			Factory factory = (Factory) context.getService(parentsFactoryReferences[i]);
+			Factory factory = (Factory) getContext().getService(parentsFactoryReferences[i]);
 			assertTrue("Check the avaibility of " + factory.getName(), isExposed(factory, Level2FactoryReferences, sc2));
 		}
 		
@@ -124,7 +124,7 @@
 	}
 	
 	public void testDynamism() {
-		ServiceReference[] parentsFactoryReferences = Utils.getServiceReferences(context, Factory.class.getName(), null);
+		ServiceReference[] parentsFactoryReferences = Utils.getServiceReferences(getContext(), Factory.class.getName(), null);
 		ServiceContext sc1 = Utils.getServiceContext(empty);
 		ServiceReference[] Level1FactoryReferences = Utils.getServiceReferences(sc1, Factory.class.getName(), null);
 		
@@ -146,14 +146,14 @@
 		assertEquals("Check the number of available factories - 3", Level1FactoryReferences.length, Level2FactoryReferences.length);
 		
 		for(int i = 0; i < Level1FactoryReferences.length; i++) {
-			Factory factory = (Factory) context.getService(parentsFactoryReferences[i]);
+			Factory factory = (Factory) getContext().getService(parentsFactoryReferences[i]);
 			assertTrue("Check the avaibility of " + factory.getName(), isExposed(factory, Level2FactoryReferences, sc2));
 		}
 		
 		// Publish fake1
-		ServiceRegistration reg1 = context.registerService(Factory.class.getName(), fake1, null);
+		ServiceRegistration reg1 = getContext().registerService(Factory.class.getName(), fake1, null);
 		
-		parentsFactoryReferences = Utils.getServiceReferences(context, Factory.class.getName(), null);
+		parentsFactoryReferences = Utils.getServiceReferences(getContext(), Factory.class.getName(), null);
 		sc1 = Utils.getServiceContext(empty);
 		Level1FactoryReferences = Utils.getServiceReferences(sc1, Factory.class.getName(), null);
 		sc2 = Utils.getServiceContext(empty2);
@@ -164,9 +164,9 @@
 		assertEquals("Check the number of available factories - 1.3", Level1FactoryReferences.length, Level2FactoryReferences.length);
 		
 		// 	Publish fake2
-		ServiceRegistration reg2 = context.registerService(Factory.class.getName(), fake2, null);
+		ServiceRegistration reg2 = getContext().registerService(Factory.class.getName(), fake2, null);
 		
-		parentsFactoryReferences = Utils.getServiceReferences(context, Factory.class.getName(), null);
+		parentsFactoryReferences = Utils.getServiceReferences(getContext(), Factory.class.getName(), null);
 		sc1 = Utils.getServiceContext(empty);
 		Level1FactoryReferences = Utils.getServiceReferences(sc1, Factory.class.getName(), null);
 		sc2 = Utils.getServiceContext(empty2);
@@ -178,7 +178,7 @@
 		
 		reg1.unregister();
 		
-		parentsFactoryReferences = Utils.getServiceReferences(context, Factory.class.getName(), null);
+		parentsFactoryReferences = Utils.getServiceReferences(getContext(), Factory.class.getName(), null);
 		sc1 = Utils.getServiceContext(empty);
 		Level1FactoryReferences = Utils.getServiceReferences(sc1, Factory.class.getName(), null);
 		sc2 = Utils.getServiceContext(empty2);
@@ -190,7 +190,7 @@
 		
 		reg2.unregister();
 		
-		parentsFactoryReferences = Utils.getServiceReferences(context, Factory.class.getName(), null);
+		parentsFactoryReferences = Utils.getServiceReferences(getContext(), Factory.class.getName(), null);
 		sc1 = Utils.getServiceContext(empty);
 		Level1FactoryReferences = Utils.getServiceReferences(sc1, Factory.class.getName(), null);
 		sc2 = Utils.getServiceContext(empty2);
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRangeTest.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRangeTest.java
index 5b7b895..54f4648 100644
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRangeTest.java
+++ b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRangeTest.java
@@ -37,7 +37,7 @@
 
 	
 	public void setUp() {
-		emptyFactory = Utils.getFactoryByName(context, "composite.empty");
+		emptyFactory = Utils.getFactoryByName(getContext(), "composite.empty");
 		Properties props = new Properties();
 		props.put("instance.name","empty-1");
 		try {
@@ -82,9 +82,9 @@
 		assertNotNull("Check foo service visible inside the composite", sc2.getServiceReference(FooService.class.getName()));
 		assertNotNull("Check check service visible inside the composite", sc2.getServiceReference(CheckService.class.getName()));
 		// Check invisibilty
-		assertNull("Check foo service invisible inside the context", context.getServiceReference(FooService.class.getName()));
+		assertNull("Check foo service invisible inside the context", getContext().getServiceReference(FooService.class.getName()));
 		try {
-			assertNull("Check check service invisible inside the context", context.getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e);
 		}
@@ -94,9 +94,9 @@
 		 
 		assertNull("Check foo service invisible inside the composite", sc2.getServiceReference(FooService.class.getName()));
 		assertNull("Check check service invisible inside the composite", sc2.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible from the context", context.getServiceReference(FooService.class.getName()));
+		assertNull("Check foo service invisible from the context", getContext().getServiceReference(FooService.class.getName()));
 		try {
-			assertNull("Check check service invisible inside the context", context.getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e);
 		}
@@ -134,9 +134,9 @@
 		assertNotNull("Check foo service visible inside the composite", sc2.getServiceReference(FooService.class.getName()));
 		assertNotNull("Check check service visible inside the composite", sc2.getServiceReference(CheckService.class.getName()));
 		// Check invisibilty
-		assertNull("Check foo service invisible inside the context", context.getServiceReference(FooService.class.getName()));
+		assertNull("Check foo service invisible inside the context", getContext().getServiceReference(FooService.class.getName()));
 		try {
-			assertNull("Check check service invisible inside the context", context.getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e);
 		}
@@ -146,9 +146,9 @@
 		 
 		assertNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
 		assertNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", context.getServiceReference(FooService.class.getName()));
+		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
 		try {
-			assertNull("Check check service invisible inside the context", context.getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e);
 		}
@@ -157,7 +157,7 @@
 	public void testLevelOne3() {
 		ServiceContext sc2 = Utils.getServiceContext(empty);
 		
-		Factory fact1 = Utils.getFactoryByName(context, "COMPO-SimpleCheckServiceProvider");
+		Factory fact1 = Utils.getFactoryByName(getContext(), "COMPO-SimpleCheckServiceProvider");
 		Properties props = new Properties();
 		props.put("instance.name","client");
 		ComponentInstance client = null;
@@ -165,7 +165,7 @@
 			client = fact1.createComponentInstance(props, sc2);
 		} catch(Exception e) { fail("Cannot instantiate the client : " + e.getMessage()); }
 		
-		Factory fact2 = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
+		Factory fact2 = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
 		Properties props2 = new Properties();
 		props2.put("instance.name","provider");
 		ComponentInstance provider = null;
@@ -186,9 +186,9 @@
 		assertNotNull("Check foo service visible inside the composite", sc2.getServiceReference(FooService.class.getName()));
 		assertNotNull("Check check service visible inside the composite", sc2.getServiceReference(CheckService.class.getName()));
 		// Check invisibilty
-		assertNull("Check foo service invisible inside the context", context.getServiceReference(FooService.class.getName()));
+		assertNull("Check foo service invisible inside the context", getContext().getServiceReference(FooService.class.getName()));
 		try {
-			assertNull("Check check service invisible inside the context", context.getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e);
 		}
@@ -198,9 +198,9 @@
 		 
 		assertNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
 		assertNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", context.getServiceReference(FooService.class.getName()));
+		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
 		try {
-			assertNull("Check check service invisible inside the context", context.getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e);
 		}
@@ -251,9 +251,9 @@
 		// Check invisibilty
 		assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
 		assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", context.getServiceReference(FooService.class.getName()));
+		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
 		try {
-			assertNull("Check check service invisible inside the context", context.getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e);
 		}
@@ -265,9 +265,9 @@
 		assertNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
 		assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
 		assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", context.getServiceReference(FooService.class.getName()));
+		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
 		try {
-			assertNull("Check check service invisible inside the context", context.getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e);
 		}
@@ -319,9 +319,9 @@
 		// Check invisibilty
 		assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
 		assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", context.getServiceReference(FooService.class.getName()));
+		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
 		try {
-			assertNull("Check check service invisible inside the context", context.getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e);
 		}
@@ -333,9 +333,9 @@
 		assertNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
 		assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
 		assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", context.getServiceReference(FooService.class.getName()));
+		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
 		try {
-			assertNull("Check check service invisible inside the context", context.getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e);
 		}
@@ -356,7 +356,7 @@
 		
 		ServiceContext sc2 = Utils.getServiceContext(empty2);
 		
-		Factory fact1 = Utils.getFactoryByName(context, "COMPO-SimpleCheckServiceProvider");
+		Factory fact1 = Utils.getFactoryByName(getContext(), "COMPO-SimpleCheckServiceProvider");
 		Properties props = new Properties();
 		props.put("instance.name","client");
 		ComponentInstance client = null;
@@ -364,7 +364,7 @@
 			client = fact1.createComponentInstance(props, sc2);
 		} catch(Exception e) { fail("Cannot instantiate the client : " + e.getMessage()); }
 		
-		Factory fact2 = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
+		Factory fact2 = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
 		Properties props2 = new Properties();
 		props2.put("instance.name","provider");
 		ComponentInstance provider = null;
@@ -387,9 +387,9 @@
 		// Check invisibilty
 		assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
 		assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", context.getServiceReference(FooService.class.getName()));
+		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
 		try {
-			assertNull("Check check service invisible inside the context", context.getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e);
 		}
@@ -401,9 +401,9 @@
 		assertNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
 		assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
 		assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", context.getServiceReference(FooService.class.getName()));
+		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
 		try {
-			assertNull("Check check service invisible inside the context", context.getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e);
 		}
@@ -455,9 +455,9 @@
 		// Check invisibilty
 		assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
 		assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", context.getServiceReference(FooService.class.getName()));
+		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
 		try {
-			assertNull("Check check service invisible inside the context", context.getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e);
 		}
@@ -469,9 +469,9 @@
 		assertNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
 		assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
 		assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", context.getServiceReference(FooService.class.getName()));
+		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
 		try {
-			assertNull("Check check service invisible inside the context", context.getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
+			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e);
 		}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRegistryTest.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRegistryTest.java
index 14b3f61..86d96f1 100644
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRegistryTest.java
+++ b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRegistryTest.java
@@ -104,7 +104,7 @@
 	public void testRegistrationAndListener() {
 		ComponentInstance im = new FakeComponent();
 		ComponentInstance im2 = new FakeComponent();
-		ServiceRegistry registry = new ServiceRegistry(context);
+		ServiceRegistry registry = new ServiceRegistry(getContext());
 		assertNotNull("Assert registry not null", registry);
 		svcListener all = new svcListener();
 		try {
@@ -147,7 +147,7 @@
 	public void testRegistrationAndFilter() {
 		ComponentInstance im = new FakeComponent();
 		ComponentInstance im2 = new FakeComponent();
-		ServiceRegistry registry = new ServiceRegistry(context);
+		ServiceRegistry registry = new ServiceRegistry(getContext());
 		svcListener filtered = new svcListener();
 		
 		try {
@@ -185,7 +185,7 @@
 	public void testGetService() {
 		ComponentInstance im = new FakeComponent();
 		ComponentInstance im2 = new FakeComponent();
-		ServiceRegistry registry = new ServiceRegistry(context);
+		ServiceRegistry registry = new ServiceRegistry(getContext());
 		
 		try {
 			assertNull("Check that there is no available service", registry.getServiceReferences(null, null));
@@ -209,7 +209,7 @@
 	public void testGetFilteredService() {
 		ComponentInstance im = new FakeComponent();
 		ComponentInstance im2 = new FakeComponent();
-		ServiceRegistry registry = new ServiceRegistry(context);
+		ServiceRegistry registry = new ServiceRegistry(getContext());
 		
 		try {
 			assertNull("Check that there is no available service", registry.getServiceReferences(null, null));
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/FilteredExport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/FilteredExport.java
index 95cda20..a60b711 100644
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/FilteredExport.java
+++ b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/FilteredExport.java
@@ -35,7 +35,7 @@
 	ComponentInstance foo1 = null, foo2 = null;
 	
 	public void setUp() {
-		fooProvider = Utils.getFactoryByName(context, "BazProviderType");
+		fooProvider = Utils.getFactoryByName(getContext(), "BazProviderType");
 		assertNotNull("Check fooProvider availability", fooProvider);
 		
 		Properties p1 = new Properties();
@@ -53,7 +53,7 @@
 		foo1.stop();
 		foo2.stop();
 		
-		Factory factory = Utils.getFactoryByName(context, "composite.export.5");
+		Factory factory = Utils.getFactoryByName(getContext(), "composite.export.5");
 		Properties props = new Properties();
 		props.put("instance.name","export");
 		try {
@@ -76,7 +76,7 @@
 		export1.start();
 		
 		// Check that no foo service are available
-		assertEquals("Check no foo service", Utils.getServiceReferences(context, FooService.class.getName(), null).length, 0);
+		assertEquals("Check no foo service", Utils.getServiceReferences(getContext(), FooService.class.getName(), null).length, 0);
 		
 		// Test invalidity
 		assertTrue("Check invalidity - 0", export1.getState() == ComponentInstance.INVALID);
@@ -206,19 +206,19 @@
 	
 	
 	private boolean isFooServiceProvided() {
-		ServiceReference ref = Utils.getServiceReferenceByName(context, BazService.class.getName(), export1.getInstanceName());
+		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export1.getInstanceName());
 		return ref != null;
 	}
 	
 	private int countFooServiceProvided() {
-		ServiceReference[] refs = Utils.getServiceReferences(context, BazService.class.getName(), "(instance.name="+export1.getInstanceName()+")");
+		ServiceReference[] refs = Utils.getServiceReferences(getContext(), BazService.class.getName(), "(instance.name="+export1.getInstanceName()+")");
 		return refs.length;
 	}
 	
 	private boolean invoke() {
-		ServiceReference ref = Utils.getServiceReferenceByName(context, BazService.class.getName(), export1.getInstanceName());
+		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export1.getInstanceName());
 		if(ref == null) { return false; }
-		BazService fs = (BazService) context.getService(ref);
+		BazService fs = (BazService) getContext().getService(ref);
 		return fs.foo();
 	}
 	
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/MultipleExport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/MultipleExport.java
index 355f02a..7d452d0 100644
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/MultipleExport.java
+++ b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/MultipleExport.java
@@ -35,7 +35,7 @@
 	ComponentInstance foo1 = null, foo2 = null;
 
 	public void setUp() {
-		fooProvider = Utils.getFactoryByName(context, "BazProviderType");
+		fooProvider = Utils.getFactoryByName(getContext(), "BazProviderType");
 		assertNotNull("Check fooProvider availability", fooProvider);
 		
 		Properties p1 = new Properties();
@@ -53,7 +53,7 @@
 		foo1.stop();
 		foo2.stop();
 		
-		Factory factory = Utils.getFactoryByName(context, "composite.export.3");
+		Factory factory = Utils.getFactoryByName(getContext(), "composite.export.3");
 		Properties props = new Properties();
 		props.put("instance.name","export");
 		try {
@@ -76,7 +76,7 @@
 		export3.start();
 		
 		// Check that no foo service are available
-		assertEquals("Check no foo service", Utils.getServiceReferences(context, FooService.class.getName(), null).length, 0);
+		assertEquals("Check no foo service", Utils.getServiceReferences(getContext(), FooService.class.getName(), null).length, 0);
 		
 		// Test invalidity
 		assertTrue("Check invalidity - 0", export3.getState() == ComponentInstance.INVALID);
@@ -210,30 +210,30 @@
 	
 	
 	private boolean isFooServiceProvided() {
-		ServiceReference ref = Utils.getServiceReferenceByName(context, BazService.class.getName(), export3.getInstanceName());
+		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export3.getInstanceName());
 		return ref != null;
 	}
 	
 	private int countFooServiceProvided() {
-		ServiceReference[] refs = Utils.getServiceReferences(context, BazService.class.getName(), "(instance.name="+export3.getInstanceName()+")");
+		ServiceReference[] refs = Utils.getServiceReferences(getContext(), BazService.class.getName(), "(instance.name="+export3.getInstanceName()+")");
 		return refs.length;
 	}
 	
 	private boolean invoke() {
-		ServiceReference ref = Utils.getServiceReferenceByName(context, BazService.class.getName(), export3.getInstanceName());
+		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export3.getInstanceName());
 		if(ref == null) { return false; }
-		BazService fs = (BazService) context.getService(ref);
-		context.ungetService(ref);
+		BazService fs = (BazService) getContext().getService(ref);
+		getContext().ungetService(ref);
 		return fs.foo();
 	}
 	
 	private boolean invoke(int nb) {
-		ServiceReference[] refs = Utils.getServiceReferences(context, BazService.class.getName(), "(instance.name="+export3.getInstanceName()+")");
+		ServiceReference[] refs = Utils.getServiceReferences(getContext(), BazService.class.getName(), "(instance.name="+export3.getInstanceName()+")");
 		if(refs == null) { return false; }
 		if (nb > refs.length) { return false; }
 		for(int i = 0; i < nb; i++) {
-			BazService fs = (BazService) context.getService(refs[i]);
-			context.ungetService(refs[i]);
+			BazService fs = (BazService) getContext().getService(refs[i]);
+			getContext().ungetService(refs[i]);
 			if(!fs.foo()) { return false; }
 		}
 		return true;
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalExport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalExport.java
index be0babb..3879abe 100644
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalExport.java
+++ b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalExport.java
@@ -35,7 +35,7 @@
 	ComponentInstance foo1 = null, foo2 = null;
 
 	public void setUp() {
-		fooProvider = Utils.getFactoryByName(context, "BazProviderType");
+		fooProvider = Utils.getFactoryByName(getContext(), "BazProviderType");
 		assertNotNull("Check fooProvider availability", fooProvider);
 		
 		Properties p1 = new Properties();
@@ -53,7 +53,7 @@
 		foo1.stop();
 		foo2.stop();
 		
-		Factory factory = Utils.getFactoryByName(context, "composite.export.2");
+		Factory factory = Utils.getFactoryByName(getContext(), "composite.export.2");
 		Properties props = new Properties();
 		props.put("instance.name","export");
 		try {
@@ -76,7 +76,7 @@
 		export2.start();
 		
 		// Check that no foo service are available
-		assertEquals("Check no foo service", Utils.getServiceReferences(context, FooService.class.getName(), null).length, 0);
+		assertEquals("Check no foo service", Utils.getServiceReferences(getContext(), FooService.class.getName(), null).length, 0);
 		
 		// Test validity
 		assertTrue("Check validity - 0", export2.getState() == ComponentInstance.VALID);
@@ -210,19 +210,19 @@
 	
 	
 	private boolean isFooServiceProvided() {
-		ServiceReference ref = Utils.getServiceReferenceByName(context, BazService.class.getName(), export2.getInstanceName());
+		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export2.getInstanceName());
 		return ref != null;
 	}
 	
 	private int countFooServiceProvided() {
-		ServiceReference[] refs = Utils.getServiceReferences(context, BazService.class.getName(), "(instance.name="+export2.getInstanceName()+")");
+		ServiceReference[] refs = Utils.getServiceReferences(getContext(), BazService.class.getName(), "(instance.name="+export2.getInstanceName()+")");
 		return refs.length;
 	}
 	
 	private boolean invoke() {
-		ServiceReference ref = Utils.getServiceReferenceByName(context, BazService.class.getName(), export2.getInstanceName());
+		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export2.getInstanceName());
 		if(ref == null) { return false; }
-		BazService fs = (BazService) context.getService(ref);
+		BazService fs = (BazService) getContext().getService(ref);
 		return fs.foo();
 	}
 	
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalMultipleExport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalMultipleExport.java
index 38538be..9c38800 100644
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalMultipleExport.java
+++ b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalMultipleExport.java
@@ -35,7 +35,7 @@
 	ComponentInstance foo1 = null, foo2 = null;
 
 	public void setUp() {
-		fooProvider = Utils.getFactoryByName(context, "BazProviderType");
+		fooProvider = Utils.getFactoryByName(getContext(), "BazProviderType");
 		assertNotNull("Check fooProvider availability", fooProvider);
 		
 		Properties p1 = new Properties();
@@ -53,7 +53,7 @@
 		foo1.stop();
 		foo2.stop();
 		
-		Factory factory = Utils.getFactoryByName(context, "composite.export.4");
+		Factory factory = Utils.getFactoryByName(getContext(), "composite.export.4");
 		Properties props = new Properties();
 		props.put("instance.name","export");
 		try {
@@ -76,7 +76,7 @@
 		export3.start();
 		
 		// Check that no foo service are available
-		assertEquals("Check no foo service", Utils.getServiceReferences(context, FooService.class.getName(), null).length, 0);
+		assertEquals("Check no foo service", Utils.getServiceReferences(getContext(), FooService.class.getName(), null).length, 0);
 		
 		// Test invalidity
 		assertTrue("Check validity - 0", export3.getState() == ComponentInstance.VALID);
@@ -210,30 +210,30 @@
 	
 	
 	private boolean isFooServiceProvided() {
-		ServiceReference ref = Utils.getServiceReferenceByName(context, BazService.class.getName(), export3.getInstanceName());
+		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export3.getInstanceName());
 		return ref != null;
 	}
 	
 	private int countFooServiceProvided() {
-		ServiceReference[] refs = Utils.getServiceReferences(context, BazService.class.getName(), "(instance.name="+export3.getInstanceName()+")");
+		ServiceReference[] refs = Utils.getServiceReferences(getContext(), BazService.class.getName(), "(instance.name="+export3.getInstanceName()+")");
 		return refs.length;
 	}
 	
 	private boolean invoke() {
-		ServiceReference ref = Utils.getServiceReferenceByName(context, BazService.class.getName(), export3.getInstanceName());
+		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export3.getInstanceName());
 		if(ref == null) { return false; }
-		BazService fs = (BazService) context.getService(ref);
-		context.ungetService(ref);
+		BazService fs = (BazService) getContext().getService(ref);
+		getContext().ungetService(ref);
 		return fs.foo();
 	}
 	
 	private boolean invoke(int nb) {
-		ServiceReference[] refs = Utils.getServiceReferences(context, BazService.class.getName(), "(instance.name="+export3.getInstanceName()+")");
+		ServiceReference[] refs = Utils.getServiceReferences(getContext(), BazService.class.getName(), "(instance.name="+export3.getInstanceName()+")");
 		if(refs == null) { return false; }
 		if (nb > refs.length) { return false; }
 		for(int i = 0; i < nb; i++) {
-			BazService fs = (BazService) context.getService(refs[i]);
-			context.ungetService(refs[i]);
+			BazService fs = (BazService) getContext().getService(refs[i]);
+			getContext().ungetService(refs[i]);
 			if(!fs.foo()) { return false; }
 		}
 		return true;
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/SimpleExport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/SimpleExport.java
index 22f51c9..54418e6 100644
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/SimpleExport.java
+++ b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/SimpleExport.java
@@ -35,7 +35,7 @@
 	ComponentInstance foo1 = null, foo2 = null;
 
 	public void setUp() {
-		fooProvider = Utils.getFactoryByName(context, "BazProviderType");
+		fooProvider = Utils.getFactoryByName(getContext(), "BazProviderType");
 		assertNotNull("Check fooProvider availability", fooProvider);
 		
 		Properties p1 = new Properties();
@@ -53,7 +53,7 @@
 		foo1.stop();
 		foo2.stop();
 		
-		Factory factory = Utils.getFactoryByName(context, "composite.export.1");
+		Factory factory = Utils.getFactoryByName(getContext(), "composite.export.1");
 		Properties props = new Properties();
 		props.put("instance.name","export");
 		try {
@@ -76,7 +76,7 @@
 		export1.start();
 		
 		// Check that no foo service are available
-		assertEquals("Check no foo service", Utils.getServiceReferences(context, FooService.class.getName(), null).length, 0);
+		assertEquals("Check no foo service", Utils.getServiceReferences(getContext(), FooService.class.getName(), null).length, 0);
 		
 		// Test invalidity
 		assertTrue("Check invalidity - 0", export1.getState() == ComponentInstance.INVALID);
@@ -210,19 +210,19 @@
 	
 	
 	private boolean isFooServiceProvided() {
-		ServiceReference ref = Utils.getServiceReferenceByName(context, BazService.class.getName(), export1.getInstanceName());
+		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export1.getInstanceName());
 		return ref != null;
 	}
 	
 	private int countFooServiceProvided() {
-		ServiceReference[] refs = Utils.getServiceReferences(context, BazService.class.getName(), "(instance.name="+export1.getInstanceName()+")");
+		ServiceReference[] refs = Utils.getServiceReferences(getContext(), BazService.class.getName(), "(instance.name="+export1.getInstanceName()+")");
 		return refs.length;
 	}
 	
 	private boolean invoke() {
-		ServiceReference ref = Utils.getServiceReferenceByName(context, BazService.class.getName(), export1.getInstanceName());
+		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export1.getInstanceName());
 		if(ref == null) { return false; }
-		BazService fs = (BazService) context.getService(ref);
+		BazService fs = (BazService) getContext().getService(ref);
 		return fs.foo();
 	}
 	
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedFilteredImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedFilteredImport.java
index 653ccb2..c712945 100644
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedFilteredImport.java
+++ b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedFilteredImport.java
@@ -38,7 +38,7 @@
 		
 		Properties p = new Properties();
 		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(context, "composite.requires.1");
+		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.1");
 		try {
 			import1 = compFact.createComponentInstance(p);
 		} catch(Exception e) {
@@ -47,7 +47,7 @@
 		
 		import1.stop();
 		
-		fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
+		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
 		assertNotNull("Check fooProvider availability", fooProvider);
 		
 		Properties p1 = new Properties();
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedMultipleImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedMultipleImport.java
index 72c08f7..f215040 100644
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedMultipleImport.java
+++ b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedMultipleImport.java
@@ -38,7 +38,7 @@
 		
 		Properties p = new Properties();
 		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(context, "composite.requires.2");
+		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.2");
 		try {
 			import2 = compFact.createComponentInstance(p);
 		} catch(Exception e) {
@@ -47,7 +47,7 @@
 		
 		import2.stop();
 		
-		fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
+		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
 		assertNotNull("Check fooProvider availability", fooProvider);
 		
 		Properties p1 = new Properties();
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalImport.java
index 06dad59..38cff7d 100644
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalImport.java
+++ b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalImport.java
@@ -38,7 +38,7 @@
 		
 		Properties p = new Properties();
 		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(context, "composite.requires.3");
+		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.3");
 		try {
 			import3 = compFact.createComponentInstance(p);
 		} catch(Exception e) {
@@ -47,7 +47,7 @@
 		
 		import3.stop();
 		
-		fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
+		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
 		assertNotNull("Check fooProvider availability", fooProvider);
 		
 		Properties p1 = new Properties();
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalMultipleImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalMultipleImport.java
index 06018f5..3cfa5e5 100644
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalMultipleImport.java
+++ b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalMultipleImport.java
@@ -38,7 +38,7 @@
 		
 		Properties p = new Properties();
 		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(context, "composite.requires.4");
+		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.4");
 		try {
 			import4 = compFact.createComponentInstance(p);
 		} catch(Exception e) {
@@ -47,7 +47,7 @@
 		
 		import4.stop();
 		
-		fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
+		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
 		assertNotNull("Check fooProvider availability", fooProvider);
 		
 		Properties p1 = new Properties();
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedSimpleImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedSimpleImport.java
index b416663..82deca3 100644
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedSimpleImport.java
+++ b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedSimpleImport.java
@@ -38,7 +38,7 @@
 		
 		Properties p = new Properties();
 		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(context, "composite.requires.1");
+		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.1");
 		try {
 			import1 = compFact.createComponentInstance(p);
 		} catch(Exception e) {
@@ -47,7 +47,7 @@
 		
 		import1.stop();
 		
-		fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
+		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
 		assertNotNull("Check fooProvider availability", fooProvider);
 		
 		Properties p1 = new Properties();
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/FilteredImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/FilteredImport.java
index d50be8d..761bd41 100644
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/FilteredImport.java
+++ b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/FilteredImport.java
@@ -39,7 +39,7 @@
 	public void setUp() {
 		Properties p = new Properties();
 		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(context, "composite.requires.5");
+		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.5");
 		try {
 			import1 = compFact.createComponentInstance(p);
 		} catch(Exception e) {
@@ -47,10 +47,10 @@
 		}
 		import1.stop();
 		
-		fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
+		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
 		assertNotNull("Check fooProvider availability", fooProvider);
 		
-		fooProvider2 = Utils.getFactoryByName(context, "COMPO-FooProviderType-2");
+		fooProvider2 = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-2");
 		assertNotNull("Check fooProvider availability", fooProvider2);
 		
 		Properties p1 = new Properties();
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/MultipleImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/MultipleImport.java
index eb54bac..135c6c8 100644
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/MultipleImport.java
+++ b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/MultipleImport.java
@@ -34,12 +34,12 @@
 	Factory fooProvider;
 
 	public void setUp() {
-		fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
+		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
 		assertNotNull("Check fooProvider availability", fooProvider);
 		
 		Properties p = new Properties();
 		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(context, "composite.requires.2");
+		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.2");
 		try {
 			import2 = compFact.createComponentInstance(p);
 		} catch(Exception e) {
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalImport.java
index f24a46c..985b834 100644
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalImport.java
+++ b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalImport.java
@@ -34,12 +34,12 @@
 	Factory fooProvider;
 
 	public void setUp() {
-		fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
+		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
 		assertNotNull("Check fooProvider availability", fooProvider);
 		
 		Properties p = new Properties();
 		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(context, "composite.requires.3");
+		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.3");
 		try {
 			import3 = compFact.createComponentInstance(p);
 		} catch(Exception e) {
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalMultipleImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalMultipleImport.java
index e00d1ec..4269ef5 100644
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalMultipleImport.java
+++ b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalMultipleImport.java
@@ -34,12 +34,12 @@
 	Factory fooProvider;
 
 	public void setUp() {
-		fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
+		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
 		assertNotNull("Check fooProvider availability", fooProvider);
 		
 		Properties p = new Properties();
 		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(context, "composite.requires.4");
+		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.4");
 		try {
 			import2 = compFact.createComponentInstance(p);
 		} catch(Exception e) {
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/SimpleImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/SimpleImport.java
index 429bac0..897d6e7 100644
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/SimpleImport.java
+++ b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/SimpleImport.java
@@ -34,12 +34,12 @@
 	Factory fooProvider;
 
 	public void setUp() {
-		fooProvider = Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
+		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
 		assertNotNull("Check fooProvider availability", fooProvider);
 		
 		Properties p = new Properties();
 		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(context, "composite.requires.1");
+		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.1");
 		try {
 			import1 = compFact.createComponentInstance(p);
 		} catch(Exception e) {
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instance/InstanceScopeTest.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instance/InstanceScopeTest.java
index 7067245..6634062 100644
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instance/InstanceScopeTest.java
+++ b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instance/InstanceScopeTest.java
@@ -18,7 +18,7 @@
     ComponentInstance instance;
     
     public void setUp() {
-        factory = (CompositeFactory) Utils.getFactoryByName(context, "SCOPE-scope");
+        factory = (CompositeFactory) Utils.getFactoryByName(getContext(), "SCOPE-scope");
         assertNotNull("Factory", factory);
         try {
             instance = factory.createComponentInstance(null);
@@ -35,9 +35,9 @@
     }
     
     public void testScope() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance.getInstanceName());
         assertNotNull("Check architecture availability", ref);
-        Architecture arch = (Architecture) context.getService(ref);
+        Architecture arch = (Architecture) getContext().getService(ref);
         assertTrue("Validity", arch.getInstanceDescription().getState() == ComponentInstance.VALID);
         
         // Get internal service
@@ -53,12 +53,12 @@
     }
     
     public void testGlobalUnavailability() {
-        ServiceReference ref2 = Utils.getServiceReference(context, Service.class.getName(), null);
+        ServiceReference ref2 = Utils.getServiceReference(getContext(), Service.class.getName(), null);
         assertNull("Check Service unavailability", ref2);
     }
     
     public void testScopeUnvailability() {
-        CompositeFactory factory2 = (CompositeFactory) Utils.getFactoryByName(context, "SCOPE-badscope");
+        CompositeFactory factory2 = (CompositeFactory) Utils.getFactoryByName(getContext(), "SCOPE-badscope");
         assertNotNull("Factory", factory2);
         ComponentInstance instance2 = null;
         try {
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instance/SimpleInstance.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instance/SimpleInstance.java
index b194b36..f7e2cff 100644
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instance/SimpleInstance.java
+++ b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instance/SimpleInstance.java
@@ -39,10 +39,10 @@
 	
 	
 	public void setUp() {
-        fooFactory1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooProviderType-1");
-        fooFactory2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooProviderType-Dyn2");
-        compoFactory = (ComponentFactory) Utils.getFactoryByName(context, "composite.inst.1");
-		Factory fact = Utils.getFactoryByName(context, "composite.empty");
+        fooFactory1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
+        fooFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-Dyn2");
+        compoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "composite.inst.1");
+		Factory fact = Utils.getFactoryByName(getContext(), "composite.empty");
 		Properties props = new Properties();
 		props.put("instance.name","empty-X");
 		try {
@@ -192,9 +192,9 @@
 		} catch(Exception e) {
 			fail("Cannot instantiate under : " + e.getMessage());
 		}
-		ServiceReference ref = Utils.getServiceReference(context, Architecture.class.getName(), "(architecture.instance=under)");
+		ServiceReference ref = Utils.getServiceReference(getContext(), Architecture.class.getName(), "(architecture.instance=under)");
 		assertNotNull("Check architecture availability", ref);
-		Architecture arch = (Architecture) context.getService(ref);
+		Architecture arch = (Architecture) getContext().getService(ref);
 		InstanceDescription id = arch.getInstanceDescription();
 		
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
@@ -204,15 +204,15 @@
 		assertEquals("Check instance name" , id.getName(), "under");
 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");
 		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
+		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
+		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
+		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
 		
 		fact1.stop();
 		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReference(context, Architecture.class.getName(), "(architecture.instance=under)");
+		ref = Utils.getServiceReference(getContext(), Architecture.class.getName(), "(architecture.instance=under)");
 		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) context.getService(ref);
+		arch = (Architecture) getContext().getService(ref);
 		id = arch.getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		contained = id.getContainedInstances();
@@ -223,9 +223,9 @@
 		
 		fact2.stop();
 		assertTrue("Check instance validity - 3", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "under");
+		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
 		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) context.getService(ref);
+		arch = (Architecture) getContext().getService(ref);
 		id = arch.getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		contained = id.getContainedInstances();
@@ -236,9 +236,9 @@
 
 		fact3.stop();
 		assertTrue("Check instance invalidity", under.getState() == ComponentInstance.INVALID);
-		ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "under");
+		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
 		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) context.getService(ref);
+		arch = (Architecture) getContext().getService(ref);
 		id = arch.getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.INVALID);
 		contained = id.getContainedInstances();
@@ -249,9 +249,9 @@
 
 		fact1.start();
 		assertTrue("Check instance validity - 4", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "under");
+		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
 		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) context.getService(ref);
+		arch = (Architecture) getContext().getService(ref);
 		id = arch.getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		contained = id.getContainedInstances();
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/ConfigurableInstantiation.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/ConfigurableInstantiation.java
index 00f48b5..2f035ea 100644
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/ConfigurableInstantiation.java
+++ b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/ConfigurableInstantiation.java
@@ -36,9 +36,9 @@
 	private ComponentFactory refuse2F;
 	
 	public void setUp() {
-		acceptF = (ComponentFactory) Utils.getFactoryByName(context, "composite.bar.5-accept");
-		refuse1F = (ComponentFactory) Utils.getFactoryByName(context, "composite.bar.5-refuse1");
-		refuse2F = (ComponentFactory) Utils.getFactoryByName(context, "composite.bar.5-refuse2");
+		acceptF = (ComponentFactory) Utils.getFactoryByName(getContext(), "composite.bar.5-accept");
+		refuse1F = (ComponentFactory) Utils.getFactoryByName(getContext(), "composite.bar.5-refuse1");
+		refuse2F = (ComponentFactory) Utils.getFactoryByName(getContext(), "composite.bar.5-refuse2");
 		
 	}
 	
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/MultipleInstantiation.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/MultipleInstantiation.java
index 6974e4f..8b999e8 100644
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/MultipleInstantiation.java
+++ b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/MultipleInstantiation.java
@@ -37,8 +37,8 @@
 	private ComponentInstance empty;
 	
 	public void setUp() {
-		bar2Factory = (ComponentFactory) Utils.getFactoryByName(context, "composite.bar.2");
-		Factory fact = Utils.getFactoryByName(context, "composite.empty");
+		bar2Factory = (ComponentFactory) Utils.getFactoryByName(getContext(), "composite.bar.2");
+		Factory fact = Utils.getFactoryByName(getContext(), "composite.empty");
 		Properties props = new Properties();
 		props.put("instance.name","empty");
 		try {
@@ -128,9 +128,9 @@
 		ServiceContext sc = Utils.getServiceContext(under);
 		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
 		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
+		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
+		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
+		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
 		
 		fact1.stop();
 		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
@@ -166,9 +166,9 @@
 		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
 		ServiceContext sc2 = Utils.getServiceContext(under);
 		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
+		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
+		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
+		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
 		
 		fact1.stop();
 		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
@@ -199,9 +199,9 @@
 		} catch(Exception e) {
 			fail("Cannot instantiate under : " + e.getMessage());
 		}
-		ServiceReference ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "under");
+		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
 		assertNotNull("Check architecture availability", ref);
-		Architecture arch = (Architecture) context.getService(ref);
+		Architecture arch = (Architecture) getContext().getService(ref);
 		InstanceDescription id = arch.getInstanceDescription();
 		
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
@@ -211,15 +211,15 @@
 		assertEquals("Check instance name" , id.getName(), "under");
 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.2");
 		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
+		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
+		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
+		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
 		
 		fact1.stop();
 		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "under");
+		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
 		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) context.getService(ref);
+		arch = (Architecture) getContext().getService(ref);
 		id = arch.getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		contained = id.getContainedInstances();
@@ -230,9 +230,9 @@
 		
 		fact2.stop();
 		assertTrue("Check instance validity - 3", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "under");
+		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
 		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) context.getService(ref);
+		arch = (Architecture) getContext().getService(ref);
 		id = arch.getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		contained = id.getContainedInstances();
@@ -243,9 +243,9 @@
 
 		fact3.stop();
 		assertTrue("Check instance invalidity", under.getState() == ComponentInstance.INVALID);
-		ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "under");
+		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
 		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) context.getService(ref);
+		arch = (Architecture) getContext().getService(ref);
 		id = arch.getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.INVALID);
 		contained = id.getContainedInstances();
@@ -256,9 +256,9 @@
 
 		fact1.start();
 		assertTrue("Check instance validity - 4", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "under");
+		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
 		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) context.getService(ref);
+		arch = (Architecture) getContext().getService(ref);
 		id = arch.getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		contained = id.getContainedInstances();
@@ -267,7 +267,7 @@
 		assertEquals("Check instance name" , id.getName(), "under");
 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.2");
 
-		context.ungetService(ref);
+		getContext().ungetService(ref);
 		under.dispose();
 		fact2.start();
 		fact3.start();
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalInstantiation.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalInstantiation.java
index c6480b4..09cbd4b 100644
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalInstantiation.java
+++ b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalInstantiation.java
@@ -37,8 +37,8 @@
 	private ComponentInstance empty;
 	
 	public void setUp() {
-		bar1Factory = (ComponentFactory) Utils.getFactoryByName(context, "composite.bar.3");
-		Factory fact = Utils.getFactoryByName(context, "composite.empty");
+		bar1Factory = (ComponentFactory) Utils.getFactoryByName(getContext(), "composite.bar.3");
+		Factory fact = Utils.getFactoryByName(getContext(), "composite.empty");
 		Properties props = new Properties();
 		props.put("instance.name","empty");
 		try {
@@ -124,9 +124,9 @@
 		}
 		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
 		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
+		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
+		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
+		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
 		
 		fact1.stop();
 		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
@@ -159,9 +159,9 @@
 		}
 		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
 		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
+		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
+		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
+		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
 		
 		fact1.stop();
 		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
@@ -190,9 +190,9 @@
 			fail("Cannot instantiate under : " + e.getMessage());
 		}
 		
-		ServiceReference ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "under");
+		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
 		assertNotNull("Check architecture availability", ref);
-		Architecture arch = (Architecture) context.getService(ref);
+		Architecture arch = (Architecture) getContext().getService(ref);
 		assertNotNull("Check architecture", arch);
 		InstanceDescription id = arch.getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
@@ -203,16 +203,16 @@
 		assertEquals("Check instance name" , id.getName(), "under");
 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.3");
 		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
+		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
+		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
+		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
 		
 		
 		fact1.stop();
 		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "under");
+		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
 		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) context.getService(ref);
+		arch = (Architecture) getContext().getService(ref);
 		id = arch.getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		contained = id.getContainedInstances();
@@ -223,9 +223,9 @@
 		
 		fact2.stop();
 		assertTrue("Check instance validity - 3", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "under");
+		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
 		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) context.getService(ref);
+		arch = (Architecture) getContext().getService(ref);
 		id = arch.getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		contained = id.getContainedInstances();
@@ -236,9 +236,9 @@
 
 		fact3.stop();
 		assertTrue("Check instance invalidity", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "under");
+		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
 		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) context.getService(ref);
+		arch = (Architecture) getContext().getService(ref);
 		id = arch.getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		contained = id.getContainedInstances();
@@ -249,9 +249,9 @@
 
 		fact1.start();
 		assertTrue("Check instance validity - 4", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "under");
+		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
 		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) context.getService(ref);
+		arch = (Architecture) getContext().getService(ref);
 		id = arch.getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		contained = id.getContainedInstances();
@@ -260,7 +260,7 @@
 		assertEquals("Check instance name" , id.getName(), "under");
 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.3");
 
-		context.ungetService(ref);
+		getContext().ungetService(ref);
 		under.dispose();
 		fact2.start();
 		fact3.start();
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalMultipleInstantiation.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalMultipleInstantiation.java
index db7ecce..d27643e 100644
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalMultipleInstantiation.java
+++ b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalMultipleInstantiation.java
@@ -34,10 +34,10 @@
 	private ComponentInstance empty;
 	
 	public void setUp() {
-		bar2Factory = (ComponentFactory) Utils.getFactoryByName(context, "composite.bar.4");
+		bar2Factory = (ComponentFactory) Utils.getFactoryByName(getContext(), "composite.bar.4");
 		assertNotNull("Check bar2factory availability", bar2Factory);
 		
-		Factory fact = Utils.getFactoryByName(context, "composite.empty");
+		Factory fact = Utils.getFactoryByName(getContext(), "composite.empty");
 		Properties props = new Properties();
 		props.put("instance.name","empty");
 		try {
@@ -127,9 +127,9 @@
 		ServiceContext sc = Utils.getServiceContext(under);
 		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
 		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
+		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
+		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
+		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
 		
 		fact1.stop();
 		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
@@ -165,9 +165,9 @@
 		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
 		ServiceContext sc2 = Utils.getServiceContext(under);
 		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
+		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
+		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
+		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
 		
 		fact1.stop();
 		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/SimpleInstantiation.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/SimpleInstantiation.java
index 0b2414f..193adaf 100644
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/SimpleInstantiation.java
+++ b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/SimpleInstantiation.java
@@ -37,8 +37,8 @@
 	private ComponentInstance empty;
 	
 	public void setUp() {
-		bar1Factory = (ComponentFactory) Utils.getFactoryByName(context, "composite.bar.1");
-		Factory fact = Utils.getFactoryByName(context, "composite.empty");
+		bar1Factory = (ComponentFactory) Utils.getFactoryByName(getContext(), "composite.bar.1");
+		Factory fact = Utils.getFactoryByName(getContext(), "composite.empty");
 		Properties props = new Properties();
 		props.put("instance.name","empty-X");
 		try {
@@ -125,9 +125,9 @@
 		}
 		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
 		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
+		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
+		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
+		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
 		
 		
 		fact1.stop();
@@ -159,9 +159,9 @@
 		}
 		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
 		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
+		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
+		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
+		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
 		
 		fact1.stop();
 		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
@@ -189,9 +189,9 @@
 		} catch(Exception e) {
 			fail("Cannot instantiate under : " + e.getMessage());
 		}
-		ServiceReference ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "under");
+		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
 		assertNotNull("Check architecture availability", ref);
-		Architecture arch = (Architecture) context.getService(ref);
+		Architecture arch = (Architecture) getContext().getService(ref);
 		InstanceDescription id = arch.getInstanceDescription();
 		
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
@@ -201,15 +201,15 @@
 		assertEquals("Check instance name" , id.getName(), "under");
 		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");
 		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(context, "COMPO-FooBarProviderType-3");
+		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
+		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
+		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
 		
 		fact1.stop();
 		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "under");
+		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
 		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) context.getService(ref);
+		arch = (Architecture) getContext().getService(ref);
 		id = arch.getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		contained = id.getContainedInstances();
@@ -220,9 +220,9 @@
 		
 		fact2.stop();
 		assertTrue("Check instance validity - 3", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "under");
+		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
 		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) context.getService(ref);
+		arch = (Architecture) getContext().getService(ref);
 		id = arch.getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		contained = id.getContainedInstances();
@@ -233,9 +233,9 @@
 
 		fact3.stop();
 		assertTrue("Check instance invalidity", under.getState() == ComponentInstance.INVALID);
-		ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "under");
+		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
 		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) context.getService(ref);
+		arch = (Architecture) getContext().getService(ref);
 		id = arch.getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.INVALID);
 		contained = id.getContainedInstances();
@@ -246,9 +246,9 @@
 
 		fact1.start();
 		assertTrue("Check instance validity - 4", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "under");
+		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
 		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) context.getService(ref);
+		arch = (Architecture) getContext().getService(ref);
 		id = arch.getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		contained = id.getContainedInstances();
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp0.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp0.java
index 8e96fc7..5e936b3 100644
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp0.java
+++ b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp0.java
@@ -41,9 +41,9 @@
     private ComponentInstance under;
     
     public void setUp() {
-        tataFactory = (ComponentFactory) Utils.getFactoryByName(context, "tata");
-        totoFactory = (ComponentFactory) Utils.getFactoryByName(context, "toto");
-        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(context, "comp-6");
+        tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
+        totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
+        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "comp-6");
         tataFactory2.stop();
         tataFactory.stop();
         
@@ -66,7 +66,7 @@
         totoProv.stop();
         totoProv2.stop();
         
-        Factory factory = Utils.getFactoryByName(context, "comp-0");
+        Factory factory = Utils.getFactoryByName(getContext(), "comp-0");
         Properties props2 = new Properties();
         props2.put("instance.name","ff");
         try {
@@ -96,20 +96,20 @@
     public void testSimple() {
         // Neither factory nor instance
         assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 1", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 1", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the importer
         totoProv.start();
-        assertNotNull("Assert toto service - 1", context.getServiceReference(Toto.class.getName()));
+        assertNotNull("Assert toto service - 1", getContext().getServiceReference(Toto.class.getName()));
         assertTrue("Assert under state - 2", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 2", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 2", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the factory
         tataFactory.start();
         assertTrue("Assert under state - 3", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 3", context.getServiceReference(Tota.class.getName()));
-        ServiceReference ref = context.getServiceReference(Tota.class.getName());
-        Tota tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 3", getContext().getServiceReference(Tota.class.getName()));
+        ServiceReference ref = getContext().getServiceReference(Tota.class.getName());
+        Tota tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         Properties props = tota.getProps();
@@ -144,15 +144,15 @@
         assertEquals("Assert tata5_1 - 3", tata5_1.intValue(), 1);
         assertEquals("Assert tata5_2 - 3", tata5_2.intValue(), 1);
         
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Start a second import
         totoProv2.start();
         assertTrue("Assert under state - 4", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 4", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 4", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         props = tota.getProps();
@@ -187,19 +187,19 @@
         assertEquals("Assert tata5_1 - 4", tata5_1.intValue(), 2);
         assertEquals("Assert tata5_2 - 4", tata5_2.intValue(), 2);
         
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         tataFactory.stop();
         assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 5", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 5", getContext().getServiceReference(Tota.class.getName()));
         
         totoProv2.stop();
         tataFactory.start();
         assertTrue("Assert under state - 6", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 6", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 6", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         props = tota.getProps();
@@ -234,17 +234,17 @@
         assertEquals("Assert tata5_1 - 6", tata5_1.intValue(), 1);
         assertEquals("Assert tata5_2 - 6", tata5_2.intValue(), 1);
         
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Is arch exposed
-        assertNotNull("Test arch", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
+        assertNotNull("Test arch", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
         
         totoProv.stop();
         
         assertTrue("Assert under state - 7", under.getState() == ComponentInstance.INVALID);
-        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
-        assertNull("Assert no tota service - 7", context.getServiceReference(Tota.class.getName()));
+        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
+        assertNull("Assert no tota service - 7", getContext().getServiceReference(Tota.class.getName()));
         
         under.dispose();
         under = null;
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp1.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp1.java
index f59961a..17613fc 100644
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp1.java
+++ b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp1.java
@@ -40,9 +40,9 @@
 	private ComponentFactory tataFactory2;
     
     public void setUp() {
-        tataFactory = (ComponentFactory) Utils.getFactoryByName(context, "tata");
-        totoFactory = (ComponentFactory) Utils.getFactoryByName(context, "toto");
-        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(context, "comp-6");
+        tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
+        totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
+        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "comp-6");
         tataFactory2.stop();
         
         tataFactory.stop();
@@ -66,7 +66,7 @@
         totoProv.stop();
         totoProv2.stop();
         
-        Factory factory = Utils.getFactoryByName(context, "comp-1");
+        Factory factory = Utils.getFactoryByName(getContext(), "comp-1");
         Properties props2 = new Properties();
         try {
             under = factory.createComponentInstance(props2);
@@ -95,19 +95,19 @@
     public void testSimple() {
         // Neither factory nor instance
         assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 1", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 1", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the importer
         totoProv.start();
         assertTrue("Assert under state - 2 ("+under.getState()+")", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 2", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 2", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the factory
         tataFactory.start();
         assertTrue("Assert under state - 3", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 3", context.getServiceReference(Tota.class.getName()));
-        ServiceReference ref = context.getServiceReference(Tota.class.getName());
-        Tota tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 3", getContext().getServiceReference(Tota.class.getName()));
+        ServiceReference ref = getContext().getServiceReference(Tota.class.getName());
+        Tota tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         Properties props = tota.getProps();
@@ -142,15 +142,15 @@
         assertEquals("Assert tata5_1 - 3", tata5_1.intValue(), 1);
         assertEquals("Assert tata5_2 - 3", tata5_2.intValue(), 1);
         
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Start a second import
         totoProv2.start();
         assertTrue("Assert under state - 4", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 4", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 4", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         props = tota.getProps();
@@ -185,19 +185,19 @@
         assertEquals("Assert tata5_1 - 4", tata5_1.intValue(), 2);
         assertEquals("Assert tata5_2 - 4", tata5_2.intValue(), 2);
         
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         tataFactory.stop();
         assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 5", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 5", getContext().getServiceReference(Tota.class.getName()));
         
         totoProv2.stop();
         tataFactory.start();
         assertTrue("Assert under state - 6", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 6", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 6", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         props = tota.getProps();
@@ -232,17 +232,17 @@
         assertEquals("Assert tata5_1 - 6", tata5_1.intValue(), 1);
         assertEquals("Assert tata5_2 - 6", tata5_2.intValue(), 1);
         
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Is arch exposed
-        assertNotNull("Test arch", Utils.getServiceReferenceByName(context, Architecture.class.getName(), under.getInstanceName()));
+        assertNotNull("Test arch", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), under.getInstanceName()));
         
         totoProv.stop();
         
         assertTrue("Assert under state - 7", under.getState() == ComponentInstance.INVALID);
-        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(context, Architecture.class.getName(), under.getInstanceName()));
-        assertNull("Assert no tota service - 7", context.getServiceReference(Tota.class.getName()));
+        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), under.getInstanceName()));
+        assertNull("Assert no tota service - 7", getContext().getServiceReference(Tota.class.getName()));
         
         under.dispose();
         under = null;
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp2.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp2.java
index 3628c7a..43e79b7 100644
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp2.java
+++ b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp2.java
@@ -40,9 +40,9 @@
 	private ComponentFactory tataFactory2;
 
     public void setUp() {
-        tataFactory = (ComponentFactory) Utils.getFactoryByName(context, "tata");
-        totoFactory = (ComponentFactory) Utils.getFactoryByName(context, "toto");
-        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(context, "comp-6");
+        tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
+        totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
+        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "comp-6");
         tataFactory2.stop();
         tataFactory.stop();
         
@@ -65,7 +65,7 @@
         totoProv.stop();
         totoProv2.stop();
         
-        Factory factory = Utils.getFactoryByName(context, "comp-2");
+        Factory factory = Utils.getFactoryByName(getContext(), "comp-2");
         Properties props2 = new Properties();
         props2.put("instance.name","ff");
         try {
@@ -95,19 +95,19 @@
     public void testSimple() {
         // Neither factory nor instance
         assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 1", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 1", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the importer
         totoProv.start();
         assertTrue("Assert under state - 2 ("+under.getState()+")", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 2", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 2", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the factory
         tataFactory.start();
         assertTrue("Assert under state - 3", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 3", context.getServiceReference(Tota.class.getName()));
-        ServiceReference ref = context.getServiceReference(Tota.class.getName());
-        Tota tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 3", getContext().getServiceReference(Tota.class.getName()));
+        ServiceReference ref = getContext().getServiceReference(Tota.class.getName());
+        Tota tota = (Tota) getContext().getService(ref);
         
         invokeAll(tota);
         
@@ -128,15 +128,15 @@
         Integer tata = (Integer) props.get("tata");
         assertEquals("Assert tata - 3", tata.intValue(), 1);
         
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Start a second import
         totoProv2.start();
         assertTrue("Assert under state - 4", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 4", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 4", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         props = tota.getProps();
@@ -155,19 +155,19 @@
         tata = (Integer) props.get("tata");
         assertEquals("Assert tata - 4", tata.intValue(), 2);
         
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         tataFactory.stop();
         assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 5", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 5", getContext().getServiceReference(Tota.class.getName()));
         
         totoProv2.stop();
         tataFactory.start();
         assertTrue("Assert under state - 6", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 6", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 6", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         props = tota.getProps();
@@ -186,17 +186,17 @@
         tata = (Integer) props.get("tata");
         assertEquals("Assert tata - 6", tata.intValue(), 1);
         
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Is arch exposed
-        assertNotNull("Test arch", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
+        assertNotNull("Test arch", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
         
         totoProv.stop();
         
         assertTrue("Assert under state - 7", under.getState() == ComponentInstance.INVALID);
-        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
-        assertNull("Assert no tota service - 7", context.getServiceReference(Tota.class.getName()));
+        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
+        assertNull("Assert no tota service - 7", getContext().getServiceReference(Tota.class.getName()));
         
         under.dispose();
         under = null;
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp3.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp3.java
index 9d8445a..41703e5 100644
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp3.java
+++ b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp3.java
@@ -40,9 +40,9 @@
 	private ComponentFactory tataFactory2;  
     
     public void setUp() {
-        tataFactory = (ComponentFactory) Utils.getFactoryByName(context, "tata");
-        totoFactory = (ComponentFactory) Utils.getFactoryByName(context, "toto");
-        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(context, "comp-6");
+        tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
+        totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
+        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "comp-6");
         tataFactory2.stop();
         tataFactory.stop();
         
@@ -65,7 +65,7 @@
         totoProv.stop();
         totoProv2.stop();
         
-        Factory factory = Utils.getFactoryByName(context, "comp-3");
+        Factory factory = Utils.getFactoryByName(getContext(), "comp-3");
         Properties props2 = new Properties();
         props2.put("instance.name","ff");
         try {
@@ -95,19 +95,19 @@
     public void testSimple() {
         // Neither factory nor instance
         assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 1", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 1", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the importer
         totoProv.start();
         assertTrue("Assert under state - 2 ("+under.getState()+")", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 2", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 2", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the factory
         tataFactory.start();
         assertTrue("Assert under state - 3", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 3", context.getServiceReference(Tota.class.getName()));
-        ServiceReference ref = context.getServiceReference(Tota.class.getName());
-        Tota tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 3", getContext().getServiceReference(Tota.class.getName()));
+        ServiceReference ref = getContext().getServiceReference(Tota.class.getName());
+        Tota tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         Properties props = tota.getProps();
@@ -126,15 +126,15 @@
         Integer tata = (Integer) props.get("tata");
         assertEquals("Assert tata - 3", tata.intValue(), 1);
         
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Start a second import
         totoProv2.start();
         assertTrue("Assert under state - 4", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 4", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 4", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         props = tota.getProps();
         toto = (Integer) props.get("toto");
@@ -151,37 +151,37 @@
         props = tota.getPropsTata();
         tata = (Integer) props.get("tata");
         assertEquals("Assert tata - 4", tata.intValue(), 2);
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Stop the factory
         tataFactory.stop();
         assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 5", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 5", getContext().getServiceReference(Tota.class.getName()));
         
         totoProv2.stop();
         totoProv.stop();
         tataFactory.start();
         assertTrue("Assert under state - 6", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 6", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 6", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAllOpt(tota);
         //Check tata
         props = tota.getPropsTata();
         tata = (Integer) props.get("tata");
         assertEquals("Assert tata - 4", tata.intValue(), 1);
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Is arch exposed
-        assertNotNull("Test arch", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
+        assertNotNull("Test arch", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
         
         tataFactory.stop();
         
         assertTrue("Assert under state - 7", under.getState() == ComponentInstance.INVALID);
-        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
-        assertNull("Assert no tota service - 7", context.getServiceReference(Tota.class.getName()));
+        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
+        assertNull("Assert no tota service - 7", getContext().getServiceReference(Tota.class.getName()));
         
         under.dispose();
         under = null;
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp4.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp4.java
index ea821a7..c5b65af 100644
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp4.java
+++ b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp4.java
@@ -40,9 +40,9 @@
 	private ComponentFactory tataFactory2;
 
     public void setUp() {
-        tataFactory = (ComponentFactory) Utils.getFactoryByName(context, "tata");
-        totoFactory = (ComponentFactory) Utils.getFactoryByName(context, "toto");
-        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(context, "comp-6");
+        tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
+        totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
+        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "comp-6");
         tataFactory2.stop();
         tataFactory.stop();
         
@@ -65,7 +65,7 @@
         totoProv.stop();
         totoProv2.stop();
         
-        Factory factory = Utils.getFactoryByName(context, "comp-4");
+        Factory factory = Utils.getFactoryByName(getContext(), "comp-4");
         Properties props2 = new Properties();
         props2.put("instance.name","ff");
         try {
@@ -95,19 +95,19 @@
     public void testSimple() {
         // Neither factory nor instance
         assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 1", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 1", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the importer
         totoProv.start();
         assertTrue("Assert under state - 2 ("+under.getState()+")", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 2", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 2", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the factory
         tataFactory.start();
         assertTrue("Assert under state - 3", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 3", context.getServiceReference(Tota.class.getName()));
-        ServiceReference ref = context.getServiceReference(Tota.class.getName());
-        Tota tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 3", getContext().getServiceReference(Tota.class.getName()));
+        ServiceReference ref = getContext().getServiceReference(Tota.class.getName());
+        Tota tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         Properties props = tota.getProps();
@@ -125,15 +125,15 @@
         props = tota.getPropsTata();
         Integer tata = (Integer) props.get("tata");
         assertEquals("Assert tata - 3", tata.intValue(), 1);
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Start a second import
         totoProv2.start();
         assertTrue("Assert under state - 4", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 4", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 4", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         props = tota.getProps();
         toto = (Integer) props.get("toto");
@@ -150,37 +150,37 @@
         props = tota.getPropsTata();
         tata = (Integer) props.get("tata");
         assertEquals("Assert tata - 4", tata.intValue(), 2);
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Stop the factory
         tataFactory.stop();
         assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 5", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 5", getContext().getServiceReference(Tota.class.getName()));
         
         totoProv2.stop();
         totoProv.stop();
         tataFactory.start();
         assertTrue("Assert under state - 6", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 6", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 6", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAllOpt(tota);
         // Check tata
         props = tota.getPropsTata();
         tata = (Integer) props.get("tata");
         assertEquals("Assert tata - 6", tata.intValue(), 1);
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Is arch exposed
-        assertNotNull("Test arch", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
+        assertNotNull("Test arch", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
         
         tataFactory.stop();
         
         assertTrue("Assert under state - 7", under.getState() == ComponentInstance.INVALID);
-        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
-        assertNull("Assert no tota service - 7", context.getServiceReference(Tota.class.getName()));
+        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
+        assertNull("Assert no tota service - 7", getContext().getServiceReference(Tota.class.getName()));
         
         under.dispose();
         under = null;
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp5.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp5.java
index 33c3e3f..f01dc7a 100644
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp5.java
+++ b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp5.java
@@ -40,9 +40,9 @@
 	private ComponentFactory tataFactory2;
 
     public void setUp() {
-        tataFactory = (ComponentFactory) Utils.getFactoryByName(context, "tata");
-        totoFactory = (ComponentFactory) Utils.getFactoryByName(context, "toto");
-        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(context, "comp-6");
+        tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
+        totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
+        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "comp-6");
         tataFactory2.stop();
         tataFactory.stop();
         
@@ -65,7 +65,7 @@
         totoProv.stop();
         totoProv2.stop();
         
-        Factory factory = Utils.getFactoryByName(context, "comp-5");
+        Factory factory = Utils.getFactoryByName(getContext(), "comp-5");
         Properties props2 = new Properties();
         props2.put("instance.name","ff");
         try {
@@ -96,19 +96,19 @@
     public void testSimple() {
         // Neither factory nor instance
         assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 1", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 1", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the importer
         totoProv.start();
         assertTrue("Assert under state - 2 ("+under.getState()+")", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 2", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 2", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the factory
         tataFactory.start();
         assertTrue("Assert under state - 3", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 3", context.getServiceReference(Tota.class.getName()));
-        ServiceReference ref = context.getServiceReference(Tota.class.getName());
-        Tota tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 3", getContext().getServiceReference(Tota.class.getName()));
+        ServiceReference ref = getContext().getServiceReference(Tota.class.getName());
+        Tota tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         Properties props = tota.getProps();
@@ -126,15 +126,15 @@
         props = tota.getPropsTata();
         Integer tata = (Integer) props.get("tata");
         assertEquals("Assert tata - 3", tata.intValue(), 1);
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Start a second import
         totoProv2.start();
         assertTrue("Assert under state - 4", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 4", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 4", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         props = tota.getProps();
@@ -152,37 +152,37 @@
         props = tota.getPropsTata();
         tata = (Integer) props.get("tata");
         assertEquals("Assert tata - 4", tata.intValue(), 2);
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Stop the factory
         tataFactory.stop();
         assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 5", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 5", getContext().getServiceReference(Tota.class.getName()));
         
         totoProv2.stop();
         totoProv.stop();
         tataFactory.start();
         assertTrue("Assert under state - 6", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 6", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 6", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAllOpt(tota);
         //Check tata
         props = tota.getPropsTata();
         tata = (Integer) props.get("tata");
         assertEquals("Assert tata - 6", tata.intValue(), 1);
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Is arch exposed
-        assertNotNull("Test arch", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
+        assertNotNull("Test arch", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
         
         tataFactory.stop();
         
         assertTrue("Assert under state - 7", under.getState() == ComponentInstance.INVALID);
-        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
-        assertNull("Assert no tota service - 7", context.getServiceReference(Tota.class.getName()));
+        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
+        assertNull("Assert no tota service - 7", getContext().getServiceReference(Tota.class.getName()));
         
         under.dispose();
         under = null;
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp6.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp6.java
index 08384d6..09edbc6 100644
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp6.java
+++ b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp6.java
@@ -40,8 +40,8 @@
     private ComponentInstance under;
     
     public void setUp() {
-        tataFactory = (ComponentFactory) Utils.getFactoryByName(context, "tata");
-        totoFactory = (ComponentFactory) Utils.getFactoryByName(context, "toto");
+        tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
+        totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
         
         tataFactory.stop();
         
@@ -64,7 +64,7 @@
         totoProv.stop();
         totoProv2.stop();
         
-        Factory factory = Utils.getFactoryByName(context, "comp-6");
+        Factory factory = Utils.getFactoryByName(getContext(), "comp-6");
         Properties props2 = new Properties();
         props2.put("instance.name","ff");
         try {
@@ -93,28 +93,28 @@
     public void testSimple() {
         // Neither factory nor instance
         assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        ServiceReference refToto = Utils.getServiceReferenceByName(context, Toto.class.getName(), "ff");
-        ServiceReference refTata = Utils.getServiceReferenceByName(context, Tata.class.getName(), "ff");
+        ServiceReference refToto = Utils.getServiceReferenceByName(getContext(), Toto.class.getName(), "ff");
+        ServiceReference refTata = Utils.getServiceReferenceByName(getContext(), Tata.class.getName(), "ff");
         assertNull("Assert no toto service - 1", refToto);
         assertNull("Assert no tata service - 1", refTata);
 
         // Start the importer
         totoProv.start();
         assertTrue("Assert under state - 2 ("+under.getState()+")", under.getState() == ComponentInstance.INVALID);
-        refToto = Utils.getServiceReferenceByName(context, Toto.class.getName(), "ff");
-        refTata = Utils.getServiceReferenceByName(context, Tata.class.getName(), "ff");
+        refToto = Utils.getServiceReferenceByName(getContext(), Toto.class.getName(), "ff");
+        refTata = Utils.getServiceReferenceByName(getContext(), Tata.class.getName(), "ff");
         assertNull("Assert no toto service - 2", refToto);
         assertNull("Assert no tata service - 2", refTata);
 
         // Start the factory
         tataFactory.start();
         assertTrue("Assert under state - 3", under.getState() == ComponentInstance.VALID);
-        refToto = Utils.getServiceReferenceByName(context, Toto.class.getName(), "ff");
-        refTata = Utils.getServiceReferenceByName(context, Tata.class.getName(), "ff");
+        refToto = Utils.getServiceReferenceByName(getContext(), Toto.class.getName(), "ff");
+        refTata = Utils.getServiceReferenceByName(getContext(), Tata.class.getName(), "ff");
         assertNotNull("Assert toto service - 3", refToto);
         assertNotNull("Assert tata service - 3", refTata);
-        Toto toto = (Toto) context.getService(refToto);
-        Tata tata = (Tata) context.getService(refTata);
+        Toto toto = (Toto) getContext().getService(refToto);
+        Tata tata = (Tata) getContext().getService(refTata);
  
         invokeAll(tata);
         invokeToto(toto);
@@ -136,21 +136,21 @@
         Integer tata_0 = (Integer) props.get("tata");
         assertEquals("Assert tata - 3", tata_0.intValue(), 1);
 
-        context.ungetService(refToto);
-        context.ungetService(refTata);
+        getContext().ungetService(refToto);
+        getContext().ungetService(refTata);
         toto = null;
         tata = null;
         
         // Start a second import
         totoProv2.start();
         assertTrue("Assert under state - 4", under.getState() == ComponentInstance.VALID);
-        refToto = Utils.getServiceReferenceByName(context, Toto.class.getName(), "ff");
-        refTata = Utils.getServiceReferenceByName(context, Tata.class.getName(), "ff");
+        refToto = Utils.getServiceReferenceByName(getContext(), Toto.class.getName(), "ff");
+        refTata = Utils.getServiceReferenceByName(getContext(), Tata.class.getName(), "ff");
         assertNotNull("Assert toto service - 4", refToto);
         assertNotNull("Assert tata service - 4", refTata);
         
-        toto = (Toto) context.getService(refToto);
-        tata = (Tata) context.getService(refTata);
+        toto = (Toto) getContext().getService(refToto);
+        tata = (Tata) getContext().getService(refTata);
         invokeAll(tata);
         invokeToto(toto);
 
@@ -170,16 +170,16 @@
         props = tata.getPropsTata();
         tata_0 = (Integer) props.get("tata");
         assertEquals("Assert tata - 4", tata_0.intValue(), 2);
-        context.ungetService(refToto);
-        context.ungetService(refTata);
+        getContext().ungetService(refToto);
+        getContext().ungetService(refTata);
         toto = null;
         tata = null;
 
         // Stop the factory
         tataFactory.stop();
         assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        refToto = Utils.getServiceReferenceByName(context, Toto.class.getName(), "ff");
-        refTata = Utils.getServiceReferenceByName(context, Tata.class.getName(), "ff");
+        refToto = Utils.getServiceReferenceByName(getContext(), Toto.class.getName(), "ff");
+        refTata = Utils.getServiceReferenceByName(getContext(), Tata.class.getName(), "ff");
         assertNull("Assert no toto service - 5", refToto);
         assertNull("Assert no tata service - 5", refTata);
  
@@ -187,12 +187,12 @@
         totoProv.stop();
         tataFactory.start();
         assertTrue("Assert under state - 6", under.getState() == ComponentInstance.VALID);
-        refToto = Utils.getServiceReferenceByName(context, Toto.class.getName(), "ff");
-        refTata = Utils.getServiceReferenceByName(context, Tata.class.getName(), "ff");
+        refToto = Utils.getServiceReferenceByName(getContext(), Toto.class.getName(), "ff");
+        refTata = Utils.getServiceReferenceByName(getContext(), Tata.class.getName(), "ff");
         assertNotNull("Assert toto service - 6", refToto);
         assertNotNull("Assert tata service - 6", refTata);
-        toto = (Toto) context.getService(refToto);
-        tata = (Tata) context.getService(refTata);
+        toto = (Toto) getContext().getService(refToto);
+        tata = (Tata) getContext().getService(refTata);
  
         invokeAll(tata);
         invokeTotoOpt(toto);
@@ -200,20 +200,20 @@
         props = tata.getPropsTata();
         tata_0 = (Integer) props.get("tata");
         assertEquals("Assert tata - 6", tata_0.intValue(), 1);
-        context.ungetService(refToto);
-        context.ungetService(refTata);
+        getContext().ungetService(refToto);
+        getContext().ungetService(refTata);
         toto = null;
         tata = null;
  
         // Is arch exposed
-        assertNotNull("Test arch", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
+        assertNotNull("Test arch", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
         
         tataFactory.stop();
         
         assertTrue("Assert under state - 7", under.getState() == ComponentInstance.INVALID);
-        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
-        refToto = Utils.getServiceReferenceByName(context, Toto.class.getName(), "ff");
-        refTata = Utils.getServiceReferenceByName(context, Tata.class.getName(), "ff");
+        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
+        refToto = Utils.getServiceReferenceByName(getContext(), Toto.class.getName(), "ff");
+        refTata = Utils.getServiceReferenceByName(getContext(), Tata.class.getName(), "ff");
         assertNull("Assert no toto service - 7", refToto);
         assertNull("Assert no tata service - 7", refTata);
         
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp7.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp7.java
index 3df2b55..2e2a2ef 100644
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp7.java
+++ b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp7.java
@@ -40,9 +40,9 @@
     private ComponentInstance under;
     
     public void setUp() {
-        tataFactory = (ComponentFactory) Utils.getFactoryByName(context, "tata");
-        totoFactory = (ComponentFactory) Utils.getFactoryByName(context, "toto");
-        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(context, "comp-6");
+        tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
+        totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
+        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "comp-6");
         tataFactory2.stop();
         
         Properties props = new Properties();
@@ -64,7 +64,7 @@
         totoProv.stop();
         totoProv2.stop();
         
-        Factory factory = Utils.getFactoryByName(context, "comp-7");
+        Factory factory = Utils.getFactoryByName(getContext(), "comp-7");
         Properties props2 = new Properties();
         props2.put("instance.name","ff");
         try {
@@ -95,19 +95,19 @@
     public void testSimple() {
         // Neither factory nor instance
         assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 1", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 1", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the importer
         totoProv.start();
         assertTrue("Assert under state - 2", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 2", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 2", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the factory
         tataFactory.start();
         assertTrue("Assert under state - 3", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 3", context.getServiceReference(Tota.class.getName()));
-        ServiceReference ref = context.getServiceReference(Tota.class.getName());
-        Tota tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 3", getContext().getServiceReference(Tota.class.getName()));
+        ServiceReference ref = getContext().getServiceReference(Tota.class.getName());
+        Tota tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         Properties props = tota.getProps();
@@ -141,15 +141,15 @@
         assertEquals("Assert tata5 - 3", tata5.intValue(), 1);
         assertEquals("Assert tata5_1 - 3", tata5_1.intValue(), 1);
         assertEquals("Assert tata5_2 - 3", tata5_2.intValue(), 1);
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Start a second import
         totoProv2.start();
         assertTrue("Assert under state - 4", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 4", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 4", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         props = tota.getProps();
@@ -184,19 +184,19 @@
         assertEquals("Assert tata5_1 - 4", tata5_1.intValue(), 2);
         assertEquals("Assert tata5_2 - 4", tata5_2.intValue(), 2);
 
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         tataFactory.stop();
         assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 5", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 5", getContext().getServiceReference(Tota.class.getName()));
         
         totoProv2.stop();
         tataFactory.start();
         assertTrue("Assert under state - 6", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 6", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 6", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         props = tota.getProps();
@@ -230,17 +230,17 @@
         assertEquals("Assert tata5 - 6", tata5.intValue(), 1);
         assertEquals("Assert tata5_1 - 6", tata5_1.intValue(), 1);
         assertEquals("Assert tata5_2 - 6", tata5_2.intValue(), 1);
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Is arch exposed
-        assertNotNull("Test arch", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
+        assertNotNull("Test arch", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
         
         totoProv.stop();
         
         assertTrue("Assert under state - 7", under.getState() == ComponentInstance.INVALID);
-        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
-        assertNull("Assert no tota service - 7", context.getServiceReference(Tota.class.getName()));
+        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
+        assertNull("Assert no tota service - 7", getContext().getServiceReference(Tota.class.getName()));
         
         under.dispose();
         under = null;
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp8.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp8.java
index d09cd89..c11f643 100644
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp8.java
+++ b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp8.java
@@ -41,9 +41,9 @@
     private ComponentInstance under;
     
     public void setUp() {
-        tataFactory = (ComponentFactory) Utils.getFactoryByName(context, "tata");
-        totoFactory = (ComponentFactory) Utils.getFactoryByName(context, "toto");
-        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(context, "comp-6");
+        tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
+        totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
+        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "comp-6");
         tataFactory2.stop();
         
         Properties props = new Properties();
@@ -65,7 +65,7 @@
         totoProv.stop();
         totoProv2.stop();
         
-        Factory factory = Utils.getFactoryByName(context, "comp-8");
+        Factory factory = Utils.getFactoryByName(getContext(), "comp-8");
         Properties props2 = new Properties();
         props2.put("instance.name","ff");
         try {
@@ -101,19 +101,19 @@
     public void testSimple() {        
         // Neither factory nor instance
         assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 1", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 1", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the importer
         totoProv.start();
         assertTrue("Assert under state - 2", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 2", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 2", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the factory
         tataFactory.start();
         assertTrue("Assert under state - 3", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 3", context.getServiceReference(Tota.class.getName()));
-        ServiceReference ref = context.getServiceReference(Tota.class.getName());
-        Tota tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 3", getContext().getServiceReference(Tota.class.getName()));
+        ServiceReference ref = getContext().getServiceReference(Tota.class.getName());
+        Tota tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         Properties props = tota.getProps();
@@ -155,15 +155,15 @@
         assertEquals("Assert tata5 - 3", tata5.intValue(), 1);
         assertEquals("Assert tata5_1 - 3", tata5_1.intValue(), 1);
         assertEquals("Assert tata5_2 - 3", tata5_2.intValue(), 1);
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Start a second import
         totoProv2.start();
         assertTrue("Assert under state - 4", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 4", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 4", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         props = tota.getProps();
@@ -206,19 +206,19 @@
         assertEquals("Assert tata5_1 - 4", tata5_1.intValue(), 2);
         assertEquals("Assert tata5_2 - 4", tata5_2.intValue(), 2);
 
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         tataFactory.stop();
         assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 5", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 5", getContext().getServiceReference(Tota.class.getName()));
         
         totoProv2.stop();
         tataFactory.start();
         assertTrue("Assert under state - 6", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 6", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 6", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         props = tota.getProps();
@@ -260,17 +260,17 @@
         assertEquals("Assert tata5 - 6", tata5.intValue(), 1);
         assertEquals("Assert tata5_1 - 6", tata5_1.intValue(), 1);
         assertEquals("Assert tata5_2 - 6", tata5_2.intValue(), 1);
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Is arch exposed
-        assertNotNull("Test arch", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
+        assertNotNull("Test arch", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
         
         totoProv.stop();
         
         assertTrue("Assert under state - 7", under.getState() == ComponentInstance.INVALID);
-        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
-        assertNull("Assert no tota service - 7", context.getServiceReference(Tota.class.getName()));
+        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
+        assertNull("Assert no tota service - 7", getContext().getServiceReference(Tota.class.getName()));
         
         under.dispose();
         under = null;
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/test/CompositeTest.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/test/CompositeTest.java
index 7ee1868..4f90fad 100644
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/test/CompositeTest.java
+++ b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/test/CompositeTest.java
@@ -34,7 +34,7 @@
 public class CompositeTest extends OSGiTestCase {
 	
 	public void testAPI() {
-		Factory fact1 = Utils.getFactoryByName(context, "composite.empty");
+		Factory fact1 = Utils.getFactoryByName(getContext(), "composite.empty");
 		Properties p = new Properties();
 		p.put("instance.name","empty-1");
 		ComponentInstance empty = null;
@@ -47,10 +47,10 @@
 		
 		ServiceContext sc = Utils.getServiceContext(empty);
 		
-		Factory fact2 = Utils.getFactoryByName(context, "composite.test.2");
+		Factory fact2 = Utils.getFactoryByName(getContext(), "composite.test.2");
 		Properties props2 = new Properties();
 		props2.put("instance.name","2"); // 2
-		Factory fact3 = Utils.getFactoryByName(context, "composite.test.3");
+		Factory fact3 = Utils.getFactoryByName(getContext(), "composite.test.3");
 		Properties props3 = new Properties();
 		props3.put("instance.name","3");
 		ComponentInstance comp2 = null;
@@ -81,7 +81,7 @@
 	
 	public void testInstantiator() {
 		String type = "composite.instantiator";
-		Factory fact = Utils.getFactoryByName(context, type);
+		Factory fact = Utils.getFactoryByName(getContext(), type);
 		ComponentInstance ci = null;
 		Properties p = new Properties();
 		p.put("instance.name","mon_coeur");
@@ -92,21 +92,21 @@
 		}
 				
 		assertTrue("Check ci", ci.getState() == ComponentInstance.VALID);
-		ServiceReference ref = Utils.getServiceReferenceByName(context, BazService.class.getName(), "mon_coeur");
+		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), "mon_coeur");
 		assertNotNull("Check ref",ref);
-		BazService bs = (BazService) context.getService(ref);
+		BazService bs = (BazService) getContext().getService(ref);
 		assertTrue("Check invocation", bs.foo());
-		context.ungetService(ref);
-		ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), "mon_coeur");
+		getContext().ungetService(ref);
+		ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "mon_coeur");
 		assertNotNull("Check ref 2 ",ref);
-		FooService fs = (FooService) context.getService(ref);
+		FooService fs = (FooService) getContext().getService(ref);
 		assertTrue("Check invocation", fs.foo());
-		context.ungetService(ref);
+		getContext().ungetService(ref);
 		ci.dispose();
 	}
 	
 	public void testAPI2() {
-		Factory fact1 = Utils.getFactoryByName(context, "composite.empty");
+		Factory fact1 = Utils.getFactoryByName(getContext(), "composite.empty");
 		Properties p = new Properties();
 		p.put("instance.name","empty-2");
 		ComponentInstance empty = null;
@@ -151,7 +151,7 @@
 
 	
 	public void testApplication() {
-		Factory factory = Utils.getFactoryByName(context, "composite.test.1");
+		Factory factory = Utils.getFactoryByName(getContext(), "composite.test.1");
 		ComponentInstance ci = null;
 		Properties props = new Properties();
 		props.put("instance.name","Test");
@@ -165,12 +165,12 @@
 		
 		ServiceReference[] refs = null;
 		try {
-			refs = context.getServiceReferences(CheckService.class.getName(), "(instance.name=Test)");
+			refs = getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=Test)");
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e.getMessage());
 		}
 		assertNotNull("Check refs not null", refs);
-		CheckService cs = (CheckService) context.getService(refs[0]);
+		CheckService cs = (CheckService) getContext().getService(refs[0]);
 		
 		assertTrue("Check invocation", cs.check());
 		ci.dispose();
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AggregateDependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AggregateDependency.java
index f51485a..5aa2568 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AggregateDependency.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AggregateDependency.java
@@ -1,15 +1,18 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class AggregateDependency extends OSGiTestCase {
     
-    private Element[] deps ;
+    private Element[] deps;
+    
+    private IPOJOHelper helper;
     
     public void setUp() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.AggregateDependency");
+        helper = new IPOJOHelper(this);
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.AggregateDependency");
         deps = meta.getElements("requires");
     }
     
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Architecture.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Architecture.java
index c4ca4fb..9996972 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Architecture.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Architecture.java
@@ -1,20 +1,28 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class Architecture extends OSGiTestCase {
     
+    
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
+    
     public void testArch() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Arch");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Arch");
         String arch = meta.getAttribute("architecture");
         assertNotNull("Architecture exists ", arch);
         assertEquals("Architecture value", "true", arch);
     }
     
     public void testNoArch() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NoArch");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.NoArch");
         String arch = meta.getAttribute("architecture");
         assertNotNull("Architecture exists ", arch);
         assertEquals("Architecture value", "false", arch);
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java
index a939d95..ddeea7d 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java
@@ -1,13 +1,19 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class Dependency extends OSGiTestCase {
     
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
     public void testDependencyDeclaration() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Dependency");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Dependency");
         Element[] deps = meta.getElements("requires");
         
         // Check fs
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java
index cc61cc3..bb93202 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java
@@ -1,17 +1,19 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class EventAdmin extends OSGiTestCase {
     String type = "org.apache.felix.ipojo.test.scenarios.component.event.PubSub";
     String namespace = "org.apache.felix.ipojo.handlers.event";
     
     Element component;
+    private IPOJOHelper helper;
     
     public void setUp() {
-        component = Utils.getMetatadata(context, type);
+        helper = new IPOJOHelper(this);
+        component = helper.getMetadata(type);
         assertNotNull("Check component", component);
     }
     
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java
index 28e9661..9f8a418 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java
@@ -1,17 +1,22 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class Extender extends OSGiTestCase {
     
     String type = "org.apache.felix.ipojo.test.scenarios.component.extender.Extender";
     String namespace = "org.apache.felix.ipojo.extender";
-
+    
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
     
     public void testMetadata() {
-        Element meta = Utils.getMetatadata(context, type);
+        Element meta = helper.getMetadata(type);
         assertNotNull("Check meta", meta);
         Element[] ext = meta.getElements("extender", namespace);
         assertEquals("Check size", 1, ext.length);
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java
index 0283992..d0d44a0 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java
@@ -1,13 +1,19 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class Factory extends OSGiTestCase {
     
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
     public void testArch() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Factory");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Factory");
         String fact = meta.getAttribute("public");
         String name = meta.getAttribute("name");
         assertNotNull("Factory exists ", fact);
@@ -17,7 +23,7 @@
     }
     
     public void testNoArch() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NoFactory");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.NoFactory");
         String fact = meta.getAttribute("public");
         String name = meta.getAttribute("name");
         assertNotNull("Factory exists ", fact);
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/FilteredDependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/FilteredDependency.java
index 52e85ae..8db422c 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/FilteredDependency.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/FilteredDependency.java
@@ -1,19 +1,21 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class FilteredDependency extends OSGiTestCase {
     
     private Element[] deps ;
     private Element[] froms;
+    private IPOJOHelper helper;
     
     public void setUp() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.FilteredDependency");
+        helper = new IPOJOHelper(this);
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.FilteredDependency");
         deps = meta.getElements("requires");
         
-        Element meta2 = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.FromDependency");
+        Element meta2 = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.FromDependency");
         froms = meta2.getElements("requires");
     }
     
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java
index 656d987..4e07d29 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java
@@ -1,13 +1,19 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class JMX extends OSGiTestCase {
     
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
     public void testSimple() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.jmx.JMXSimple");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.jmx.JMXSimple");
         /*
          * org.apache.felix.ipojo.handlers.jmx:config domain="my-domain" usesmosgi="false"
         org.apache.felix.ipojo.handlers.jmx:property field="m_foo" name="prop" rights="w" notification="true"
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleCallbacks.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleCallbacks.java
index d1e8ea6..554de91 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleCallbacks.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleCallbacks.java
@@ -1,13 +1,19 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class LifecycleCallbacks extends OSGiTestCase {
     
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
     public void testCallbacks() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Lifecycle");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Lifecycle");
         Element[] cbs = meta.getElements("callback");
         assertNotNull("Callbacks exists ", cbs);
         assertEquals("Callbacks count ", 2, cbs.length);
@@ -22,13 +28,13 @@
     }
     
     public void testImmediate() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Immediate");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Immediate");
         assertNotNull("Immediate attribute", meta.getAttribute("immediate"));
         assertEquals("Immediate attribute value", "true", meta.getAttribute("immediate"));
     }
     
     public void testNoImmediate() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NoImmediate");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.NoImmediate");
         assertNotNull("Immediate attribute", meta.getAttribute("immediate"));
         assertEquals("Immediate attribute value", "false", meta.getAttribute("immediate"));
     }
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleController.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleController.java
index 06ac132..95a60ac 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleController.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleController.java
@@ -1,13 +1,19 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class LifecycleController extends OSGiTestCase {
     
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
     public void testLFC() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Lifecycle");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Lifecycle");
         Element[] ctrls = meta.getElements("controller");
         assertNotNull("Controller exists ", ctrls);
         Element ctrl = ctrls[0];
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/OptionalDependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/OptionalDependency.java
index 0466402..7e9b970 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/OptionalDependency.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/OptionalDependency.java
@@ -1,16 +1,18 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.test.scenarios.component.ProvidesSimple;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class OptionalDependency extends OSGiTestCase {
     
     private Element[] deps ;
+    private IPOJOHelper helper;
     
     public void setUp() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.OptionalDependency");
+        helper = new IPOJOHelper(this);
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.OptionalDependency");
         deps = meta.getElements("requires");
     }
     
@@ -57,7 +59,7 @@
     }
     
     public void testNullable() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NullableDependency");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.NullableDependency");
         Element[] deps = meta.getElements("requires");
         Element fs = getDependencyById(deps, "fs");
         String nullable = fs.getAttribute("nullable");
@@ -66,7 +68,7 @@
     }
     
     public void testNoNullable() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NullableDependency");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.NullableDependency");
         Element[] deps = meta.getElements("requires");
         Element fs = getDependencyById(deps, "fs2");
         String nullable = fs.getAttribute("nullable");
@@ -75,7 +77,7 @@
     }
     
     public void testDefaultImplmentation() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.DefaultImplementationDependency");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.DefaultImplementationDependency");
         Element[] deps = meta.getElements("requires");
         Element fs = getDependencyById(deps, "fs");
         String di = fs.getAttribute("default-implementation");
@@ -99,25 +101,5 @@
         fail("Dependency  " + name + " not found");
         return null;
     }
-    
-    private String getBind(Element dep) {
-        Element[] elem = dep.getElements("callback");
-        for (int i = 0; elem != null && i < elem.length; i++) {
-            if (elem[i].getAttribute("type").equalsIgnoreCase("bind")) {
-                return elem[i].getAttribute("method");
-            }
-        }
-        return null;
-    }
-    
-    private String getUnbind(Element dep) {
-        Element[] elem = dep.getElements("callback");
-        for (int i = 0; elem != null && i < elem.length; i++) {
-            if (elem[i].getAttribute("type").equalsIgnoreCase("unbind")) {
-                return elem[i].getAttribute("method");
-            }
-        }
-        return null;
-    }
 
 }
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/PolicyDependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/PolicyDependency.java
index 3dd0b13..0850190 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/PolicyDependency.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/PolicyDependency.java
@@ -1,15 +1,17 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class PolicyDependency extends OSGiTestCase {
     
     private Element[] deps ;
+    private IPOJOHelper helper;
     
     public void setUp() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.PolicyDependency");
+        helper = new IPOJOHelper(this);
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.PolicyDependency");
         deps = meta.getElements("requires");
     }
     
@@ -71,25 +73,5 @@
         fail("Dependency  " + name + " not found");
         return null;
     }
-    
-    private String getBind(Element dep) {
-        Element[] elem = dep.getElements("callback");
-        for (int i = 0; elem != null && i < elem.length; i++) {
-            if (elem[i].getAttribute("type").equalsIgnoreCase("bind")) {
-                return elem[i].getAttribute("method");
-            }
-        }
-        return null;
-    }
-    
-    private String getUnbind(Element dep) {
-        Element[] elem = dep.getElements("callback");
-        for (int i = 0; elem != null && i < elem.length; i++) {
-            if (elem[i].getAttribute("type").equalsIgnoreCase("unbind")) {
-                return elem[i].getAttribute("method");
-            }
-        }
-        return null;
-    }
 
 }
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java
index c9d5a99..77fa697 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java
@@ -1,13 +1,19 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class Properties extends OSGiTestCase {
     
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
     public void testProperties() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Properties");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Properties");
         Element[] provs = meta.getElements("properties");
         assertNotNull("Properties exists ", provs);
         Element prov = provs[0];
@@ -40,7 +46,7 @@
     }
     
     public void testAbsentPropagation() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Properties");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Properties");
         Element[] provs = meta.getElements("properties");
         assertNotNull("Properties exists ", provs);
         Element prov = provs[0];
@@ -49,7 +55,7 @@
     }
     
     public void testPropagation() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Propagation");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Propagation");
         Element[] provs = meta.getElements("properties");
         assertNotNull("Properties exists ", provs);
         Element prov = provs[0];
@@ -59,7 +65,7 @@
     }
     
     public void testNoPropagation() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NoPropagation");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.NoPropagation");
         Element[] provs = meta.getElements("properties");
         assertNotNull("Properties exists ", provs);
         Element prov = provs[0];
@@ -69,7 +75,7 @@
     }
     
     public void testPID() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.ManagedServicePID");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.ManagedServicePID");
         Element[] provs = meta.getElements("properties");
         assertNotNull("Properties exists ", provs);
         Element prov = provs[0];
@@ -79,7 +85,7 @@
     }
     
     public void testAbsentPID() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Properties");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Properties");
         Element[] provs = meta.getElements("properties");
         assertNotNull("Properties exists ", provs);
         Element prov = provs[0];
@@ -88,7 +94,7 @@
     }
     
     public void testPropagationAndPID() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.PropagationandPID");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.PropagationandPID");
         Element[] provs = meta.getElements("properties");
         assertNotNull("Properties exists ", provs);
         Element prov = provs[0];
@@ -101,7 +107,7 @@
     }
     
     public void testPIDAndPropagation() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.PIDandPropagation");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.PIDandPropagation");
         Element[] provs = meta.getElements("properties");
         assertNotNull("Properties exists ", provs);
         Element prov = provs[0];
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/RankedDependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/RankedDependency.java
index 228bce7..6ddb3fa 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/RankedDependency.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/RankedDependency.java
@@ -1,16 +1,19 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.test.scenarios.component.MyComparator;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class RankedDependency extends OSGiTestCase {
     
     private Element[] deps ;
     
+    private IPOJOHelper helper;
+    
     public void setUp() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.RankedDependency");
+        helper = new IPOJOHelper(this);
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.RankedDependency");
         deps = meta.getElements("requires");
     }
     
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java
index 9bf7719..2b14b69 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java
@@ -3,30 +3,34 @@
 import java.util.List;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.parser.ParseUtils;
 import org.apache.felix.ipojo.test.scenarios.annotations.service.CheckService;
 import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class ServiceProdiving extends OSGiTestCase {
     
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
     public void testProvidesSimple() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.ProvidesSimple");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.ProvidesSimple");
         Element[] provs = meta.getElements("provides");
         assertNotNull("Provides exists ", provs);
-        Element prov = provs[0];
     }
     
     public void testProvidesDouble() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.ProvidesDouble");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.ProvidesDouble");
         Element[] provs = meta.getElements("provides");
         assertNotNull("Provides exists ", provs);
-        Element prov = provs[0];
     }
     
     public void testProvidesTriple() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.ProvidesTriple");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.ProvidesTriple");
         Element[] provs = meta.getElements("provides");
         assertNotNull("Provides exists ", provs);
         Element prov = provs[0];
@@ -36,7 +40,7 @@
     }
     
     public void testProvidesQuatro() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.ProvidesQuatro");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.ProvidesQuatro");
         Element[] provs = meta.getElements("provides");
         assertNotNull("Provides exists ", provs);
         Element prov = provs[0];
@@ -47,7 +51,7 @@
     }
     
     public void testProperties() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.ProvidesProperties");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.ProvidesProperties");
         Element[] provs = meta.getElements("provides");
         assertNotNull("Provides exists ", provs);
         Element prov = provs[0];
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/TemporalDependencies.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/TemporalDependencies.java
index db1b416..3d692df 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/TemporalDependencies.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/TemporalDependencies.java
@@ -1,13 +1,19 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class TemporalDependencies extends OSGiTestCase {
     
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
     public void testSimple() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalSimple");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalSimple");
         Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
         assertNotNull("Temporal exists ", provs);
         String field = provs[0].getAttribute("field");
@@ -20,7 +26,7 @@
     }
     
     public void testDI() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithDI");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithDI");
         Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
         assertNotNull("Temporal exists ", provs);
         String field = provs[0].getAttribute("field");
@@ -33,7 +39,7 @@
     }
     
     public void testEmptyArray() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithEmptyArray");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithEmptyArray");
         Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
         assertNotNull("Temporal exists ", provs);
         String field = provs[0].getAttribute("field");
@@ -46,7 +52,7 @@
     }
     
     public void testNull() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithNull");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithNull");
         Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
         assertNotNull("Temporal exists ", provs);
         String field = provs[0].getAttribute("field");
@@ -59,7 +65,7 @@
     }
     
     public void testNullable() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithNullable");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithNullable");
         Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
         assertNotNull("Temporal exists ", provs);
         String field = provs[0].getAttribute("field");
@@ -72,7 +78,7 @@
     }
     
     public void testFilter() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithFilter");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithFilter");
         Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
         assertNotNull("Temporal exists ", provs);
         String field = provs[0].getAttribute("field");
@@ -85,7 +91,7 @@
     }
     
     public void testTimeout() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithTimeout");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithTimeout");
         Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
         assertNotNull("Temporal exists ", provs);
         String field = provs[0].getAttribute("field");
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java
index 4f9022a..b2e38d0 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java
@@ -1,8 +1,8 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class WhiteBoard extends OSGiTestCase {
     
@@ -10,8 +10,14 @@
     String typeWO = "org.apache.felix.ipojo.test.scenarios.component.whiteboard.WhiteBoardWOModification";
     String namespace = "org.apache.felix.ipojo.whiteboard";
     
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
     public void testMetadataWithOnModification() {
-        Element meta = Utils.getMetatadata(context, typeWI);
+        Element meta = helper.getMetadata(typeWI);
         assertNotNull("Check meta", meta);
         Element[] ext = meta.getElements("wbp", namespace);
         assertEquals("Check size", 1, ext.length);
@@ -29,7 +35,7 @@
     }
     
     public void testMetadataWithoutOnModification() {
-        Element meta = Utils.getMetatadata(context, typeWO);
+        Element meta = helper.getMetadata(typeWO);
         assertNotNull("Check meta", meta);
         Element[] ext = meta.getElements("wbp", namespace);
         assertEquals("Check size", 1, ext.length);
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
deleted file mode 100644
index f64adb7..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.util;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import junit.framework.Assert;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.Handler;
-import org.apache.felix.ipojo.HandlerFactory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.parser.ManifestMetadataParser;
-import org.apache.felix.ipojo.parser.ParseException;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class Utils {
-    
-    public static Element getMetatadata(BundleContext bc, String component) {
-        String elem = (String) bc.getBundle().getHeaders().get("iPOJO-Components");
-        Assert.assertNotNull("iPOJO Components exists", elem);
-        try {
-            Element element = ManifestMetadataParser.parseHeaderMetadata(elem);
-            Element[] childs = element.getElements("component");
-            for (int i = 0; i < childs.length; i++) {
-                String name = childs[i].getAttribute("name");
-                String clazz = childs[i].getAttribute("classname");
-                if (name != null && name.equalsIgnoreCase(component)) {
-                    return childs[i];
-                }
-                if (clazz.equalsIgnoreCase(component)) {
-                    return childs[i];
-                }
-            }
-            Assert.fail("Component " + component + " not found in " + bc.getBundle().getSymbolicName());
-        } catch (ParseException e) {
-            Assert.fail("Cannot parse the components from " + bc.getBundle().getSymbolicName() + ": " + e.getMessage());
-        }
-        
-        return null;
-        
-    }
-
-    public static Factory getFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static HandlerFactory getHandlerFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(HandlerFactory.class.getName(), "(" + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return (HandlerFactory) bc.getService(refs[0]);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        // if(fact.isAcceptable(configuration)) {
-        try {
-            return fact.createComponentInstance(configuration);
-        } catch (Exception e) {
-            e.printStackTrace();
-            Assert.fail("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-        // }
-        // else {
-        // System.err.println("Configuration not accepted by : " + factoryName);
-        // return null;
-        // }
-    }
-
-    public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        try {
-            Properties props = new Properties();
-            props.put("instance.name",name);
-            return fact.createComponentInstance(props);
-        } catch (Exception e) {
-            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(BundleContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-    
-    public static ServiceReference getServiceReferenceByPID(BundleContext bc, String itf, String pid) {
-        ServiceReference[] refs = null;
-        String filter = "(" + "service.pid" + "=" + pid + ")";
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else if (refs.length == 1) {
-            return refs[0];
-        } else {
-            Assert.fail("A service lookup by PID returned several providers (" + refs.length + ")" + " for " + itf + " with " + pid);
-            return null;
-        }
-    }
-
-    public static Object getServiceObject(BundleContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-//    public static ServiceContext getServiceContext(ComponentInstance ci) {
-//        if (ci instanceof CompositeManager) {
-//            return ((CompositeManager) ci).getServiceContext();
-//        } else {
-//            throw new RuntimeException("Cannot get the service context form an non composite instance");
-//        }
-//    }
-
-    public static Factory getFactoryByName(ServiceContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) { return null; }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) { return null; }
-
-        if (fact.isAcceptable(configuration)) {
-            try {
-                return fact.createComponentInstance(configuration);
-            } catch (Exception e) {
-                System.err.println(e.getMessage());
-                e.printStackTrace();
-                return null;
-            }
-        } else {
-            System.err.println("Configuration not accepted by : " + factoryName);
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(ServiceContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static Object getServiceObject(ServiceContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-    
-    public static boolean contains(String string, String[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] != null  && array[i].equals(string)) {
-                return true;
-            }
-        }
-        return false;
-    }
-    
-    public static boolean contains(int value, int[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] == value) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-}
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java
index 3421eee..16c5d34 100644
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java
+++ b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java
@@ -50,7 +50,7 @@
     
     public void testBadFactory() {
         try {
-            new ComponentFactory(context, getElementFactoryWithNoClassName());
+            new ComponentFactory(getContext(), getElementFactoryWithNoClassName());
             fail("A factory with no class name must be rejected");
         } catch (ConfigurationException e) {
           // OK.   
@@ -59,7 +59,7 @@
     
     public void testBadHandlerFactory1() {
         try {
-            new HandlerManagerFactory(context, getElementHandlerFactoryWithNoClassName());
+            new HandlerManagerFactory(getContext(), getElementHandlerFactoryWithNoClassName());
             fail("An handler factory with no class name must be rejected");
         } catch (ConfigurationException e) {
           // OK.   
@@ -68,7 +68,7 @@
     
     public void testBadHandlerFactory2() {
         try {
-            new HandlerManagerFactory(context, getElementHandlerFactoryWithNoName());
+            new HandlerManagerFactory(getContext(), getElementHandlerFactoryWithNoName());
             fail("An handler factory with no name must be rejected");
         } catch (ConfigurationException e) {
           // OK.   
@@ -76,7 +76,7 @@
     }
     
     public void testCreationOnBadConstructor() {
-            Factory factory = Utils.getFactoryByName(context, "BAD-BadConstructor");
+            Factory factory = Utils.getFactoryByName(getContext(), "BAD-BadConstructor");
             ComponentInstance ci;
             try {
                 ci = factory.createComponentInstance(null);
@@ -88,7 +88,7 @@
     }
     
     public void testCreationOnBadFactory() {
-        Factory factory = Utils.getFactoryByName(context, "BAD-BadFactory");
+        Factory factory = Utils.getFactoryByName(getContext(), "BAD-BadFactory");
         ComponentInstance ci;
         try {
             ci = factory.createComponentInstance(null);
@@ -100,7 +100,7 @@
     }
     
     public void testCreationOnBadFactory2() {
-        Factory factory = Utils.getFactoryByName(context, "BAD-BadFactory2");
+        Factory factory = Utils.getFactoryByName(getContext(), "BAD-BadFactory2");
         ComponentInstance ci;
         try {
             ci = factory.createComponentInstance(null);
@@ -115,7 +115,7 @@
         Element elem = new Element("component", "");
         elem.addAttribute(new Attribute("classname", "org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"));
         try {
-            ComponentFactory fact = new ComponentFactory(context, elem);
+            ComponentFactory fact = new ComponentFactory(getContext(), elem);
             fact.stop();
             fail("A factory with no manipulation metadata must be rejected");
         } catch (ConfigurationException e) {
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCCallback.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCCallback.java
index 54fd891..2749e30 100644
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCCallback.java
+++ b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCCallback.java
@@ -114,7 +114,7 @@
     }
     
     private Element getManipulationForComponent() {
-        String header = (String) context.getBundle().getHeaders().get("iPOJO-Components");
+        String header = (String) getContext().getBundle().getHeaders().get("iPOJO-Components");
         Element elem = null;
         try {
             elem = ManifestMetadataParser.parseHeaderMetadata(header);
@@ -144,7 +144,7 @@
     
     public void testNothing() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getNothing());
+            ComponentFactory cf = new ComponentFactory(getContext(), getNothing());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();
@@ -161,7 +161,7 @@
     
     public void testNoTransition() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getNoTransition());
+            ComponentFactory cf = new ComponentFactory(getContext(), getNoTransition());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();
@@ -178,7 +178,7 @@
     
     public void testNoMethod() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getNoMethod());
+            ComponentFactory cf = new ComponentFactory(getContext(), getNoMethod());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();
@@ -195,7 +195,7 @@
     
     public void testBadMethod() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getBadMethod());
+            ComponentFactory cf = new ComponentFactory(getContext(), getBadMethod());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             if (ci.isStarted()) {
@@ -215,7 +215,7 @@
     
     public void testBadMethod2() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getBadMethod2());
+            ComponentFactory cf = new ComponentFactory(getContext(), getBadMethod2());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.stop();
@@ -236,7 +236,7 @@
     
     public void testBadTransition() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getBadTransition());
+            ComponentFactory cf = new ComponentFactory(getContext(), getBadTransition());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCController.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCController.java
index cc72b98..3089aa3 100644
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCController.java
+++ b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCController.java
@@ -50,7 +50,7 @@
     }
     
     private Element getManipulationForComponent(String comp_name) {
-        String header = (String) context.getBundle().getHeaders().get("iPOJO-Components");
+        String header = (String) getContext().getBundle().getHeaders().get("iPOJO-Components");
         Element elem = null;
         try {
             elem = ManifestMetadataParser.parseHeaderMetadata(header);
@@ -77,7 +77,7 @@
     
     public void testNoField() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getNoFieldController());
+            ComponentFactory cf = new ComponentFactory(getContext(), getNoFieldController());
             cf.start();
             cf.stop();
             fail("A lifecycle controller with a missing field must be rejected " + cf);
@@ -88,7 +88,7 @@
     
     public void testBadField() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getBadFieldController());
+            ComponentFactory cf = new ComponentFactory(getContext(), getBadFieldController());
             cf.start();
             cf.stop();
             fail("A lifecycle controller with a bad field must be rejected " + cf);
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadServiceDependencies.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadServiceDependencies.java
index e0f6333..63bcc87 100644
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadServiceDependencies.java
+++ b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadServiceDependencies.java
@@ -128,7 +128,7 @@
     
     
     private Element getManipulationForComponent() {
-        String header = (String) context.getBundle().getHeaders().get("iPOJO-Components");
+        String header = (String) getContext().getBundle().getHeaders().get("iPOJO-Components");
         Element elem = null;
         try {
             elem = ManifestMetadataParser.parse(header);
@@ -158,7 +158,7 @@
     
     public void testNothing() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getNothing());
+            ComponentFactory cf = new ComponentFactory(getContext(), getNothing());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();
@@ -175,7 +175,7 @@
     
     public void testNoField() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getNoField());
+            ComponentFactory cf = new ComponentFactory(getContext(), getNoField());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();
@@ -192,7 +192,7 @@
     
     public void testBadField() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getBadField());
+            ComponentFactory cf = new ComponentFactory(getContext(), getBadField());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();
@@ -209,7 +209,7 @@
     
     public void testBadFilter() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getBadFilter());
+            ComponentFactory cf = new ComponentFactory(getContext(), getBadFilter());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();
@@ -226,7 +226,7 @@
     
     public void testBadFrom() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getBadFrom());
+            ComponentFactory cf = new ComponentFactory(getContext(), getBadFrom());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();
@@ -243,7 +243,7 @@
     
     public void testBadType() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getBadType());
+            ComponentFactory cf = new ComponentFactory(getContext(), getBadType());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();
diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForImmediate.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForImmediate.java
index 5b0d798..d912e17 100644
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForImmediate.java
+++ b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForImmediate.java
@@ -20,8 +20,8 @@
     private ConfigurationAdmin admin;
     
     public void setUp() {
-        factory = (ComponentFactory) Utils.getFactoryByName(context, "CA-ImmConfigurableProvider");
-        admin = (ConfigurationAdmin) Utils.getServiceObject(context, ConfigurationAdmin.class.getName(), null);
+        factory = (ComponentFactory) Utils.getFactoryByName(getContext(), "CA-ImmConfigurableProvider");
+        admin = (ConfigurationAdmin) Utils.getServiceObject(getContext(), ConfigurationAdmin.class.getName(), null);
         assertNotNull("Check configuration admin availability", admin);
         try {
             Configuration[] configurations = admin.listConfigurations("(service.factoryPid=CA-ImmConfigurableProvider)");
@@ -77,16 +77,16 @@
         String pid = configuration.getPid();
         
         //  The instance should be created, wait for the architecture service
-        Utils.waitForService(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
-        Architecture architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Check object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
         
-        FooService fs = (FooService) Utils.getServiceObject(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message", mes);
         assertEquals("Assert count", 1, count);
@@ -101,11 +101,11 @@
             fail(e.getMessage());
         }
         
-        fs = (FooService) Utils.getServiceObject(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         assertEquals("Assert count", 2, count);
@@ -118,7 +118,7 @@
             fail(e.getMessage());
         }
         
-        ServiceReference ref = Utils.getServiceReference(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         assertNull("Check unavailability", ref);
     }
     
@@ -146,8 +146,8 @@
         System.out.println("PID : " + pid);
         
         //  The instance should be created, wait for the architecture service
-        Utils.waitForService(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
-        Architecture architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Check object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
         
@@ -160,16 +160,16 @@
             fail(e.getMessage());
         }
         
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Check object -2", 1, architecture.getInstanceDescription().getCreatedObjects().length);
         
         //Invoke
-        FooService fs = (FooService) Utils.getServiceObject(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         assertEquals("Assert count", 2, count);
@@ -182,7 +182,7 @@
             fail(e.getMessage());
         }
         
-        ServiceReference ref = Utils.getServiceReference(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         assertNull("Check unavailability", ref);
     }
     
@@ -208,22 +208,22 @@
         
         String pid = configuration.getPid();
         
-        assertNull("check no instance", Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")"));
+        assertNull("check no instance", Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")"));
         
         factory.start();
         
         
         //  The instance should be created, wait for the architecture service
-        Utils.waitForService(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
-        Architecture architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Check object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
         
-        FooService fs = (FooService) Utils.getServiceObject(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message", mes);
         assertEquals("Assert count", 1, count);
@@ -238,11 +238,11 @@
             fail(e.getMessage());
         }
         
-        fs = (FooService) Utils.getServiceObject(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         //assertEquals("Assert count", 2, count);
@@ -256,7 +256,7 @@
             fail(e.getMessage());
         }
         
-        ServiceReference ref = Utils.getServiceReference(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         assertNull("Check unavailability", ref);
     }
     
@@ -283,14 +283,14 @@
         
         String pid = configuration.getPid();
         
-        assertNull("check no instance", Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")"));
+        assertNull("check no instance", Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")"));
         
         factory.start();
         
         
         //  The instance should be created, wait for the architecture service
-        Utils.waitForService(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
-        Architecture architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Check object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
         
@@ -303,16 +303,16 @@
             fail(e.getMessage());
         }
         
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Check object -1", 1, architecture.getInstanceDescription().getCreatedObjects().length);
         
         //Invoke
-        FooService fs = (FooService) Utils.getServiceObject(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         assertEquals("Assert count", 2, count);
@@ -325,7 +325,7 @@
             fail(e.getMessage());
         }
         
-        ServiceReference ref = Utils.getServiceReference(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         assertNull("Check unavailability", ref);
     }
     
diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForServices.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForServices.java
index 867f66f..4ad16d7 100644
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForServices.java
+++ b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForServices.java
@@ -20,8 +20,8 @@
     private ConfigurationAdmin admin;
     
     public void setUp() {
-        factory = (ComponentFactory) Utils.getFactoryByName(context, "CA-ConfigurableProvider");
-        admin = (ConfigurationAdmin) Utils.getServiceObject(context, ConfigurationAdmin.class.getName(), null);
+        factory = (ComponentFactory) Utils.getFactoryByName(getContext(), "CA-ConfigurableProvider");
+        admin = (ConfigurationAdmin) Utils.getServiceObject(getContext(), ConfigurationAdmin.class.getName(), null);
         assertNotNull("Check configuration admin availability", admin);
         try {
             Configuration[] configurations = admin.listConfigurations("(service.factoryPid=CA-ConfigurableProvider)");
@@ -78,16 +78,16 @@
         System.out.println("PID : " + pid);
         
         //  The instance should be created, wait for the architecture service
-        Utils.waitForService(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
-        Architecture architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Check no object", 0, architecture.getInstanceDescription().getCreatedObjects().length);
         
-        FooService fs = (FooService) Utils.getServiceObject(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message", mes);
         assertEquals("Assert count", 1, count);
@@ -102,11 +102,11 @@
             fail(e.getMessage());
         }
         
-        fs = (FooService) Utils.getServiceObject(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         assertEquals("Assert count", 2, count);
@@ -119,7 +119,7 @@
             fail(e.getMessage());
         }
         
-        ServiceReference ref = Utils.getServiceReference(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         assertNull("Check unavailability", ref);
     }
     
@@ -146,8 +146,8 @@
         String pid = configuration.getPid();
         
         //  The instance should be created, wait for the architecture service
-        Utils.waitForService(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
-        Architecture architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Check no object", 0, architecture.getInstanceDescription().getCreatedObjects().length);
         
@@ -160,16 +160,16 @@
             fail(e.getMessage());
         }
         
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Check no object -2", 0, architecture.getInstanceDescription().getCreatedObjects().length);
         
         //Invoke
-        FooService fs = (FooService) Utils.getServiceObject(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         assertEquals("Assert count", 1, count);
@@ -182,7 +182,7 @@
             fail(e.getMessage());
         }
         
-        ServiceReference ref = Utils.getServiceReference(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         assertNull("Check unavailability", ref);
     }
     
@@ -208,22 +208,22 @@
         
         String pid = configuration.getPid();
         
-        assertNull("check no instance", Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")"));
+        assertNull("check no instance", Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")"));
         
         factory.start();
         
         
         //  The instance should be created, wait for the architecture service
-        Utils.waitForService(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
-        Architecture architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Check no object", 0, architecture.getInstanceDescription().getCreatedObjects().length);
         
-        FooService fs = (FooService) Utils.getServiceObject(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message", mes);
         assertEquals("Assert count", 1, count);
@@ -242,11 +242,11 @@
         
         System.out.println("===");
         
-        fs = (FooService) Utils.getServiceObject(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         assertEquals("Assert count", 2, count);
@@ -259,7 +259,7 @@
             fail(e.getMessage());
         }
         
-        ServiceReference ref = Utils.getServiceReference(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         assertNull("Check unavailability", ref);
     }
     
@@ -287,14 +287,14 @@
         String pid = configuration.getPid();
         System.out.println("PID : " + pid);
         
-        assertNull("check no instance", Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")"));
+        assertNull("check no instance", Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")"));
         
         factory.start();
         
         
         //  The instance should be created, wait for the architecture service
-        Utils.waitForService(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
-        Architecture architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Check no object", 0, architecture.getInstanceDescription().getCreatedObjects().length);
         
@@ -307,16 +307,16 @@
             fail(e.getMessage());
         }
         
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Check no object -2", 0, architecture.getInstanceDescription().getCreatedObjects().length);
         
         //Invoke
-        FooService fs = (FooService) Utils.getServiceObject(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         assertEquals("Assert count", 1, count);
@@ -329,7 +329,7 @@
             fail(e.getMessage());
         }
         
-        ServiceReference ref = Utils.getServiceReference(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         assertNull("Check unavailability", ref);
     }
     
diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForImmediate.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForImmediate.java
index 1027afc..c050b16 100644
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForImmediate.java
+++ b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForImmediate.java
@@ -28,11 +28,11 @@
     
     
     public void setUp() {
-        factImm = (ComponentFactory) Utils.getFactoryByName(context, factNameImm);
-        admin = (ConfigurationAdmin) Utils.getServiceObject(context, ConfigurationAdmin.class.getName(), null);
+        factImm = (ComponentFactory) Utils.getFactoryByName(getContext(), factNameImm);
+        admin = (ConfigurationAdmin) Utils.getServiceObject(getContext(), ConfigurationAdmin.class.getName(), null);
         assertNotNull("Check configuration admin availability", admin);
         cleanConfigurationAdmin();
-        listener = new ConfigurationMonitor(context);
+        listener = new ConfigurationMonitor(getContext());
     }
     
     public void tearDown() {
@@ -67,11 +67,11 @@
            fail(e.getMessage());
         }
         
-        ServiceReference ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
         assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
-        FooService fs = (FooService) context.getService(ref);
+        FooService fs = (FooService) getContext().getService(ref);
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
@@ -95,11 +95,11 @@
             fail(e.getMessage());
         }
         
-        ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
         assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
-        fs = (FooService) context.getService(ref);
+        fs = (FooService) getContext().getService(ref);
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
@@ -128,14 +128,14 @@
         }
         
         
-        Architecture arch = (Architecture) Utils.getServiceObject(context, org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
+        Architecture arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
         
-        ServiceReference ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), conf.getPid());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), conf.getPid());
         assertEquals("Check 1 object", 1, arch.getInstanceDescription().getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
-        arch = (Architecture) Utils.getServiceObject(context, org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
-        FooService fs = (FooService) context.getService(ref);
+        arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
+        FooService fs = (FooService) getContext().getService(ref);
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
@@ -159,13 +159,13 @@
             fail(e.getMessage());
         }
         
-        arch = (Architecture) Utils.getServiceObject(context, org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
-        ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), conf.getPid());
+        arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
+        ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), conf.getPid());
         assertEquals("Check 1 object", 1, arch.getInstanceDescription().getCreatedObjects().length);
         assertNotNull("FS availability", ref);
 
-        arch = (Architecture) Utils.getServiceObject(context, org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
-        fs = (FooService) context.getService(ref);
+        arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
+        fs = (FooService) getContext().getService(ref);
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
@@ -210,11 +210,11 @@
            fail(e.getMessage());
         }
         
-        ServiceReference ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
         assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
-        FooService fs = (FooService) context.getService(ref);
+        FooService fs = (FooService) getContext().getService(ref);
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
       //  int count1 = ((Integer) p.get("count")).intValue();
@@ -250,11 +250,11 @@
         } catch (Exception e) {
            fail(e.getMessage());
         }
-        ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
         assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
-        fs = (FooService) context.getService(ref);
+        fs = (FooService) getContext().getService(ref);
         p = fs.fooProps();
         mes = p.getProperty("message");
        // int count = ((Integer) p.get("count")).intValue();
@@ -296,11 +296,11 @@
            fail(e.getMessage());
         }
         
-        ServiceReference ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
         assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
-        FooService fs = (FooService) context.getService(ref);
+        FooService fs = (FooService) getContext().getService(ref);
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
       // int count = ((Integer) p.get("count")).intValue();
@@ -336,11 +336,11 @@
            fail(e.getMessage());
         }
         
-        ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
         assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
-        fs = (FooService) context.getService(ref);
+        fs = (FooService) getContext().getService(ref);
         p = fs.fooProps();
         mes = p.getProperty("message");
       //  count = ((Integer) p.get("count")).intValue();
diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForService.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForService.java
index 1b39dc4..043c84d 100644
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForService.java
+++ b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForService.java
@@ -28,11 +28,11 @@
     
     
     public void setUp() {
-        factSvc = (ComponentFactory) Utils.getFactoryByName(context, factNameSvc);
-        admin = (ConfigurationAdmin) Utils.getServiceObject(context, ConfigurationAdmin.class.getName(), null);
+        factSvc = (ComponentFactory) Utils.getFactoryByName(getContext(), factNameSvc);
+        admin = (ConfigurationAdmin) Utils.getServiceObject(getContext(), ConfigurationAdmin.class.getName(), null);
         assertNotNull("Check configuration admin availability", admin);
         cleanConfigurationAdmin();
-        listener = new ConfigurationMonitor(context);
+        listener = new ConfigurationMonitor(getContext());
     }
     
     public void tearDown() {
@@ -67,11 +67,11 @@
            fail(e.getMessage());
         }
         
-        ServiceReference ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
         assertEquals("Check no object", 0, instance.getInstanceDescription().getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
-        FooService fs = (FooService) context.getService(ref);
+        FooService fs = (FooService) getContext().getService(ref);
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
@@ -94,11 +94,11 @@
             fail(e.getMessage());
         }
         
-        ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
         assertEquals("Check 1 object", 1, instance.getInstanceDescription().getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
-        fs = (FooService) context.getService(ref);
+        fs = (FooService) getContext().getService(ref);
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
@@ -127,14 +127,14 @@
         }
         
         
-        Architecture arch = (Architecture) Utils.getServiceObject(context, org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
+        Architecture arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
         
-        ServiceReference ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), conf.getPid());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), conf.getPid());
         assertEquals("Check no object", 0, arch.getInstanceDescription().getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
-        arch = (Architecture) Utils.getServiceObject(context, org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
-        FooService fs = (FooService) context.getService(ref);
+        arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
+        FooService fs = (FooService) getContext().getService(ref);
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
@@ -157,13 +157,13 @@
             fail(e.getMessage());
         }
         
-        arch = (Architecture) Utils.getServiceObject(context, org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
-        ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), conf.getPid());
+        arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
+        ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), conf.getPid());
         assertEquals("Check 1 object", 1, arch.getInstanceDescription().getCreatedObjects().length);
         assertNotNull("FS availability", ref);
 
-        arch = (Architecture) Utils.getServiceObject(context, org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
-        fs = (FooService) context.getService(ref);
+        arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
+        fs = (FooService) getContext().getService(ref);
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
@@ -208,11 +208,11 @@
            fail(e.getMessage());
         }
         
-        ServiceReference ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
         assertEquals("Check no object", 0, instance.getInstanceDescription().getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
-        FooService fs = (FooService) context.getService(ref);
+        FooService fs = (FooService) getContext().getService(ref);
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
@@ -248,11 +248,11 @@
            fail(e.getMessage());
         }
         
-        ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
         assertEquals("Check no object", 0, instance.getInstanceDescription().getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
-        fs = (FooService) context.getService(ref);
+        fs = (FooService) getContext().getService(ref);
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
@@ -294,11 +294,11 @@
            fail(e.getMessage());
         }
         
-        ServiceReference ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
         assertEquals("Check no object", 0, instance.getInstanceDescription().getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
-        FooService fs = (FooService) context.getService(ref);
+        FooService fs = (FooService) getContext().getService(ref);
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
@@ -334,11 +334,11 @@
            fail(e.getMessage());
         }
         
-        ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
         assertEquals("Check no object", 0, instance.getInstanceDescription().getCreatedObjects().length);
         assertNotNull("FS availability", ref);
         
-        fs = (FooService) context.getService(ref);
+        fs = (FooService) getContext().getService(ref);
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java
index 52f734a..4610f9d 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java
@@ -40,12 +40,12 @@
 		p1.put("foo", "foo");
 		p1.put("bar", "2");
 		p1.put("baz", "baz");
-		instance = Utils.getComponentInstance(context, type, p1);
+		instance = Utils.getComponentInstance(getContext(), type, p1);
 		
 		Properties p2 = new Properties();
         p2.put("instance.name","instance2");
 
-        instance2 = Utils.getComponentInstance(context, type, p2);
+        instance2 = Utils.getComponentInstance(getContext(), type, p2);
 	}
 	
 	public void tearDown() {
@@ -56,7 +56,7 @@
 	}
 	
 	public void testStatic() {
-		ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
 		assertNotNull("Check FS availability", fooRef);
 		String fooP = (String) fooRef.getProperty("foo");
 		Integer barP = (Integer) fooRef.getProperty("bar");
@@ -65,7 +65,7 @@
 		assertEquals("Check bar equality -1", barP, new Integer(2));
 		assertEquals("Check baz equality -1", bazP, "baz");
 		
-		ServiceReference msRef = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), instance.getFactory().getName());
+		ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance.getFactory().getName());
 		assertNotNull("Check ManagedServiceFactory availability", msRef);
 		
 		
@@ -74,24 +74,24 @@
 		conf.put("baz", "zab");
 		conf.put("bar", new Integer(2));
 		conf.put("foo", "foo");
-		ManagedServiceFactory ms = (ManagedServiceFactory) context.getService(msRef);
+		ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
 		try {
 			ms.updated(instance.getInstanceName(), conf);
 		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
 		
 		// Recheck props
-		fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
 		fooP = (String) fooRef.getProperty("foo");
 		barP = (Integer) fooRef.getProperty("bar");
 		bazP = (String) fooRef.getProperty("baz");
 		assertEquals("Check foo equality -2", fooP, "foo");
 		assertEquals("Check bar equality -2", barP, new Integer(2));
 		assertEquals("Check baz equality -2", bazP, "zab");
-		context.ungetService(msRef);
+		getContext().ungetService(msRef);
 	}
 	
 	public void testStaticNoValue() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());
+        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check FS availability", fooRef);
         Object fooP = fooRef.getProperty("foo");
         Object barP = fooRef.getProperty("bar");
@@ -100,7 +100,7 @@
         assertEquals("Check bar equality -1", barP, null);
         assertEquals("Check baz equality -1", bazP, null);
         
-        ServiceReference msRef = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), instance2.getFactory().getName());
+        ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance2.getFactory().getName());
         assertNotNull("Check ManagedServiceFactory availability", msRef);
         
         
@@ -109,24 +109,24 @@
         conf.put("baz", "zab");
         conf.put("bar", new Integer(2));
         conf.put("foo", "foo");
-        ManagedServiceFactory ms = (ManagedServiceFactory) context.getService(msRef);
+        ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
         try {
             ms.updated(instance2.getInstanceName(), conf);
         } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
         
         // Recheck props
-        fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());
+        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
         fooP = (String) fooRef.getProperty("foo");
         barP = (Integer) fooRef.getProperty("bar");
         bazP = (String) fooRef.getProperty("baz");
         assertEquals("Check foo equality -2", fooP, "foo");
         assertEquals("Check bar equality -2", barP, new Integer(2));
         assertEquals("Check baz equality -2", bazP, "zab");
-        context.ungetService(msRef);
+        getContext().ungetService(msRef);
     }
 	
 	public void testDynamic() {
-    	ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+    	ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
     	assertNotNull("Check FS availability", fooRef);
     	
     	String fooP = (String) fooRef.getProperty("foo");
@@ -137,7 +137,7 @@
     	assertEquals("Check bar equality", barP, new Integer(2));
     	assertEquals("Check baz equality", bazP, "baz");
     	
-    	ServiceReference msRef = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), instance.getFactory().getName());
+    	ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance.getFactory().getName());
     	assertNotNull("Check ManagedServiceFactory availability", msRef);
     	
     	// Configuration of baz
@@ -145,13 +145,13 @@
     	conf.put("baz", "zab");
     	conf.put("foo", "oof");
     	conf.put("bar", new Integer(0));
-    	ManagedServiceFactory ms = (ManagedServiceFactory) context.getService(msRef);
+    	ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
     	try {
     		ms.updated(instance.getInstanceName(), conf);
     	} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
     	
     	// Recheck props
-    	fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+    	fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
     	fooP = (String) fooRef.getProperty("foo");
     	barP = (Integer) fooRef.getProperty("bar");
     	bazP = (String) fooRef.getProperty("baz");
@@ -161,7 +161,7 @@
     	assertEquals("Check baz equality", bazP, "zab");
     	
     	// Check field value
-    	FooService fs = (FooService) context.getService(fooRef);
+    	FooService fs = (FooService) getContext().getService(fooRef);
     	Properties p = fs.fooProps();
     	fooP = (String) p.get("foo");
     	barP = (Integer) p.get("bar");
@@ -169,12 +169,12 @@
     	assertEquals("Check foo field equality", fooP, "oof");
     	assertEquals("Check bar field equality", barP, new Integer(0));
     	
-    	context.ungetService(fooRef);
-    	context.ungetService(msRef);
+    	getContext().ungetService(fooRef);
+    	getContext().ungetService(msRef);
     }
 	
 	public void testDynamicNoValue() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());
+        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check FS availability", fooRef);
         
         Object fooP = fooRef.getProperty("foo");
@@ -184,7 +184,7 @@
         assertEquals("Check bar equality -1", barP, null);
         assertEquals("Check baz equality -1", bazP, null);
         
-        ServiceReference msRef = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), instance2.getFactory().getName());
+        ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance2.getFactory().getName());
         assertNotNull("Check ManagedServiceFactory availability", msRef);
         
         // Configuration of baz
@@ -192,13 +192,13 @@
         conf.put("baz", "zab");
         conf.put("foo", "oof");
         conf.put("bar", new Integer(0));
-        ManagedServiceFactory ms = (ManagedServiceFactory) context.getService(msRef);
+        ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
         try {
             ms.updated(instance2.getInstanceName(), conf);
         } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
         
         // Recheck props
-        fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());
+        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
         fooP = (String) fooRef.getProperty("foo");
         barP = (Integer) fooRef.getProperty("bar");
         bazP = (String) fooRef.getProperty("baz");
@@ -208,7 +208,7 @@
         assertEquals("Check baz equality", bazP, "zab");
         
         // Check field value
-        FooService fs = (FooService) context.getService(fooRef);
+        FooService fs = (FooService) getContext().getService(fooRef);
         Properties p = fs.fooProps();
         fooP = (String) p.get("foo");
         barP = (Integer) p.get("bar");
@@ -216,13 +216,13 @@
         assertEquals("Check foo field equality", fooP, "oof");
         assertEquals("Check bar field equality", barP, new Integer(0));
         
-        context.ungetService(fooRef);
-        context.ungetService(msRef);
+        getContext().ungetService(fooRef);
+        getContext().ungetService(msRef);
     }
 
 
     public void testDynamicString() {
-		ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
 		assertNotNull("Check FS availability", fooRef);
 		
 		String fooP = (String) fooRef.getProperty("foo");
@@ -233,7 +233,7 @@
 		assertEquals("Check bar equality", barP, new Integer(2));
 		assertEquals("Check baz equality", bazP, "baz");
 		
-		ServiceReference msRef = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), instance.getFactory().getName());
+		ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance.getFactory().getName());
 		assertNotNull("Check ManagedServiceFactory availability", msRef);
 		
 		// Configuration of baz
@@ -241,13 +241,13 @@
 		conf.put("baz", "zab");
 		conf.put("foo", "oof");
 		conf.put("bar", "0");
-		ManagedServiceFactory ms = (ManagedServiceFactory) context.getService(msRef);
+		ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
 		try {
 			ms.updated(instance.getInstanceName(), conf);
 		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
 		
 		// Recheck props
-		fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
 		fooP = (String) fooRef.getProperty("foo");
 		barP = (Integer) fooRef.getProperty("bar");
 		bazP = (String) fooRef.getProperty("baz");
@@ -257,7 +257,7 @@
 		assertEquals("Check baz equality", bazP, "zab");
 		
 		// Check field value
-		FooService fs = (FooService) context.getService(fooRef);
+		FooService fs = (FooService) getContext().getService(fooRef);
 		Properties p = fs.fooProps();
 		fooP = (String) p.get("foo");
 		barP = (Integer) p.get("bar");
@@ -265,12 +265,12 @@
 		assertEquals("Check foo field equality", fooP, "oof");
 		assertEquals("Check bar field equality", barP, new Integer(0));
 		
-		context.ungetService(fooRef);
-		context.ungetService(msRef);
+		getContext().ungetService(fooRef);
+		getContext().ungetService(msRef);
 	}
 	
 	public void testPropagation() {
-		ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
 		assertNotNull("Check FS availability", fooRef);
 		
 		String fooP = (String) fooRef.getProperty("foo");
@@ -281,7 +281,7 @@
 		assertEquals("Check bar equality", barP, new Integer(2));
 		assertEquals("Check baz equality", bazP, "baz");
 		
-		ServiceReference msRef = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), instance.getFactory().getName());
+		ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance.getFactory().getName());
 		assertNotNull("Check ManagedServiceFactory availability", msRef);
 		
 		// Configuration of baz
@@ -291,13 +291,13 @@
 		conf.put("bar", new Integer(2));
 		conf.put("propagated1", "propagated");
 		conf.put("propagated2", new Integer(1));
-		ManagedServiceFactory ms = (ManagedServiceFactory) context.getService(msRef);
+		ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
 		try {
 			ms.updated(instance.getInstanceName(), conf);
 		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
 		
 		// Recheck props
-		fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance.getInstanceName());
+		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
 		fooP = (String) fooRef.getProperty("foo");
 		barP = (Integer) fooRef.getProperty("bar");
 		bazP = (String) fooRef.getProperty("baz");
@@ -312,11 +312,11 @@
 		assertEquals("Check propagated1 equality", prop1, "propagated");
 		assertEquals("Check propagated2 equality", prop2, new Integer(1));
 		
-		context.ungetService(msRef);
+		getContext().ungetService(msRef);
 	}
 	
 	public void testPropagationNoValue() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());
+        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check FS availability", fooRef);
         
         Object fooP = fooRef.getProperty("foo");
@@ -326,7 +326,7 @@
         assertEquals("Check bar equality -1", barP, null);
         assertEquals("Check baz equality -1", bazP, null);
         
-        ServiceReference msRef = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), instance2.getFactory().getName());
+        ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance2.getFactory().getName());
         assertNotNull("Check ManagedServiceFactory availability", msRef);
         
         // Configuration of baz
@@ -336,13 +336,13 @@
         conf.put("bar", new Integer(2));
         conf.put("propagated1", "propagated");
         conf.put("propagated2", new Integer(1));
-        ManagedServiceFactory ms = (ManagedServiceFactory) context.getService(msRef);
+        ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
         try {
             ms.updated(instance2.getInstanceName(), conf);
         } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
         
         // Recheck props
-        fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());
+        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
         fooP = (String) fooRef.getProperty("foo");
         barP = (Integer) fooRef.getProperty("bar");
         bazP = (String) fooRef.getProperty("baz");
@@ -357,7 +357,7 @@
         assertEquals("Check propagated1 equality", prop1, "propagated");
         assertEquals("Check propagated2 equality", prop2, new Integer(1));
         
-        context.ungetService(msRef);
+        getContext().ungetService(msRef);
     }
 
 }
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ManagedServiceConfigurableProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ManagedServiceConfigurableProperties.java
index 639ea4b..754d33a 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ManagedServiceConfigurableProperties.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ManagedServiceConfigurableProperties.java
@@ -52,7 +52,7 @@
         p.put("foo", "foo");
         p.put("bar", "2");
         p.put("baz", "baz");
-        instance1 = Utils.getComponentInstance(context, type, p);
+        instance1 = Utils.getComponentInstance(getContext(), type, p);
         assertEquals("instance1 created", ComponentInstance.VALID,instance1.getState());
         
 		type = "CONFIG-FooProviderType-3";
@@ -62,13 +62,13 @@
 		p1.put("bar", "2");
 		p1.put("baz", "baz");
 		p1.put("managed.service.pid", "instance");
-		instance2 = Utils.getComponentInstance(context, type, p1);
+		instance2 = Utils.getComponentInstance(getContext(), type, p1);
 		
 		type = "CONFIG-FooProviderType-3";
         Properties p2 = new Properties();
         p2.put("instance.name","instance-3");
         p2.put("managed.service.pid", "instance-3");
-        instance3 = Utils.getComponentInstance(context, type, p2);
+        instance3 = Utils.getComponentInstance(getContext(), type, p2);
 	}
 	
 	public void tearDown() {
@@ -81,7 +81,7 @@
 	}
 	
 	public void testStaticInstance1() {
-		ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance1.getInstanceName());
+		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check FS availability", fooRef);
 		String fooP = (String) fooRef.getProperty("foo");
 		Integer barP = (Integer) fooRef.getProperty("bar");
@@ -90,7 +90,7 @@
 		assertEquals("Check bar equality -1", barP, new Integer(2));
 		assertEquals("Check baz equality -1", bazP, "baz");
 		
-		ServiceReference msRef = Utils.getServiceReferenceByPID(context, ManagedService.class.getName(), "FooProvider-3");
+		ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "FooProvider-3");
 		assertNotNull("Check ManagedServiceFactory availability", msRef);
 		
 		// Configuration of baz
@@ -98,24 +98,24 @@
 		conf.put("baz", "zab");
 		conf.put("bar", new Integer(2));
 		conf.put("foo", "foo");
-		ManagedService ms = (ManagedService) context.getService(msRef);
+		ManagedService ms = (ManagedService) getContext().getService(msRef);
 		try {
 			ms.updated(conf);
 		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
 		
 		// Re-check props
-		fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance1.getInstanceName());
+		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
 		fooP = (String) fooRef.getProperty("foo");
 		barP = (Integer) fooRef.getProperty("bar");
 		bazP = (String) fooRef.getProperty("baz");
 		assertEquals("Check foo equality -2", fooP, "foo");
 		assertEquals("Check bar equality -2", barP, new Integer(2));
 		assertEquals("Check baz equality -2", bazP, "zab");
-		context.ungetService(msRef);
+		getContext().ungetService(msRef);
 	}
 	
 	public void testStaticInstance2() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());
+        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check FS availability", fooRef);
         String fooP = (String) fooRef.getProperty("foo");
         Integer barP = (Integer) fooRef.getProperty("bar");
@@ -124,7 +124,7 @@
         assertEquals("Check bar equality -1", barP, new Integer(2));
         assertEquals("Check baz equality -1", bazP, "baz");
         
-        ServiceReference msRef = Utils.getServiceReferenceByPID(context, ManagedService.class.getName(), "instance");
+        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance");
         assertNotNull("Check ManagedService availability", msRef);
         
         
@@ -133,25 +133,25 @@
         conf.put("baz", "zab");
         conf.put("bar", new Integer(2));
         conf.put("foo", "foo");
-        ManagedService ms = (ManagedService) context.getService(msRef);
+        ManagedService ms = (ManagedService) getContext().getService(msRef);
         try {
             ms.updated(conf);
         } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
         
         // Recheck props
-        fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());
+        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
         fooP = (String) fooRef.getProperty("foo");
         barP = (Integer) fooRef.getProperty("bar");
         bazP = (String) fooRef.getProperty("baz");
         assertEquals("Check foo equality -2", fooP, "foo");
         assertEquals("Check bar equality -2", barP, new Integer(2));
         assertEquals("Check baz equality -2", bazP, "zab");
-        context.ungetService(fooRef);
-        context.ungetService(msRef);
+        getContext().ungetService(fooRef);
+        getContext().ungetService(msRef);
     }
 	
 	public void testStaticInstance3() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance3.getInstanceName());
+        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check FS availability", fooRef);
         Object fooP = fooRef.getProperty("foo");
         Object barP =  fooRef.getProperty("bar");
@@ -161,7 +161,7 @@
         assertEquals("Check bar equality -1", barP, null);
         assertEquals("Check baz equality -1", bazP, null);
         
-        ServiceReference msRef = Utils.getServiceReferenceByPID(context, ManagedService.class.getName(), "instance-3");
+        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance-3");
         assertNotNull("Check ManagedService availability", msRef);
         
         
@@ -170,25 +170,25 @@
         conf.put("baz", "zab");
         conf.put("bar", new Integer(2));
         conf.put("foo", "foo");
-        ManagedService ms = (ManagedService) context.getService(msRef);
+        ManagedService ms = (ManagedService) getContext().getService(msRef);
         try {
             ms.updated(conf);
         } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
         
         // Recheck props
-        fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance3.getInstanceName());
+        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance3.getInstanceName());
         fooP = (String) fooRef.getProperty("foo");
         barP = (Integer) fooRef.getProperty("bar");
         bazP = (String) fooRef.getProperty("baz");
         assertEquals("Check foo equality -2", fooP, "foo");
         assertEquals("Check bar equality -2", barP, new Integer(2));
         assertEquals("Check baz equality -2", bazP, "zab");
-        context.ungetService(fooRef);
-        context.ungetService(msRef);
+        getContext().ungetService(fooRef);
+        getContext().ungetService(msRef);
     }
 	
 	public void testDynamicInstance1() {
-    	ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance1.getInstanceName());
+    	ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
     	assertNotNull("Check FS availability", fooRef);
     	
     	String fooP = (String) fooRef.getProperty("foo");
@@ -199,7 +199,7 @@
     	assertEquals("Check bar equality", barP, new Integer(2));
     	assertEquals("Check baz equality", bazP, "baz");
     	
-    	ServiceReference msRef = Utils.getServiceReferenceByPID(context, ManagedService.class.getName(), "FooProvider-3");
+    	ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "FooProvider-3");
     	assertNotNull("Check ManagedServiceFactory availability", msRef);
     	
     	// Configuration of baz
@@ -207,13 +207,13 @@
     	conf.put("baz", "zab");
     	conf.put("foo", "oof");
     	conf.put("bar", new Integer(0));
-    	ManagedService ms = (ManagedService) context.getService(msRef);
+    	ManagedService ms = (ManagedService) getContext().getService(msRef);
     	try {
     		ms.updated(conf);
     	} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
     	
     	// Re-check props
-    	fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance1.getInstanceName());
+    	fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
     	fooP = (String) fooRef.getProperty("foo");
     	barP = (Integer) fooRef.getProperty("bar");
     	bazP = (String) fooRef.getProperty("baz");
@@ -223,7 +223,7 @@
     	assertEquals("Check baz equality", bazP, "zab");
     	
     	// Check field value
-    	FooService fs = (FooService) context.getService(fooRef);
+    	FooService fs = (FooService) getContext().getService(fooRef);
     	Properties p = fs.fooProps();
     	fooP = (String) p.get("foo");
     	barP = (Integer) p.get("bar");
@@ -231,12 +231,12 @@
     	assertEquals("Check foo field equality", fooP, "oof");
     	assertEquals("Check bar field equality", barP, new Integer(0));
     	
-    	context.ungetService(fooRef);
-    	context.ungetService(msRef);
+    	getContext().ungetService(fooRef);
+    	getContext().ungetService(msRef);
     }
 	
 	public void testDynamicInstance2() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());
+        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check FS availability", fooRef);
         
         String fooP = (String) fooRef.getProperty("foo");
@@ -247,7 +247,7 @@
         assertEquals("Check bar equality", barP, new Integer(2));
         assertEquals("Check baz equality", bazP, "baz");
         
-        ServiceReference msRef = Utils.getServiceReferenceByPID(context, ManagedService.class.getName(), "instance");
+        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance");
         assertNotNull("Check ManagedServiceFactory availability", msRef);
         
         // Configuration of baz
@@ -255,13 +255,13 @@
         conf.put("baz", "zab");
         conf.put("foo", "oof");
         conf.put("bar", new Integer(0));
-        ManagedService ms = (ManagedService) context.getService(msRef);
+        ManagedService ms = (ManagedService) getContext().getService(msRef);
         try {
             ms.updated(conf);
         } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
         
         // Recheck props
-        fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());
+        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
         fooP = (String) fooRef.getProperty("foo");
         barP = (Integer) fooRef.getProperty("bar");
         bazP = (String) fooRef.getProperty("baz");
@@ -271,7 +271,7 @@
         assertEquals("Check baz equality", bazP, "zab");
         
         // Check field value
-        FooService fs = (FooService) context.getService(fooRef);
+        FooService fs = (FooService) getContext().getService(fooRef);
         Properties p = fs.fooProps();
         fooP = (String) p.get("foo");
         barP = (Integer) p.get("bar");
@@ -279,12 +279,12 @@
         assertEquals("Check foo field equality", fooP, "oof");
         assertEquals("Check bar field equality", barP, new Integer(0));
         
-        context.ungetService(fooRef);
-        context.ungetService(msRef);
+        getContext().ungetService(fooRef);
+        getContext().ungetService(msRef);
     }
 	
 	public void testDynamicInstance3() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance3.getInstanceName());
+        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check FS availability", fooRef);
         
         Object fooP = fooRef.getProperty("foo");
@@ -295,7 +295,7 @@
         assertEquals("Check bar equality", barP, null);
         assertEquals("Check baz equality", bazP, null);
         
-        ServiceReference msRef = Utils.getServiceReferenceByPID(context, ManagedService.class.getName(), "instance-3");
+        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance-3");
         assertNotNull("Check ManagedServiceFactory availability", msRef);
         
         // Configuration of baz
@@ -303,13 +303,13 @@
         conf.put("baz", "zab");
         conf.put("foo", "oof");
         conf.put("bar", new Integer(0));
-        ManagedService ms = (ManagedService) context.getService(msRef);
+        ManagedService ms = (ManagedService) getContext().getService(msRef);
         try {
             ms.updated(conf);
         } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
         
         // Recheck props
-        fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance3.getInstanceName());
+        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance3.getInstanceName());
         fooP = (String) fooRef.getProperty("foo");
         barP = (Integer) fooRef.getProperty("bar");
         bazP = (String) fooRef.getProperty("baz");
@@ -319,7 +319,7 @@
         assertEquals("Check baz equality", bazP, "zab");
         
         // Check field value
-        FooService fs = (FooService) context.getService(fooRef);
+        FooService fs = (FooService) getContext().getService(fooRef);
         Properties p = fs.fooProps();
         fooP = (String) p.get("foo");
         barP = (Integer) p.get("bar");
@@ -327,13 +327,13 @@
         assertEquals("Check foo field equality", fooP, "oof");
         assertEquals("Check bar field equality", barP, new Integer(0));
         
-        context.ungetService(fooRef);
-        context.ungetService(msRef);
+        getContext().ungetService(fooRef);
+        getContext().ungetService(msRef);
     }
 
     public void testDynamicStringInstance1() {
         assertEquals("Check instance1 state", ComponentInstance.VALID,instance1.getState());
-		ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance1.getInstanceName());
+		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check FS availability", fooRef);
 		
 		String fooP = (String) fooRef.getProperty("foo");
@@ -344,7 +344,7 @@
 		assertEquals("Check bar equality - 1", barP, new Integer(2));
 		assertEquals("Check baz equality - 1", bazP, "baz");
 		
-		ServiceReference msRef = Utils.getServiceReferenceByPID(context, ManagedService.class.getName(), "FooProvider-3");
+		ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "FooProvider-3");
 		assertNotNull("Check ManagedService availability", msRef);
 		
 		// Configuration of baz
@@ -353,7 +353,7 @@
 		conf.put("foo", "oof");
 		conf.put("bar", "0");
         assertEquals("Check instance1 state (2)", ComponentInstance.VALID,instance1.getState());
-		ManagedService ms = (ManagedService) context.getService(msRef);
+		ManagedService ms = (ManagedService) getContext().getService(msRef);
 		
 		PrimitiveHandler ph = (PrimitiveHandler) ms;
 		assertSame("Check the correct instance", ph.getInstanceManager(), instance1);
@@ -364,7 +364,7 @@
 		assertEquals("Check instance1 state (3)", ComponentInstance.VALID,instance1.getState());
 		
 		// Recheck props
-		fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance1.getInstanceName());
+		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
 		fooP = (String) fooRef.getProperty("foo");
 		barP = (Integer) fooRef.getProperty("bar");
 		bazP = (String) fooRef.getProperty("baz");
@@ -374,7 +374,7 @@
 		assertEquals("Check baz equality - 2", bazP, "zab");
 		
 		// Check field value
-		FooService fs = (FooService) context.getService(fooRef);
+		FooService fs = (FooService) getContext().getService(fooRef);
 		Properties p = fs.fooProps();
 		fooP = (String) p.get("foo");
 		barP = (Integer) p.get("bar");
@@ -382,12 +382,12 @@
 		assertEquals("Check foo field equality", fooP, "oof");
 		assertEquals("Check bar field equality", barP, new Integer(0));
 		
-		context.ungetService(fooRef);
-		context.ungetService(msRef);
+		getContext().ungetService(fooRef);
+		getContext().ungetService(msRef);
 	}
     
     public void testDynamicStringInstance2() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());
+        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check FS availability", fooRef);
         
         String fooP = (String) fooRef.getProperty("foo");
@@ -398,7 +398,7 @@
         assertEquals("Check bar equality", barP, new Integer(2));
         assertEquals("Check baz equality", bazP, "baz");
         
-        ServiceReference msRef = Utils.getServiceReferenceByPID(context, ManagedService.class.getName(), "instance");
+        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance");
         assertNotNull("Check ManagedService availability", msRef);
         
         // Configuration of baz
@@ -406,13 +406,13 @@
         conf.put("baz", "zab");
         conf.put("foo", "oof");
         conf.put("bar", "0");
-        ManagedService ms = (ManagedService) context.getService(msRef);
+        ManagedService ms = (ManagedService) getContext().getService(msRef);
         try {
             ms.updated(conf);
         } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
         
         // Recheck props
-        fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());
+        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
         fooP = (String) fooRef.getProperty("foo");
         barP = (Integer) fooRef.getProperty("bar");
         bazP = (String) fooRef.getProperty("baz");
@@ -422,7 +422,7 @@
         assertEquals("Check baz equality", bazP, "zab");
         
         // Check field value
-        FooService fs = (FooService) context.getService(fooRef);
+        FooService fs = (FooService) getContext().getService(fooRef);
         Properties p = fs.fooProps();
         fooP = (String) p.get("foo");
         barP = (Integer) p.get("bar");
@@ -430,12 +430,12 @@
         assertEquals("Check foo field equality", fooP, "oof");
         assertEquals("Check bar field equality", barP, new Integer(0));
         
-        context.ungetService(fooRef);
-        context.ungetService(msRef);
+        getContext().ungetService(fooRef);
+        getContext().ungetService(msRef);
     }
 	
 	public void testPropagationInstance1() {
-		ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance1.getInstanceName());
+		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check FS availability", fooRef);
 		
 		String fooP = (String) fooRef.getProperty("foo");
@@ -446,7 +446,7 @@
 		assertEquals("Check bar equality", barP, new Integer(2));
 		assertEquals("Check baz equality", bazP, "baz");
 		
-		ServiceReference msRef = Utils.getServiceReferenceByPID(context, ManagedService.class.getName(), "FooProvider-3");
+		ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "FooProvider-3");
 		assertNotNull("Check ManagedService availability", msRef);
 		
 		// Configuration of baz
@@ -456,13 +456,13 @@
 		conf.put("bar", new Integer(2));
 		conf.put("propagated1", "propagated");
 		conf.put("propagated2", new Integer(1));
-		ManagedService ms = (ManagedService) context.getService(msRef);
+		ManagedService ms = (ManagedService) getContext().getService(msRef);
 		try {
 			ms.updated(conf);
 		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
 		
 		// Recheck props
-		fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance1.getInstanceName());
+		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
 		fooP = (String) fooRef.getProperty("foo");
 		barP = (Integer) fooRef.getProperty("bar");
 		bazP = (String) fooRef.getProperty("baz");
@@ -477,11 +477,11 @@
 		assertEquals("Check propagated1 equality", prop1, "propagated");
 		assertEquals("Check propagated2 equality", prop2, new Integer(1));
 		
-		context.ungetService(msRef);
+		getContext().ungetService(msRef);
 	}
 	
 	public void testPropagationInstance2() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());
+        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check FS availability", fooRef);
         
         String fooP = (String) fooRef.getProperty("foo");
@@ -492,7 +492,7 @@
         assertEquals("Check bar equality", barP, new Integer(2));
         assertEquals("Check baz equality", bazP, "baz");
         
-        ServiceReference msRef = Utils.getServiceReferenceByPID(context, ManagedService.class.getName(), "instance");
+        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance");
         assertNotNull("Check ManagedService availability", msRef);
         
         // Configuration of baz
@@ -502,13 +502,13 @@
         conf.put("bar", new Integer(2));
         conf.put("propagated1", "propagated");
         conf.put("propagated2", new Integer(1));
-        ManagedService ms = (ManagedService) context.getService(msRef);
+        ManagedService ms = (ManagedService) getContext().getService(msRef);
         try {
             ms.updated(conf);
         } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
         
         // Recheck props
-        fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance2.getInstanceName());
+        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
         fooP = (String) fooRef.getProperty("foo");
         barP = (Integer) fooRef.getProperty("bar");
         bazP = (String) fooRef.getProperty("baz");
@@ -523,11 +523,11 @@
         assertEquals("Check propagated1 equality", prop1, "propagated");
         assertEquals("Check propagated2 equality", prop2, new Integer(1));
         
-        context.ungetService(msRef);
+        getContext().ungetService(msRef);
     }
 	
 	public void testPropagationInstance3() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance3.getInstanceName());
+        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check FS availability", fooRef);
         
         Object fooP = fooRef.getProperty("foo");
@@ -538,7 +538,7 @@
         assertEquals("Check bar equality", barP, null);
         assertEquals("Check baz equality", bazP, null);
         
-        ServiceReference msRef = Utils.getServiceReferenceByPID(context, ManagedService.class.getName(), "instance-3");
+        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance-3");
         assertNotNull("Check ManagedService availability", msRef);
         
         // Configuration of baz
@@ -548,13 +548,13 @@
         conf.put("bar", new Integer(2));
         conf.put("propagated1", "propagated");
         conf.put("propagated2", new Integer(1));
-        ManagedService ms = (ManagedService) context.getService(msRef);
+        ManagedService ms = (ManagedService) getContext().getService(msRef);
         try {
             ms.updated(conf);
         } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
         
         // Recheck props
-        fooRef = Utils.getServiceReferenceByName(context, FooService.class.getName(), instance3.getInstanceName());
+        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance3.getInstanceName());
         fooP = (String) fooRef.getProperty("foo");
         barP = (Integer) fooRef.getProperty("bar");
         bazP = (String) fooRef.getProperty("baz");
@@ -569,7 +569,7 @@
         assertEquals("Check propagated1 equality", prop1, "propagated");
         assertEquals("Check propagated2 equality", prop2, new Integer(1));
         
-        context.ungetService(msRef);
+        getContext().ungetService(msRef);
     }
 
 }
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java
index 982ff42..9803664 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java
@@ -37,7 +37,7 @@
 		
 		Properties p1 = new Properties();
 		p1.put("instance.name","FooProvider-1");
-		fooProvider1 = Utils.getComponentInstance(context, type, p1);
+		fooProvider1 = Utils.getComponentInstance(getContext(), type, p1);
 		
 		Properties p2 = new Properties();
 		p2.put("instance.name","FooProvider-2");
@@ -46,11 +46,11 @@
 		p2.put("string", new String("bar"));
 		p2.put("strAProp", new String[] {"bar", "foo"});
 		p2.put("intAProp", new int[] {1, 2, 3});
-		fooProvider2 = Utils.getComponentInstance(context, type, p2);
+		fooProvider2 = Utils.getComponentInstance(getContext(), type, p2);
 		
 		Properties p3 = new Properties();
         p3.put("instance.name","FooProvider-3");
-        fooProvider3 = Utils.getComponentInstance(context, "CONFIG-FooProviderType-ConfNoValue", p3);
+        fooProvider3 = Utils.getComponentInstance(getContext(), "CONFIG-FooProviderType-ConfNoValue", p3);
 	}
 	
 	public void tearDown() {
@@ -63,9 +63,9 @@
 	}
 	
 	public void testComponentTypeConfiguration() {
-		ServiceReference ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), fooProvider1.getInstanceName());
+		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check FooService availability", ref);
-		FooService fs = (FooService) context.getService(ref);
+		FooService fs = (FooService) getContext().getService(ref);
 		Properties toCheck = fs.fooProps();
 		
 		Integer intProp = (Integer) toCheck.get("intProp");
@@ -115,14 +115,14 @@
 		}
 		
 		fs = null;
-		context.ungetService(ref);
+		getContext().ungetService(ref);
 	}
 	
 	public void testInstanceConfiguration() {
-		ServiceReference sr = Utils.getServiceReferenceByName(context, FooService.class.getName(), "FooProvider-2");
+		ServiceReference sr = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "FooProvider-2");
 		assertNotNull("Check the availability of the FS service", sr);
 		
-		FooService fs = (FooService) context.getService(sr);
+		FooService fs = (FooService) getContext().getService(sr);
 		Properties toCheck = fs.fooProps();
 		
 		// Check service properties
@@ -172,14 +172,14 @@
 		}
 		
 		fs = null;
-		context.ungetService(sr);	
+		getContext().ungetService(sr);	
 	}
 	
 	public void testNoValue() {
-        ServiceReference sr = Utils.getServiceReferenceByName(context, FooService.class.getName(), "FooProvider-3");
+        ServiceReference sr = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "FooProvider-3");
         assertNotNull("Check the availability of the FS service", sr);
         
-        FooService fs = (FooService) context.getService(sr);
+        FooService fs = (FooService) getContext().getService(sr);
         Properties toCheck = fs.fooProps();
         
         // Check service properties
@@ -220,7 +220,7 @@
         }
         
         fs = null;
-        context.ungetService(sr);   
+        getContext().ungetService(sr);   
     }
 
 }
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java
index d467ad0..899a3e5 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java
@@ -33,7 +33,7 @@
 
     
     public void setUp() {
-        Factory fact = Utils.getFactoryByName(context, "CONFIG-BothConfigurableCheckService");
+        Factory fact = Utils.getFactoryByName(getContext(), "CONFIG-BothConfigurableCheckService");
         Properties props = new Properties();
         props.put("instance.name","under-test");
         props.put("b", "1");
@@ -78,9 +78,9 @@
     }
     
     public void testConfigurationPrimitive() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         Byte b = (Byte) props.get("b");
@@ -121,9 +121,9 @@
         
         reconfigure(instance);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (Byte) props.get("b");
@@ -165,9 +165,9 @@
     }
 
     public void testConfigurationPrimitiveString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         Byte b = (Byte) props.get("b");
@@ -208,9 +208,9 @@
         
         reconfigureString(instance);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (Byte) props.get("b");
@@ -252,9 +252,9 @@
     }
     
     public void testConfigurationPrimitiveArrays() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         byte[] b = (byte[]) props.get("bs");
@@ -311,9 +311,9 @@
         
         reconfigure(instance);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (byte[]) props.get("bs");
@@ -371,9 +371,9 @@
     }
 
     public void testConfigurationPrimitiveArraysString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         byte[] b = (byte[]) props.get("bs");
@@ -430,9 +430,9 @@
         
         reconfigureString(instance);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (byte[]) props.get("bs");
@@ -490,9 +490,9 @@
     }
     
     public void testConfigurationObj() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         String s = (String) props.get("string");
@@ -511,9 +511,9 @@
         
         reconfigure(instance);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         s = (String) props.get("string");
@@ -532,9 +532,9 @@
     }
 
     public void testConfigurationObjString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         String s = (String) props.get("string");
@@ -553,9 +553,9 @@
         
         reconfigureString(instance);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         s = (String) props.get("string");
@@ -622,9 +622,9 @@
     }
 
     public void testConfigurationPrimitiveNoValue() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         Byte b = (Byte) props.get("b");
@@ -665,9 +665,9 @@
         
         reconfigure(instance2);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (Byte) props.get("b");
@@ -709,9 +709,9 @@
     }
 
     public void testConfigurationPrimitiveArraysNoValue() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         byte[] b = (byte[]) props.get("bs");
@@ -752,9 +752,9 @@
         
         reconfigure(instance2);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (byte[]) props.get("bs");
@@ -812,9 +812,9 @@
     }
 
     public void testConfigurationObjNoValue() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         
@@ -833,9 +833,9 @@
         
         reconfigure(instance2);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         s = (String) props.get("string");
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestComplexProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestComplexProperties.java
index f24cc59..dc33f52 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestComplexProperties.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestComplexProperties.java
@@ -15,14 +15,14 @@
     private CheckService m_check;
     
     public void setUp() {
-       m_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "complex");
+       m_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "complex");
        assertNotNull("Complex service availability", m_ref);
-       m_check = (CheckService) context.getService(m_ref);
+       m_check = (CheckService) getContext().getService(m_ref);
     }
     
     public void tearDown() {
         m_check = null;
-        context.ungetService(m_ref);
+        getContext().ungetService(m_ref);
     }
     
     public void testArray() {
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java
index 35335f8..0339b3f 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java
@@ -36,7 +36,7 @@
     ComponentInstance instance2;
     
     public void setUp() {
-        Factory fact = Utils.getFactoryByName(context, "CONFIG-FieldConfigurableCheckService");
+        Factory fact = Utils.getFactoryByName(getContext(), "CONFIG-FieldConfigurableCheckService");
         Properties props = new Properties();
         props.put("instance.name","under-test");
         props.put("b", "1");
@@ -84,9 +84,9 @@
     }
     
     public void testConfigurationPrimitive() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         Byte b = (Byte) props.get("b");
@@ -109,9 +109,9 @@
         
         reconfigure(instance);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (Byte) props.get("b");
@@ -135,9 +135,9 @@
     }
     
     public void testConfigurationPrimitiveNoValue() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         Byte b = (Byte) props.get("b");
@@ -160,9 +160,9 @@
         
         reconfigure(instance2);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (Byte) props.get("b");
@@ -186,9 +186,9 @@
     }
 
     public void testConfigurationPrimitiveString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         Byte b = (Byte) props.get("b");
@@ -211,9 +211,9 @@
         
         reconfigureString(instance);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (Byte) props.get("b");
@@ -237,9 +237,9 @@
     }
     
     public void testConfigurationPrimitiveStringNoValue() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         Byte b = (Byte) props.get("b");
@@ -262,9 +262,9 @@
         
         reconfigureString(instance2);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (Byte) props.get("b");
@@ -288,9 +288,9 @@
     }
     
     public void testConfigurationPrimitiveArrays() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         byte[] b = (byte[]) props.get("bs");
@@ -329,9 +329,9 @@
         
         reconfigure(instance);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (byte[]) props.get("bs");
@@ -371,9 +371,9 @@
     }
     
     public void testConfigurationPrimitiveArraysNoValue() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         byte[] b = (byte[]) props.get("bs");
@@ -396,9 +396,9 @@
    
         reconfigure(instance2);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (byte[]) props.get("bs");
@@ -438,9 +438,9 @@
     }
 
     public void testConfigurationPrimitiveArraysString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         byte[] b = (byte[]) props.get("bs");
@@ -479,9 +479,9 @@
         
         reconfigureString(instance);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (byte[]) props.get("bs");
@@ -521,9 +521,9 @@
     }
     
     public void testConfigurationPrimitiveArraysStringNoValue() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         byte[] b = (byte[]) props.get("bs");
@@ -546,9 +546,9 @@
         
         reconfigureString(instance2);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (byte[]) props.get("bs");
@@ -588,9 +588,9 @@
     }
     
     public void testConfigurationObj() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         String s = (String) props.get("string");
@@ -603,9 +603,9 @@
         
         reconfigure(instance);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         s = (String) props.get("string");
@@ -618,9 +618,9 @@
     }
     
     public void testConfigurationObjNoValue() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         String s = (String) props.get("string");
@@ -631,9 +631,9 @@
         
         reconfigure(instance2);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         s = (String) props.get("string");
@@ -646,9 +646,9 @@
     }
 
     public void testConfigurationObjString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         String s = (String) props.get("string");
@@ -661,9 +661,9 @@
         
         reconfigureString(instance);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         s = (String) props.get("string");
@@ -676,9 +676,9 @@
     }
     
     public void testConfigurationObjStringNoValue() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         String s = (String) props.get("string");
@@ -689,9 +689,9 @@
         
         reconfigureString(instance2);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         s = (String) props.get("string");
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java
index 63c3e8c..c4a6f8d 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java
@@ -36,7 +36,7 @@
     ComponentInstance instance3;
 
     public void setUp() {
-        Factory fact = Utils.getFactoryByName(context, "CONFIG-MethodConfigurableCheckService");
+        Factory fact = Utils.getFactoryByName(getContext(), "CONFIG-MethodConfigurableCheckService");
         Properties props = new Properties();
         props.put("instance.name","under-test");
         props.put("b", "1");
@@ -112,9 +112,9 @@
     }
     
     public void testConfigurationPrimitive() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         Byte b = (Byte) props.get("b");
@@ -155,9 +155,9 @@
         
         reconfigure(instance);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (Byte) props.get("b");
@@ -199,9 +199,9 @@
     }
 
     public void testConfigurationPrimitiveString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         Byte b = (Byte) props.get("b");
@@ -242,9 +242,9 @@
 //        
         reconfigureString(instance);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (Byte) props.get("b");
@@ -286,9 +286,9 @@
     }
     
     public void testConfigurationPrimitiveArrays() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         byte[] b = (byte[]) props.get("bs");
@@ -345,9 +345,9 @@
         
         reconfigure(instance);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (byte[]) props.get("bs");
@@ -405,9 +405,9 @@
     }
 
     public void testConfigurationPrimitiveArraysString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         byte[] b = (byte[]) props.get("bs");
@@ -464,9 +464,9 @@
         
         reconfigureString(instance);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (byte[]) props.get("bs");
@@ -524,9 +524,9 @@
     }
     
     public void testConfigurationObj() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         String s = (String) props.get("string");
@@ -545,9 +545,9 @@
         
         reconfigure(instance);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         s = (String) props.get("string");
@@ -566,9 +566,9 @@
     }
 
     public void testConfigurationObjString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         String s = (String) props.get("string");
@@ -587,9 +587,9 @@
         
         reconfigureString(instance);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         s = (String) props.get("string");
@@ -608,9 +608,9 @@
     }
     
     public void testConfigurationPrimitive2() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         Byte b = (Byte) props.get("b");
@@ -651,9 +651,9 @@
         
         reconfigure(instance2);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (Byte) props.get("b");
@@ -695,9 +695,9 @@
     }
 
     public void testConfigurationPrimitive2String() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         Byte b = (Byte) props.get("b");
@@ -738,9 +738,9 @@
         
         reconfigureString(instance2);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (Byte) props.get("b");
@@ -782,9 +782,9 @@
     }
     
     public void testConfigurationPrimitiveArrays2() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         byte[] b = (byte[]) props.get("bs");
@@ -841,9 +841,9 @@
         
         reconfigure(instance2);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (byte[]) props.get("bs");
@@ -901,9 +901,9 @@
     }
 
     public void testConfigurationPrimitiveArrays2String() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         byte[] b = (byte[]) props.get("bs");
@@ -960,9 +960,9 @@
         
         reconfigureString(instance2);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (byte[]) props.get("bs");
@@ -1020,9 +1020,9 @@
     }
 
     public void testConfigurationObj2() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         String s = (String) props.get("string");
@@ -1041,9 +1041,9 @@
         
         reconfigure(instance2);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         s = (String) props.get("string");
@@ -1062,9 +1062,9 @@
     }
 
     public void testConfigurationObj2String() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         String s = (String) props.get("string");
@@ -1083,9 +1083,9 @@
         
         reconfigureString(instance2);
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         s = (String) props.get("string");
@@ -1152,9 +1152,9 @@
     }
 
     public void testConfigurationPrimitiveNoValue() {
-            ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+            ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
             assertNotNull("Test check service availability", ref);
-            CheckService check = (CheckService) context.getService(ref);
+            CheckService check = (CheckService) getContext().getService(ref);
             Properties props = check.getProps();
             
             Byte b = (Byte) props.get("b");
@@ -1195,9 +1195,9 @@
             
             reconfigure(instance3);
             
-            ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+            ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
             assertNotNull("Test check service availability", ref);
-            check = (CheckService) context.getService(ref);
+            check = (CheckService) getContext().getService(ref);
             props = check.getProps();
             
             b = (Byte) props.get("b");
@@ -1239,9 +1239,9 @@
         }
 
     public void testConfigurationPrimitiveStringNoValue() {
-            ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+            ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
             assertNotNull("Test check service availability", ref);
-            CheckService check = (CheckService) context.getService(ref);
+            CheckService check = (CheckService) getContext().getService(ref);
             Properties props = check.getProps();
             
             Byte b = (Byte) props.get("b");
@@ -1282,9 +1282,9 @@
             
             reconfigureString(instance3);
             
-            ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+            ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
             assertNotNull("Test check service availability", ref);
-            check = (CheckService) context.getService(ref);
+            check = (CheckService) getContext().getService(ref);
             props = check.getProps();
             
             b = (Byte) props.get("b");
@@ -1326,9 +1326,9 @@
         }
 
     public void testConfigurationPrimitiveArraysNoValue() {
-            ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+            ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
             assertNotNull("Test check service availability", ref);
-            CheckService check = (CheckService) context.getService(ref);
+            CheckService check = (CheckService) getContext().getService(ref);
             Properties props = check.getProps();
  
                     
@@ -1370,9 +1370,9 @@
             
             reconfigure(instance3);
             
-            ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+            ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
             assertNotNull("Test check service availability", ref);
-            check = (CheckService) context.getService(ref);
+            check = (CheckService) getContext().getService(ref);
             props = check.getProps();
             
             b = (byte[]) props.get("bs");
@@ -1430,9 +1430,9 @@
         }
 
     public void testConfigurationPrimitiveArraysStringNoValue() {
-            ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+            ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
             assertNotNull("Test check service availability", ref);
-            CheckService check = (CheckService) context.getService(ref);
+            CheckService check = (CheckService) getContext().getService(ref);
             Properties props = check.getProps();
             
             byte[] b = (byte[]) props.get("bs");
@@ -1474,9 +1474,9 @@
     
             reconfigureString(instance3);
             
-            ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+            ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
             assertNotNull("Test check service availability", ref);
-            check = (CheckService) context.getService(ref);
+            check = (CheckService) getContext().getService(ref);
             props = check.getProps();
             
             b = (byte[]) props.get("bs");
@@ -1534,9 +1534,9 @@
         }
 
     public void testConfigurationObjNoValue() {
-            ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+            ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
             assertNotNull("Test check service availability", ref);
-            CheckService check = (CheckService) context.getService(ref);
+            CheckService check = (CheckService) getContext().getService(ref);
             Properties props = check.getProps();
             
             String s = (String) props.get("string");
@@ -1554,9 +1554,9 @@
             
             reconfigure(instance3);
             
-            ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+            ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
             assertNotNull("Test check service availability", ref);
-            check = (CheckService) context.getService(ref);
+            check = (CheckService) getContext().getService(ref);
             props = check.getProps();
             
             s = (String) props.get("string");
@@ -1575,9 +1575,9 @@
         }
 
     public void testConfigurationObjStringNoValue() {
-            ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+            ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
             assertNotNull("Test check service availability", ref);
-            CheckService check = (CheckService) context.getService(ref);
+            CheckService check = (CheckService) getContext().getService(ref);
             Properties props = check.getProps();
             
             String s = (String) props.get("string");
@@ -1595,9 +1595,9 @@
             
             reconfigureString(instance3);
             
-            ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+            ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
             assertNotNull("Test check service availability", ref);
-            check = (CheckService) context.getService(ref);
+            check = (CheckService) getContext().getService(ref);
             props = check.getProps();
             
             s = (String) props.get("string");
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestPropertyModifier.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestPropertyModifier.java
index 9f8b7d7..47ddc81 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestPropertyModifier.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestPropertyModifier.java
@@ -14,7 +14,7 @@
     
     public void testPropertyModifier() {
         ComponentInstance ci = null; 
-        Factory factory =  Utils.getFactoryByName(context, "org.apache.felix.ipojo.test.scenarios.component.PropertyModifier");
+        Factory factory =  Utils.getFactoryByName(getContext(), "org.apache.felix.ipojo.test.scenarios.component.PropertyModifier");
         Properties props = new Properties();
         props.put("cls", new String[] {FooService.class.getName()});
         try {
@@ -23,18 +23,18 @@
             fail(e.getMessage());
         } 
         
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), ci.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), ci.getInstanceName());
         assertNotNull("Check ref", ref);
         
         // Check the service property
         // Not exposed here:
         assertNull("Classes -0", ref.getProperty("classes"));
         
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         assertTrue(check.check());
         
         // Property exposed now.
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), ci.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), ci.getInstanceName());
         Class[] str = (Class[]) ref.getProperty("classes");
         assertEquals("Classes size", 1, str.length);
         assertEquals("Classes[0]", FooService.class.getName(), str[0].getName());
@@ -53,7 +53,7 @@
         } 
         
         // Check the service property
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), ci.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), ci.getInstanceName());
         assertNotNull("Check ref", ref);
         str = (Class[]) ref.getProperty("classes");
         assertEquals("Classes size -3", 2, str.length);
@@ -61,7 +61,7 @@
         assertEquals("Classes[1] -3", CheckService.class.getName(), str[1].getName());
 
         
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         p = check.getProps();
         str2 = (Class[]) p.get("classes");
         assertEquals("Classes size -4", 2, str2.length);
@@ -69,7 +69,7 @@
         assertEquals("Classes[1] -4", CheckService.class.getName(), str2[1].getName());
         
         ci.dispose();
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         
     }
 
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestSuperMethodProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestSuperMethodProperties.java
index c458ec5..fc5ce65 100644
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestSuperMethodProperties.java
+++ b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestSuperMethodProperties.java
@@ -32,7 +32,7 @@
     ComponentInstance instance;
 
     public void setUp() {
-        Factory fact = Utils.getFactoryByName(context, "CONFIG-ParentMethodConfigurableCheckService");
+        Factory fact = Utils.getFactoryByName(getContext(), "CONFIG-ParentMethodConfigurableCheckService");
         Properties props = new Properties();
         props.put("instance.name","under-test");
         props.put("b", "1");
@@ -69,9 +69,9 @@
     }
     
     public void testConfigurationPrimitive() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         Byte b = (Byte) props.get("b");
@@ -112,9 +112,9 @@
         
         reconfigure();
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (Byte) props.get("b");
@@ -156,9 +156,9 @@
     }
 
     public void testConfigurationPrimitiveString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         Byte b = (Byte) props.get("b");
@@ -199,9 +199,9 @@
         
         reconfigureString();
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (Byte) props.get("b");
@@ -243,9 +243,9 @@
     }
     
     public void testConfigurationPrimitiveArrays() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         byte[] b = (byte[]) props.get("bs");
@@ -302,9 +302,9 @@
         
         reconfigure();
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (byte[]) props.get("bs");
@@ -362,9 +362,9 @@
     }
 
     public void testConfigurationPrimitiveArraysString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         byte[] b = (byte[]) props.get("bs");
@@ -421,9 +421,9 @@
         
         reconfigureString();
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         b = (byte[]) props.get("bs");
@@ -481,9 +481,9 @@
     }
     
     public void testConfigurationObj() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         String s = (String) props.get("string");
@@ -502,9 +502,9 @@
         
         reconfigure();
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         s = (String) props.get("string");
@@ -523,9 +523,9 @@
     }
 
     public void testConfigurationObjString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) context.getService(ref);
+        CheckService check = (CheckService) getContext().getService(ref);
         Properties props = check.getProps();
         
         String s = (String) props.get("string");
@@ -544,9 +544,9 @@
         
         reconfigureString();
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Test check service availability", ref);
-        check = (CheckService) context.getService(ref);
+        check = (CheckService) getContext().getService(ref);
         props = check.getProps();
         
         s = (String) props.get("string");
diff --git a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
index e7040e7..b82cf3c 100644
--- a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ b/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
@@ -50,7 +50,7 @@
         if (bc ==null) {
             throw new RuntimeException("Injected bundle context null");
         }
-            m_context = bc;
+        m_context = bc;
     }
 
 	public boolean foo() {
diff --git a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/HandlerTest.java b/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/HandlerTest.java
index 09066ed..1e89772 100644
--- a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/HandlerTest.java
+++ b/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/HandlerTest.java
@@ -42,7 +42,7 @@
 		p.put("b", "b");
 		p.put("c", "c");
 		props.put("csh.map", p);
-		instance = Utils.getComponentInstance(context, "HANDLER-HandlerTester", props);
+		instance = Utils.getComponentInstance(getContext(), "HANDLER-HandlerTester", props);
 	}
 	
 	public void tearDown() {
@@ -57,13 +57,13 @@
 		ServiceReference[] refs = null;
         String filter = "("+"instance.name"+"="+name+")";
         try {
-            refs = context.getServiceReferences(CheckService.class.getName(), filter);
+            refs = getContext().getServiceReferences(CheckService.class.getName(), filter);
         } catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
         if(refs != null) { sr = refs[0]; }
         
 		assertNotNull("Check the check service availability", sr);
 		
-		CheckService cs = (CheckService) context.getService(sr);
+		CheckService cs = (CheckService) getContext().getService(sr);
 		Properties p = cs.getProps();
 		assertEquals("Assert 'simple' equality", p.get("Simple"), "simple");
 		assertEquals("Assert 'a' equality", p.get("Map1"), "a");
@@ -71,7 +71,7 @@
 		assertEquals("Assert 'c' equality", p.get("Map3"), "c");
 		
 		cs = null;
-		context.ungetService(sr);
+		getContext().ungetService(sr);
 	}
 	
 	public void testConfiguration2() {
@@ -81,12 +81,12 @@
         ServiceReference[] refs = null;
         String filter = "("+"instance.name"+"="+name+")";
         try {
-            refs = context.getServiceReferences(CheckService.class.getName(), filter);
+            refs = getContext().getServiceReferences(CheckService.class.getName(), filter);
         } catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
         if(refs != null) { sr = refs[0]; }
 		assertNotNull("Check the check service availability", sr);
 		
-		CheckService cs = (CheckService) context.getService(sr);
+		CheckService cs = (CheckService) getContext().getService(sr);
 		Properties p = cs.getProps();
 		assertEquals("Assert 'simple' equality", p.get("Simple"), "Simple");
 		assertEquals("Assert 'a' equality", p.get("Map1"), "a");
@@ -94,7 +94,7 @@
 		assertEquals("Assert 'c' equality", p.get("Map3"), "c");
 		
 		cs = null;
-		context.ungetService(sr);
+		getContext().ungetService(sr);
 	}
 	
 
@@ -105,18 +105,18 @@
         ServiceReference[] refs = null;
         String filter = "("+"instance.name"+"="+name+")";
         try {
-            refs = context.getServiceReferences(CheckService.class.getName(), filter);
+            refs = getContext().getServiceReferences(CheckService.class.getName(), filter);
         } catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
         if(refs != null) { sr = refs[0]; }
         assertNotNull("Check the check service availability", sr);
         
-        CheckService cs = (CheckService) context.getService(sr);
+        CheckService cs = (CheckService) getContext().getService(sr);
         Properties p = cs.getProps();
         assertEquals("Assert 'simple' equality", p.get("Simple"), "Simple");
         assertEquals("Size of p", 3, p.size()); // instance name, simple and changes.
         
         cs = null;
-        context.ungetService(sr);
+        getContext().ungetService(sr);
     }
 	
 	public void testLifecycle() {
@@ -126,17 +126,17 @@
         ServiceReference[] refs = null;
         String filter = "("+"instance.name"+"="+name+")";
         try {
-            refs = context.getServiceReferences(CheckService.class.getName(), filter);
+            refs = getContext().getServiceReferences(CheckService.class.getName(), filter);
         } catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
         if(refs != null) { sr = refs[0]; }
 		assertNotNull("Check the check service availability", sr);
 		
-		ServiceReference sr_arch = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "HandlerTest-1");
-		Architecture arch = (Architecture) context.getService(sr_arch);
+		ServiceReference sr_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "HandlerTest-1");
+		Architecture arch = (Architecture) getContext().getService(sr_arch);
 		
 		assertEquals("Check instance validity - 0", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
 		
-		CheckService cs = (CheckService) context.getService(sr);
+		CheckService cs = (CheckService) getContext().getService(sr);
 		Properties p = cs.getProps();
 		Integer changes = (Integer) p.get("changes");
 		assertNotNull("Check changes no null", changes);
@@ -160,8 +160,8 @@
 		
 		cs = null;
 		arch = null;
-		context.ungetService(sr_arch);
-		context.ungetService(sr);
+		getContext().ungetService(sr_arch);
+		getContext().ungetService(sr);
 	}
 	
 	public void testAvailability() {
@@ -170,23 +170,23 @@
         ServiceReference[] refs = null;
         String filter = "("+"instance.name"+"="+name+")";
         try {
-            refs = context.getServiceReferences(CheckService.class.getName(), filter);
+            refs = getContext().getServiceReferences(CheckService.class.getName(), filter);
         } catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
         if(refs != null) { sr = refs[0]; }
         assertNotNull("Check the check service availability", sr);
         
-        ServiceReference sr_arch = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "HandlerTest-1");
-        Architecture arch = (Architecture) context.getService(sr_arch);
+        ServiceReference sr_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "HandlerTest-1");
+        Architecture arch = (Architecture) getContext().getService(sr_arch);
         assertEquals("Check validity", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
         
         // Kill the handler factory
-        HandlerManagerFactory f = (HandlerManagerFactory) Utils.getHandlerFactoryByName(context, "check");
+        HandlerManagerFactory f = (HandlerManagerFactory) Utils.getHandlerFactoryByName(getContext(), "check");
         f.stop();
         
-        sr = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "HandlerTest-1");
+        sr = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "HandlerTest-1");
         assertNull("Check the check service unavailability", sr);
         
-        sr_arch = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "HandlerTest-1");
+        sr_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "HandlerTest-1");
         assertNull("Check the architecture unavailability", sr_arch);
         
         // The instance is disposed, restart the handler
@@ -200,13 +200,13 @@
         p.put("b", "b");
         p.put("c", "c");
         props.put("csh.map", p);
-        instance = Utils.getComponentInstance(context, "HANDLER-HandlerTester", props);
+        instance = Utils.getComponentInstance(getContext(), "HANDLER-HandlerTester", props);
         
-        sr = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "HandlerTest-1");
+        sr = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "HandlerTest-1");
         assertNotNull("Check the check service availability - 2", sr);
         
-        sr_arch = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "HandlerTest-1");
-        arch = (Architecture) context.getService(sr_arch);
+        sr_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "HandlerTest-1");
+        arch = (Architecture) getContext().getService(sr_arch);
         assertEquals("Check validity - 2", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
 	}
 
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
index d1217a1..46593da 100644
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
@@ -50,7 +50,7 @@
         if (bc ==null) {
             throw new RuntimeException("Injected bundle context null");
         }
-            m_context = bc;
+        m_context = bc;
     }
 
 	public boolean foo() {
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ComponentDesc.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ComponentDesc.java
index 41dbcc2..ce53f39 100644
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ComponentDesc.java
+++ b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ComponentDesc.java
@@ -54,21 +54,21 @@
 //	Factory multiple_optional;
 	
 	public void setUp() {
-		sr_fooProvider1 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "Factories-FooProviderType-1");
-		sr_fooProvider2 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "Factories-FooProviderType-2");
-		sr_fooProviderDyn2 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "Factories-FooProviderType-Dyn2");
-		sr_fooProvider3 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "Factories-FooProviderType-3");
-		sr_foobarProvider = Utils.getServiceReferenceByName(context, Factory.class.getName(), "Factories-FooBarProviderType-1");
+		sr_fooProvider1 = Utils.getServiceReferenceByName(getContext(), Factory.class.getName(), "Factories-FooProviderType-1");
+		sr_fooProvider2 = Utils.getServiceReferenceByName(getContext(), Factory.class.getName(), "Factories-FooProviderType-2");
+		sr_fooProviderDyn2 = Utils.getServiceReferenceByName(getContext(), Factory.class.getName(), "Factories-FooProviderType-Dyn2");
+		sr_fooProvider3 = Utils.getServiceReferenceByName(getContext(), Factory.class.getName(), "Factories-FooProviderType-3");
+		sr_foobarProvider = Utils.getServiceReferenceByName(getContext(), Factory.class.getName(), "Factories-FooBarProviderType-1");
 //		sr_simple = Utils.getServiceReferenceByName(context, Factory.class.getName(), "SimpleCheckServiceProvider");
 //		sr_optional = Utils.getServiceReferenceByName(context, Factory.class.getName(), "SimpleOptionalCheckServiceProvider");
 //		sr_multiple = Utils.getServiceReferenceByName(context, Factory.class.getName(), "SimpleMultipleCheckServiceProvider");
 //		sr_multiple_optional = Utils.getServiceReferenceByName(context, Factory.class.getName(), "SimpleOptionalMultipleCheckServiceProvider");
 		
-		fooProvider1 = (Factory) context.getService(sr_fooProvider1);
-		fooProvider2 = (Factory) context.getService(sr_fooProvider2);
-		fooProviderDyn2 = (Factory) context.getService(sr_fooProviderDyn2);
-		fooProvider3 = (Factory) context.getService(sr_fooProvider3);
-		foobarProvider = (Factory) context.getService(sr_foobarProvider);
+		fooProvider1 = (Factory) getContext().getService(sr_fooProvider1);
+		fooProvider2 = (Factory) getContext().getService(sr_fooProvider2);
+		fooProviderDyn2 = (Factory) getContext().getService(sr_fooProviderDyn2);
+		fooProvider3 = (Factory) getContext().getService(sr_fooProvider3);
+		foobarProvider = (Factory) getContext().getService(sr_foobarProvider);
 //		simple = (Factory) context.getService(sr_simple);
 //		optional = (Factory) context.getService(sr_optional);
 //		multiple = (Factory) context.getService(sr_multiple);
@@ -87,11 +87,11 @@
 //		optional = null;
 //		multiple_optional = null;
 		
-		context.ungetService(sr_fooProvider1);
-		context.ungetService(sr_fooProvider2);
-		context.ungetService(sr_fooProviderDyn2);
-		context.ungetService(sr_fooProvider3);
-		context.ungetService(sr_foobarProvider);
+		getContext().ungetService(sr_fooProvider1);
+		getContext().ungetService(sr_fooProvider2);
+		getContext().ungetService(sr_fooProviderDyn2);
+		getContext().ungetService(sr_fooProvider3);
+		getContext().ungetService(sr_foobarProvider);
 //		context.ungetService(sr_simple);
 //		context.ungetService(sr_optional);
 //		context.ungetService(sr_multiple);
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ConfigAdminTest.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ConfigAdminTest.java
index 3b6d440..07ee24c 100644
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ConfigAdminTest.java
+++ b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ConfigAdminTest.java
@@ -36,9 +36,9 @@
 	private ManagedServiceFactory getFactoryByName(String pid) {
 		ServiceReference[] refs;
 		try {
-			refs = context.getServiceReferences(ManagedServiceFactory.class.getName(), "(service.pid="+pid+")");
+			refs = getContext().getServiceReferences(ManagedServiceFactory.class.getName(), "(service.pid="+pid+")");
 			if(refs == null) { return null; }
-			return ((org.osgi.service.cm.ManagedServiceFactory) context.getService(refs[0]));
+			return ((org.osgi.service.cm.ManagedServiceFactory) getContext().getService(refs[0]));
 		} catch (InvalidSyntaxException e) {
 			System.err.println("Cannot get the factory " + pid + " : " + e.getMessage());
 			return null;
@@ -60,10 +60,10 @@
 		
 		try {
 			f.updated("ok2", p);
-			ServiceReference ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), "ok2");
+			ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "ok2");
 			assertNotNull("Check instance creation", ref);
 			f.deleted("ok2");
-			ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), "ok2");
+			ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "ok2");
 			assertNull("Check instance deletion", ref);
 		} catch (ConfigurationException e) {
 			fail("An acceptable configuration is rejected : " + e.getMessage());
@@ -85,10 +85,10 @@
         
         try {
             f.updated("ok2", p);
-            ServiceReference ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), "ok2");
+            ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "ok2");
             assertNotNull("Check instance creation", ref);
             f.deleted("ok2");
-            ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), "ok2");
+            ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "ok2");
             assertNull("Check instance deletion", ref);
         } catch (ConfigurationException e) {
             fail("An acceptable configuration is rejected : " + e.getMessage());
@@ -110,15 +110,15 @@
 		
 		try {
 			f.updated("okkkk", p);
-			ServiceReference ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), "okkkk");
+			ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "okkkk");
 			assertNotNull("Check instance creation", ref);
 			p.put("int", new Integer("4"));
 			f.updated("okkkk", p);
-			ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), "okkkk");
+			ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "okkkk");
 			Integer test = (Integer) ref.getProperty("int");
 			assertEquals("Check instance modification", 4, test.intValue());
 			f.deleted("okkkk");
-			ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), "okkkk");
+			ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "okkkk");
 			assertNull("Check instance deletion", ref);
 		} catch (ConfigurationException e) {
 			fail("An acceptable configuration is rejected : " + e.getMessage());
@@ -141,15 +141,15 @@
     	
     	try {
     		f.updated("okkkk", p);
-    		ServiceReference ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), "okkkk");
+    		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "okkkk");
     		assertNotNull("Check instance creation", ref);
     		p.put("int", new Integer("4"));
     		f.updated("okkkk", p);
-    		ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), "okkkk");
+    		ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "okkkk");
     		Integer test = (Integer) ref.getProperty("int");
     		assertEquals("Check instance modification", 4, test.intValue());
     		f.deleted("okkkk");
-    		ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), "okkkk");
+    		ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "okkkk");
     		assertNull("Check instance deletion", ref);
     	} catch (ConfigurationException e) {
     		fail("An acceptable configuration is rejected : " + e.getMessage());
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryProps.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryProps.java
index d2604d0..f18359f 100644
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryProps.java
+++ b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryProps.java
@@ -36,7 +36,7 @@
 //	}
 	
 	public void testSimpleExposition() {
-		ServiceReference ref1 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "Factories-FooProviderType-1");
+		ServiceReference ref1 = Utils.getServiceReferenceByName(getContext(), Factory.class.getName(), "Factories-FooProviderType-1");
 		assertNotNull("The factory is available", ref1);
 		String[] spec = (String[]) ref1.getProperty("component.providedServiceSpecifications");
 		assertEquals("Check array length", spec.length, 1);
@@ -44,7 +44,7 @@
 	}
 	
 	public void testDoubleExposition() {
-		ServiceReference ref1 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "Factories-FooBarProviderType-1");
+		ServiceReference ref1 = Utils.getServiceReferenceByName(getContext(), Factory.class.getName(), "Factories-FooBarProviderType-1");
 		assertNotNull("The factory is available", ref1);
 		String[] spec = (String[]) ref1.getProperty("component.providedServiceSpecifications");
 		assertEquals("Check array length", spec.length, 2);
@@ -53,7 +53,7 @@
 	}
 	
 	public void testProps() {
-		ServiceReference ref1 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "Factories-FooProviderType-Dyn2");
+		ServiceReference ref1 = Utils.getServiceReferenceByName(getContext(), Factory.class.getName(), "Factories-FooProviderType-Dyn2");
 		assertNotNull("The factory is available", ref1);
 		PropertyDescription[] pd = (PropertyDescription[]) ref1.getProperty("component.properties");
 		assertEquals("Check property list size", pd.length, 5);
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ObedienceTest.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ObedienceTest.java
index e2f4af2..c650d5c 100644
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ObedienceTest.java
+++ b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ObedienceTest.java
@@ -36,8 +36,8 @@
 public class ObedienceTest extends OSGiTestCase {
 
 	public void testObedience() {
-		assertNull("Check no foo service", context.getServiceReference(FooService.class.getName()));
-		ComponentFactory factory = (ComponentFactory) Utils.getFactoryByName(context, "Factories-FooProviderType-1");
+		assertNull("Check no foo service", getContext().getServiceReference(FooService.class.getName()));
+		ComponentFactory factory = (ComponentFactory) Utils.getFactoryByName(getContext(), "Factories-FooProviderType-1");
 		assertNotNull("Check factory existing", factory);
 		
 		Properties props1 = new Properties();
@@ -56,59 +56,59 @@
 		assertTrue("Check foo1 validity", ci1.getState() == ComponentInstance.VALID);
 		assertTrue("Check foo2 validity", ci2.getState() == ComponentInstance.VALID);
 		
-		assertNotNull("Check foo service", context.getServiceReference(FooService.class.getName()));
-		assertEquals("Check the number of Foo", Utils.getServiceReferences(context, FooService.class.getName(), null).length, 2);
+		assertNotNull("Check foo service", getContext().getServiceReference(FooService.class.getName()));
+		assertEquals("Check the number of Foo", Utils.getServiceReferences(getContext(), FooService.class.getName(), null).length, 2);
 		
 		factory.stop();
 		
 		assertTrue("Check foo1 invalidity ("+ci1.getState()+")", ci1.getState() == ComponentInstance.DISPOSED);
 		assertTrue("Check foo2 invalidity ("+ci1.getState()+")", ci2.getState() == ComponentInstance.DISPOSED);
 		
-		assertNull("Check no foo service", context.getServiceReference(FooService.class.getName()));
+		assertNull("Check no foo service", getContext().getServiceReference(FooService.class.getName()));
 		
 		factory.start();
-		assertNull("Check no foo service", context.getServiceReference(FooService.class.getName()));
+		assertNull("Check no foo service", getContext().getServiceReference(FooService.class.getName()));
 	}
 	
 	public void testDisposeAfterFactoryInvalidation() {
-	    ComponentFactory cf = (ComponentFactory) Utils.getFactoryByName(context, "org.apache.felix.ipojo.test.scenarios.component.SimpleType");
+	    ComponentFactory cf = (ComponentFactory) Utils.getFactoryByName(getContext(), "org.apache.felix.ipojo.test.scenarios.component.SimpleType");
 	    assertNotNull("Check factory availability -1", cf);
 	    assertEquals("Check factory state -1", Factory.VALID, cf.getState());
 	    
-	    ServiceReference ref_arch = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "SimpleInstance");
+	    ServiceReference ref_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "SimpleInstance");
 	    assertNotNull("Check Architecture availability -1", ref_arch);
 	    
-        HandlerManagerFactory hf = (HandlerManagerFactory) Utils.getHandlerFactoryByName(context, "controller");
+        HandlerManagerFactory hf = (HandlerManagerFactory) Utils.getHandlerFactoryByName(getContext(), "controller");
         assertNotNull("Check handler availability -1", hf);
         assertEquals("Check handler state -1", Factory.VALID, hf.getState());
         
         // Stop the handler
         hf.stop();
-        HandlerManagerFactory hf2 = (HandlerManagerFactory) Utils.getHandlerFactoryByName(context, "controller");
+        HandlerManagerFactory hf2 = (HandlerManagerFactory) Utils.getHandlerFactoryByName(getContext(), "controller");
         assertNull("Check handler availability -2", hf2);
         
         // Check the factory invalidity
-        cf = (ComponentFactory) Utils.getFactoryByName(context, "org.apache.felix.ipojo.test.scenarios.component.SimpleType");
+        cf = (ComponentFactory) Utils.getFactoryByName(getContext(), "org.apache.felix.ipojo.test.scenarios.component.SimpleType");
         assertNotNull("Check factory availability -2", cf);
         assertEquals("Check factory state -2", Factory.INVALID, cf.getState());
         
         // Check the instance disparition
-        ref_arch = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "SimpleInstance");
+        ref_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "SimpleInstance");
         assertNull("Check Architecture availability -1", ref_arch);
         
         // Restart the handler
         hf.start();
-        hf2 = (HandlerManagerFactory) Utils.getHandlerFactoryByName(context, "controller");
+        hf2 = (HandlerManagerFactory) Utils.getHandlerFactoryByName(getContext(), "controller");
         assertNotNull("Check handler availability -3", hf2);
         
         // Check the factory state
-        cf = (ComponentFactory) Utils.getFactoryByName(context, "org.apache.felix.ipojo.test.scenarios.component.SimpleType");
+        cf = (ComponentFactory) Utils.getFactoryByName(getContext(), "org.apache.felix.ipojo.test.scenarios.component.SimpleType");
         assertNotNull("Check factory availability -3", cf);
         assertEquals("Check factory state -3", Factory.VALID, cf.getState());
         
         
         // Check the instance re-creation
-        ref_arch = Utils.getServiceReferenceByName(context, Architecture.class.getName(), "SimpleInstance");
+        ref_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "SimpleInstance");
         assertNotNull("Check Architecture availability -3", ref_arch);
         
 	}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java
index 2822832..e6b4d92 100644
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java
+++ b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java
@@ -34,7 +34,7 @@
 	 * Configuration without the name property.
 	 */
 	public void testWithoutName() {
-		Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2");
+		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2");
 		
 		Properties  p = new Properties();
 		p.put("int", new Integer(3));
@@ -55,7 +55,7 @@
      * Configuration without the name property.
      */
     public void testWithoutNameOpt() {
-        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2opt");
+        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2opt");
         
         Properties  p = new Properties();
         p.put("int", new Integer(3));
@@ -76,7 +76,7 @@
 	 * Empty configuration.
 	 */
 	public void testEmptyConfiguration() {
-		Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2");
+		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2");
 		Properties  p = new Properties();
 		
 		ComponentInstance ci = null;
@@ -90,7 +90,7 @@
      * Empty configuration.
      */
     public void testEmptyConfigurationOpt() {
-        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2opt");
+        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2opt");
         Properties  p = new Properties();
         
         ComponentInstance ci = null;
@@ -104,7 +104,7 @@
 	 * Empty configuration (just the name).
 	 */
 	public void testEmptyConfiguration2() {
-		Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2");
+		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2");
 		Properties  p = new Properties();
 		p.put("instance.name","ko");
 		ComponentInstance ci = null;
@@ -120,7 +120,7 @@
      * Empty configuration (just the name).
      */
     public void testEmptyConfiguration2opt() {
-        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2opt");
+        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2opt");
         Properties  p = new Properties();
         p.put("instance.name","ko");
         ComponentInstance ci = null;
@@ -137,7 +137,7 @@
 	 * Null configuration (accept).
 	 */
 	public void testNull() {
-		Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2");
+		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2");
 		
 		ComponentInstance ci = null;
 		try {
@@ -150,7 +150,7 @@
      * Null configuration (accept).
      */
     public void testNullOpt() {
-        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2opt");
+        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2opt");
         
         ComponentInstance ci = null;
         try {
@@ -163,7 +163,7 @@
 	 * Null configuration (fail).
 	 */
 	public void testNull2() {
-		Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2");
+		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2");
 		
 		ComponentInstance ci = null;
 		try {
@@ -178,7 +178,7 @@
      * Null configuration (success).
      */
     public void testNull2Opt() {
-        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2opt");
+        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2opt");
         
         ComponentInstance ci = null;
         try {
@@ -195,7 +195,7 @@
 	 * Check static properties.
 	 */
 	public void testStaticOK() {
-		Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2");
+		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2");
 		
 		Properties  p = new Properties();
 		p.put("instance.name","ok");
@@ -218,7 +218,7 @@
      * Check static properties.
      */
     public void testStaticOKopt() {
-        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2opt");
+        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2opt");
         
         Properties  p = new Properties();
         p.put("instance.name","ok");
@@ -241,7 +241,7 @@
 	 * Check dynamic properties.
 	 */
 	public void testDynamicOK() {
-		Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn");
+		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn");
 		
 		Properties  p = new Properties();
 		p.put("instance.name","ok");
@@ -266,7 +266,7 @@
      * Check dynamic properties.
      */
     public void testDynamicOKopt() {
-        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dynopt");
+        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dynopt");
         
         Properties  p = new Properties();
         p.put("instance.name","ok");
@@ -305,7 +305,7 @@
 	 * Check inconsistent types.
 	 */
 	public void testDynamicBadType() {
-		Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn");
+		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn");
 		
 		Properties  p = new Properties();
 		p.put("instance.name","ok");
@@ -328,7 +328,7 @@
      * Check inconsistent types.
      */
     public void testDynamicBadTypeOpt() {
-        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dynopt");
+        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dynopt");
         
         Properties  p = new Properties();
         p.put("instance.name","ok");
@@ -365,7 +365,7 @@
 	 * Check good configuration (with overriding).
 	 */
 	public void testDynamicComplete() {
-		Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2");
+		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2");
 		
 		Properties  p = new Properties();
 		p.put("instance.name","ok");
@@ -388,7 +388,7 @@
      * Check good configuration (with overriding).
      */
     public void testDynamicCompleteOpt() {
-        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2opt");
+        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2opt");
         
         Properties  p = new Properties();
         p.put("instance.name","ok");
@@ -426,7 +426,7 @@
 	 * Check good configuration.
 	 */
 	public void testDynamicJustEnough() {
-		Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2");
+		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2");
 		
 		Properties  p = new Properties();
 		p.put("instance.name","ok");
@@ -447,7 +447,7 @@
      * Check good configuration.
      */
     public void testDynamicJustEnoughOpt() {
-        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2opt");
+        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2opt");
         
         Properties  p = new Properties();
         p.put("instance.name","ok");
@@ -481,7 +481,7 @@
 	 * Check good configuration.
 	 */
 	public void testDynamicMix() {
-		Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2");
+		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2");
 		
 		Properties  p = new Properties();
 		p.put("instance.name","ok");
@@ -503,7 +503,7 @@
      * Check good configuration.
      */
     public void testDynamicMixOpt() {
-        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2opt");
+        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2opt");
         
         Properties  p = new Properties();
         p.put("instance.name","ok");
@@ -539,7 +539,7 @@
 	 * Check uncomplete configuration.
 	 */
 	public void testDynamicUncomplete() {
-		Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2");
+		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2");
 		
 		Properties  p = new Properties();
 		p.put("instance.name","ok");
@@ -560,7 +560,7 @@
      * Check uncomplete configuration.
      */
     public void testDynamicUncompleteOpt() {
-        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2opt");
+        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2opt");
         
         Properties  p = new Properties();
         p.put("instance.name","ok");
@@ -581,7 +581,7 @@
 	 * Check good configuration (more properties).
 	 */
 	public void testDynamicMore() {
-		Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2");
+		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2");
 		
 		Properties  p = new Properties();
 		p.put("instance.name","ok");
@@ -605,7 +605,7 @@
      * Check good configuration (more properties).
      */
     public void testDynamicMoreOpt() {
-        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2opt");
+        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2opt");
         
         Properties  p = new Properties();
         p.put("instance.name","ok");
@@ -629,7 +629,7 @@
 	 * Check properties affecting services and component.
 	 */
 	public void testDoubleProps() {
-		Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2");
+		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2");
 		
 		Properties  p = new Properties();
 		p.put("instance.name","ok");
@@ -654,7 +654,7 @@
      * Check properties affecting services and component.
      */
     public void testDoublePropsOpt() {
-        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-Dyn2opt");
+        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2opt");
         
         Properties  p = new Properties();
         p.put("instance.name","ok");
@@ -679,7 +679,7 @@
      * Check instance name unicity.
      */
     public void testUnicity1() {
-        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2");
+        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2");
         
         ComponentInstance ci1,ci2, ci3 = null;
         try {
@@ -699,7 +699,7 @@
      * Check instance name unicity.
      */
     public void testUnicity2() {
-        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2");
+        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2");
         
         ComponentInstance ci1,ci2, ci3 = null;
         try {
@@ -725,7 +725,7 @@
      * Check instance name unicity.
      */
     public void testUnicity3() {
-        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2");
+        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2");
         
         ComponentInstance ci1 = null,ci2 = null;
         try {
@@ -749,8 +749,8 @@
      * Check instance name unicity.
      */
     public void testUnicity4() {
-        Factory f = Utils.getFactoryByName(context, "Factories-FooProviderType-2");
-        Factory f2 = Utils.getFactoryByName(context, "Factories-FooProviderType-1");
+        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2");
+        Factory f2 = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-1");
         
         ComponentInstance ci1 = null,ci2 = null;
         try {
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
index d4ad3bf..35377c3 100644
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
@@ -50,7 +50,7 @@
         if (bc ==null) {
             throw new RuntimeException("Injected bundle context null");
         }
-            m_context = bc;
+        m_context = bc;
     }
 
 	public boolean foo() {
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/CallbackTestCase.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/CallbackTestCase.java
index be1d266..d26e61a 100644
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/CallbackTestCase.java
+++ b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/CallbackTestCase.java
@@ -36,12 +36,12 @@
 	public void setUp() {
 		Properties p2 = new Properties();
 		p2.put("instance.name","fooProvider");
-		fooProvider = Utils.getComponentInstance(context, "LFCB-FooProviderType-1", p2);
+		fooProvider = Utils.getComponentInstance(getContext(), "LFCB-FooProviderType-1", p2);
 		fooProvider.stop();
 		
 		Properties p1 = new Properties();
 		p1.put("instance.name","callback");
-		instance = Utils.getComponentInstance(context, "LFCB-CallbackCheckService", p1);
+		instance = Utils.getComponentInstance(getContext(), "LFCB-CallbackCheckService", p1);
 		
 	}
 	
@@ -54,9 +54,9 @@
 	
 	public void testCallback() {
 		// Check instance is invalid
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
 		assertEquals("Check pojo count - 1", id_dep.getCreatedObjects().length, 0);
 		
@@ -64,13 +64,13 @@
 		fooProvider.start();
 		
 		// Check instance validity
-		id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id_dep.getState() == ComponentInstance.VALID);
 		
 		// Check service providing
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check int property
@@ -81,7 +81,7 @@
 		
 		fooProvider.stop();
 		
-		id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
 		
 		assertEquals("Check pojo count - 3", id_dep.getCreatedObjects().length, 1);
@@ -89,13 +89,13 @@
 		fooProvider.start();
 		
 		// Check instance validity
-		id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id_dep.getState() == ComponentInstance.VALID);
 		
 		// Check service providing
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check int property
@@ -105,8 +105,8 @@
 		assertEquals("Check pojo count - 4 ", id_dep.getCreatedObjects().length, 1);
 		
 		// Clean up
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 		cs = null;
 		id_dep = null;
 	}
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSeveralFactoryTest.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSeveralFactoryTest.java
index 93d40ac..1fe3f1e 100644
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSeveralFactoryTest.java
+++ b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSeveralFactoryTest.java
@@ -37,12 +37,12 @@
     public void setUp() {
         Properties p2 = new Properties();
         p2.put("instance.name","fooProvider");
-        fooProvider = Utils.getComponentInstance(context, "LFCB-FooProviderType-1", p2);
+        fooProvider = Utils.getComponentInstance(getContext(), "LFCB-FooProviderType-1", p2);
         fooProvider.stop();
         
         Properties p1 = new Properties();
         p1.put("instance.name","callback");
-        instance = Utils.getComponentInstance(context, "LFCB-ImmediateCallbackCheckServiceSeveral", p1);
+        instance = Utils.getComponentInstance(getContext(), "LFCB-ImmediateCallbackCheckServiceSeveral", p1);
         
     }
     
@@ -56,9 +56,9 @@
     
     public void testCallback() {
         // Check instance is invalid
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
         assertEquals("Check pojo count - 1", id_dep.getCreatedObjects().length, 0);
         
@@ -66,13 +66,13 @@
         fooProvider.start();
         
         // Check instance validity
-        id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id_dep.getState() == ComponentInstance.VALID);
         
         // Check service providing
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         assertTrue("check CheckService invocation", cs.check());
         
         assertEquals("Check pojo count - 2", id_dep.getCreatedObjects().length, 1);
@@ -84,7 +84,7 @@
         
         fooProvider.stop();
         
-        id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
         
         assertEquals("Check pojo count - 3", id_dep.getCreatedObjects().length, 1);
@@ -92,13 +92,13 @@
         fooProvider.start();
         
         // Check instance validity
-        id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id_dep.getState() == ComponentInstance.VALID);
         
         // Check service providing
-        cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         assertTrue("check CheckService invocation", cs.check());
         
         // Check int property
@@ -110,8 +110,8 @@
         assertEquals("Check pojo count - 4 ", id_dep.getCreatedObjects().length, 1);
         
         // Clean up
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
         cs = null;
         id_dep = null;
     }
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSingletonFactoryTest.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSingletonFactoryTest.java
index 5119622..ec55c3e 100644
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSingletonFactoryTest.java
+++ b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSingletonFactoryTest.java
@@ -37,12 +37,12 @@
     public void setUp() {
         Properties p2 = new Properties();
         p2.put("instance.name","fooProvider");
-        fooProvider = Utils.getComponentInstance(context, "LFCB-FooProviderType-1", p2);
+        fooProvider = Utils.getComponentInstance(getContext(), "LFCB-FooProviderType-1", p2);
         fooProvider.stop();
         
         Properties p1 = new Properties();
         p1.put("instance.name","callback");
-        instance = Utils.getComponentInstance(context, "LFCB-ImmediateCallbackCheckServiceSingleton", p1);
+        instance = Utils.getComponentInstance(getContext(), "LFCB-ImmediateCallbackCheckServiceSingleton", p1);
         
     }
     
@@ -57,9 +57,9 @@
     
     public void testCallback() {
         // Check instance is invalid
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
         assertEquals("Check pojo count - 1", id_dep.getCreatedObjects().length, 0);
         
@@ -67,13 +67,13 @@
         fooProvider.start();
         
         // Check instance validity
-        id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id_dep.getState() == ComponentInstance.VALID);
         
         // Check service providing
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         assertTrue("check CheckService invocation", cs.check());
         
         assertEquals("Check pojo count - 2", id_dep.getCreatedObjects().length, 1);
@@ -83,7 +83,7 @@
         
         fooProvider.stop();
         
-        id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
         
         assertEquals("Check pojo count - 3", id_dep.getCreatedObjects().length, 1);
@@ -91,13 +91,13 @@
         fooProvider.start();
         
         // Check instance validity
-        id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id_dep.getState() == ComponentInstance.VALID);
         
         // Check service providing
-        cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         assertTrue("check CheckService invocation", cs.check());
         
         // Check int property
@@ -107,8 +107,8 @@
         assertEquals("Check pojo count - 4 ", id_dep.getCreatedObjects().length, 1);
         
         // Clean up
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
         cs = null;
         id_dep = null;
     }
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackTest.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackTest.java
index ea67fc1..f700aed 100644
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackTest.java
+++ b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackTest.java
@@ -36,12 +36,12 @@
     public void setUp() {
         Properties p2 = new Properties();
         p2.put("instance.name","fooProvider");
-        fooProvider = Utils.getComponentInstance(context, "LFCB-FooProviderType-1", p2);
+        fooProvider = Utils.getComponentInstance(getContext(), "LFCB-FooProviderType-1", p2);
         fooProvider.stop();
         
         Properties p1 = new Properties();
         p1.put("instance.name","callback");
-        instance = Utils.getComponentInstance(context, "LFCB-ImmediateCallbackCheckService", p1);
+        instance = Utils.getComponentInstance(getContext(), "LFCB-ImmediateCallbackCheckService", p1);
         
     }
     
@@ -54,9 +54,9 @@
     
     public void testCallback() {
         // Check instance is invalid
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
         assertEquals("Check pojo count - 1", id_dep.getCreatedObjects().length, 0);
         
@@ -64,13 +64,13 @@
         fooProvider.start();
         
         // Check instance validity
-        id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id_dep.getState() == ComponentInstance.VALID);
         
         // Check service providing
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         assertTrue("check CheckService invocation", cs.check());
         
         assertEquals("Check pojo count - 2", id_dep.getCreatedObjects().length, 1);
@@ -80,7 +80,7 @@
         
         fooProvider.stop();
         
-        id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
         
         assertEquals("Check pojo count - 3", id_dep.getCreatedObjects().length, 1);
@@ -88,13 +88,13 @@
         fooProvider.start();
         
         // Check instance validity
-        id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id_dep.getState() == ComponentInstance.VALID);
         
         // Check service providing
-        cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         assertTrue("check CheckService invocation", cs.check());
         
         // Check int property
@@ -104,8 +104,8 @@
         assertEquals("Check pojo count - 4 ", id_dep.getCreatedObjects().length, 1);
         
         // Clean up
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
         cs = null;
         id_dep = null;
     }
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateLifeCycleControllerTest.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateLifeCycleControllerTest.java
index bd6d336..4b41f25 100644
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateLifeCycleControllerTest.java
+++ b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateLifeCycleControllerTest.java
@@ -33,21 +33,21 @@
     private Factory factory;
     
     public void setUp() {
-        factory = Utils.getFactoryByName(context, "LFC-Test-Immediate");
+        factory = Utils.getFactoryByName(getContext(), "LFC-Test-Immediate");
     }
     
     public void testOne() {
         Properties props = new Properties();
         props.put("conf", "foo");
         props.put("instance.name","under");
-        under = Utils.getComponentInstance(context, "LFC-Test-Immediate", props);
+        under = Utils.getComponentInstance(getContext(), "LFC-Test-Immediate", props);
         
         // The conf is correct, the PS must be provided
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
         assertNotNull("Check service availability -1", ref);
-        CheckService cs = (CheckService) context.getService(ref);
+        CheckService cs = (CheckService) getContext().getService(ref);
         assertTrue("Check state 1", cs.check());
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         cs = null;
         
         // Reconfigure the instance with a bad configuration
@@ -59,7 +59,7 @@
         }
         
         // The instance should now be invalid 
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
         assertNull("Check service availability -2", ref);
         
         // Reconfigure the instance with a valid configuration
@@ -70,11 +70,11 @@
             fail("The reconfiguration is not unacceptable and seems unacceptable (2) : " + props);
         }
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
         assertNotNull("Check service availability -3", ref);
-        cs = (CheckService) context.getService(ref);
+        cs = (CheckService) getContext().getService(ref);
         assertTrue("Check state 2", cs.check());
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         cs = null;
         
         under.dispose();
@@ -84,12 +84,12 @@
         Properties props = new Properties();
         props.put("conf", "bar");
         props.put("instance.name","under");
-        under = Utils.getComponentInstance(context, "LFC-Test-Immediate", props);    
+        under = Utils.getComponentInstance(getContext(), "LFC-Test-Immediate", props);    
         
         assertEquals("check under state", under.getState(), ComponentInstance.INVALID);
         
         // The conf is incorrect, the PS must not be provided
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
         assertNull("Check service availability -1", ref);
         
         // Reconfigure the instance with a correct configuration
@@ -100,11 +100,11 @@
             fail("The reconfiguration is not unacceptable and seems unacceptable : " + props);
         }
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
         assertNotNull("Check service availability -2", ref);
-        CheckService cs = (CheckService) context.getService(ref);
+        CheckService cs = (CheckService) getContext().getService(ref);
         assertTrue("Check state ", cs.check());
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         cs = null;
         
         under.dispose();
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ParentCallbackTestCase.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ParentCallbackTestCase.java
index 8a00224..569493b 100644
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ParentCallbackTestCase.java
+++ b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ParentCallbackTestCase.java
@@ -36,12 +36,12 @@
 	public void setUp() {
 		Properties p2 = new Properties();
 		p2.put("instance.name","fooProvider");
-		fooProvider = Utils.getComponentInstance(context, "LFCB-FooProviderType-1", p2);
+		fooProvider = Utils.getComponentInstance(getContext(), "LFCB-FooProviderType-1", p2);
 		fooProvider.stop();
 		
 		Properties p1 = new Properties();
 		p1.put("instance.name","callback");
-		instance = Utils.getComponentInstance(context, "LFCB-ParentCallbackCheckService", p1);
+		instance = Utils.getComponentInstance(getContext(), "LFCB-ParentCallbackCheckService", p1);
 		
 	}
 	
@@ -54,46 +54,46 @@
 	
 	public void testCallback() {
 		// Check instance is invalid
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
 		
 		// Start fooprovider
 		fooProvider.start();
 		
 		// Check instance validity
-		id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id_dep.getState() == ComponentInstance.VALID);
 		
 		// Check service providing
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		
 		// Check int property		
 		assertEquals("Check pojo count - 2", id_dep.getCreatedObjects().length, 1);
 		
 		fooProvider.stop();
 		
-		id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
 		
 		fooProvider.start();
 		
 		// Check instance validity
-		id_dep = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id_dep.getState() == ComponentInstance.VALID);
 		
 		// Check service providing
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Clean up
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 		cs = null;
 		id_dep = null;
 	}
diff --git a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/ImmediateLifeCycleControllerTest.java b/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/ImmediateLifeCycleControllerTest.java
index 25b3054..9cd60f7 100644
--- a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/ImmediateLifeCycleControllerTest.java
+++ b/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/ImmediateLifeCycleControllerTest.java
@@ -33,21 +33,21 @@
     private Factory factory;
     
     public void setUp() {
-        factory = Utils.getFactoryByName(context, "LFC-Test-Immediate");
+        factory = Utils.getFactoryByName(getContext(), "LFC-Test-Immediate");
     }
     
     public void testOne() {
         Properties props = new Properties();
         props.put("conf", "foo");
         props.put("instance.name","under");
-        under = Utils.getComponentInstance(context, "LFC-Test-Immediate", props);
+        under = Utils.getComponentInstance(getContext(), "LFC-Test-Immediate", props);
         
         // The conf is correct, the PS must be provided
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
         assertNotNull("Check service availability -1", ref);
-        CheckService cs = (CheckService) context.getService(ref);
+        CheckService cs = (CheckService) getContext().getService(ref);
         assertTrue("Check state 1", cs.check());
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         cs = null;
         
         // Reconfigure the instance with a bad configuration
@@ -59,7 +59,7 @@
         }
         
         // The instance should now be invalid 
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
         assertNull("Check service availability -2", ref);
         
         // Reconfigure the instance with a valid configuration
@@ -70,11 +70,11 @@
             fail("The reconfiguration is not unacceptable and seems unacceptable (2) : " + props);
         }
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
         assertNotNull("Check service availability -3", ref);
-        cs = (CheckService) context.getService(ref);
+        cs = (CheckService) getContext().getService(ref);
         assertTrue("Check state 2", cs.check());
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         cs = null;
         
         under.dispose();
@@ -84,12 +84,12 @@
         Properties props = new Properties();
         props.put("conf", "bar");
         props.put("instance.name","under");
-        under = Utils.getComponentInstance(context, "LFC-Test-Immediate", props);    
+        under = Utils.getComponentInstance(getContext(), "LFC-Test-Immediate", props);    
         
         assertEquals("check under state", under.getState(), ComponentInstance.INVALID);
         
         // The conf is incorrect, the PS must not be provided
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
         assertNull("Check service availability -1", ref);
         
         // Reconfigure the instance with a correct configuration
@@ -100,11 +100,11 @@
             fail("The reconfiguration is not unacceptable and seems unacceptable : " + props);
         }
         
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
         assertNotNull("Check service availability -2", ref);
-        CheckService cs = (CheckService) context.getService(ref);
+        CheckService cs = (CheckService) getContext().getService(ref);
         assertTrue("Check state ", cs.check());
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         cs = null;
         
         under.dispose();
diff --git a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTest.java b/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTest.java
index 407200d..68f8600 100644
--- a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTest.java
+++ b/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTest.java
@@ -38,21 +38,21 @@
     private Factory factory;
 
     public void setUp() {
-        factory = Utils.getFactoryByName(context, "LFC-Test");
+        factory = Utils.getFactoryByName(getContext(), "LFC-Test");
     }
 
     public void testOne() {
         Properties props = new Properties();
         props.put("conf", "foo");
         props.put("instance.name","under");
-        under = Utils.getComponentInstance(context, "LFC-Test", props);
+        under = Utils.getComponentInstance(getContext(), "LFC-Test", props);
 
         // The conf is correct, the PS must be provided
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
         assertNotNull("Check service availability -1", ref);
-        CheckService cs = (CheckService) context.getService(ref);
+        CheckService cs = (CheckService) getContext().getService(ref);
         assertTrue("Check state 1", cs.check());
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         cs = null;
 
         // Reconfigure the instance with a bad configuration
@@ -64,7 +64,7 @@
         }
 
         // The instance should now be invalid 
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
         assertNull("Check service availability -2", ref);
 
         // Reconfigure the instance with a valid configuration
@@ -75,11 +75,11 @@
             fail("The reconfiguration is not unacceptable and seems unacceptable (2) : " + props);
         }
 
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
         assertNotNull("Check service availability -3", ref);
-        cs = (CheckService) context.getService(ref);
+        cs = (CheckService) getContext().getService(ref);
         assertTrue("Check state 2", cs.check());
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         cs = null;
 
         under.dispose();
@@ -93,14 +93,14 @@
         Properties props = new Properties();
         props.put("conf", "bar");
         props.put("instance.name","under");
-        under = Utils.getComponentInstance(context, "LFC-Test", props);
+        under = Utils.getComponentInstance(getContext(), "LFC-Test", props);
 
         // The conf is incorrect, but the test can appears only when the object is created : the PS must be provided
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
         assertNotNull("Check service availability -1", ref);
 
-        System.out.println("CS received : " + context.getService(ref));
-        CheckService cs = (CheckService) context.getService(ref);
+        System.out.println("CS received : " + getContext().getService(ref));
+        CheckService cs = (CheckService) getContext().getService(ref);
         assertNotNull("Assert CS not null", cs);
         try {
             assertFalse("Check state (false)", cs.check());
@@ -110,7 +110,7 @@
         }
 
         // As soon as the instance is created, the service has to disappear :
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
         assertNull("Check service availability -2", ref);
 
         // Reconfigure the instance with a correct configuration
@@ -121,11 +121,11 @@
             fail("The reconfiguration is not unacceptable and seems unacceptable : " + props);
         }
 
-        ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), "under");
+        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
         assertNotNull("Check service availability -3", ref);
-        cs = (CheckService) context.getService(ref);
+        cs = (CheckService) getContext().getService(ref);
         assertTrue("Check state ", cs.check());
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         cs = null;
 
         under.dispose();
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/SimpleDPDependencies.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/SimpleDPDependencies.java
index 2ae40ec..97b73df 100644
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/SimpleDPDependencies.java
+++ b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/SimpleDPDependencies.java
@@ -41,22 +41,22 @@
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider-1");
 			prov.put("service.ranking", "1");
-			fooProvider = Utils.getFactoryByName(context, "RankedFooProviderType").createComponentInstance(prov);
+			fooProvider = Utils.getFactoryByName(getContext(), "RankedFooProviderType").createComponentInstance(prov);
 			fooProvider.stop();
 			
 			Properties prov2 = new Properties();
             prov2.put("instance.name","FooProvider-2");
             prov2.put("service.ranking", "0");
-            fooProvider2 = Utils.getFactoryByName(context, "RankedFooProviderType").createComponentInstance(prov2);
+            fooProvider2 = Utils.getFactoryByName(getContext(), "RankedFooProviderType").createComponentInstance(prov2);
             fooProvider2.stop();
 		
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "DPSimpleCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "DPSimpleCheckServiceProvider").createComponentInstance(i1);
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "DPObjectCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "DPObjectCheckServiceProvider").createComponentInstance(i3);
 			
 		} catch(Exception e) { 
 		    e.printStackTrace();
@@ -76,81 +76,81 @@
 	}
 	
 	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider.start();
 		fooProvider2.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		// Check grade
 		Integer grade = (Integer) cs.getProps().get("int");
 		assertEquals("Check first grade", 1, grade.intValue());
 		
 		fooProvider.stop(); // Turn off the best provider.
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         // Check grade
         grade = (Integer) cs.getProps().get("int");
         assertEquals("Check second grade", 0, grade.intValue());
         
 		fooProvider.start(); // Turn on the best provider.
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         // Check grade
         grade = (Integer) cs.getProps().get("int");
         assertEquals("Check third grade", 1, grade.intValue());
         
 		
         // Increase the second provider grade.
-        ServiceReference fs_ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), fooProvider2.getInstanceName());
+        ServiceReference fs_ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider2.getInstanceName());
         assertNotNull("Check foo service (2) reference", fs_ref);
-        FooService fs = (FooService) context.getService(fs_ref);
+        FooService fs = (FooService) getContext().getService(fs_ref);
         
         fs.foo(); // Increase the grade (now = 2)
         
-        cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         // Check grade
         grade = (Integer) cs.getProps().get("int");
         assertEquals("Check fourth grade", 2, grade.intValue());
         
         // Increase the other provider grade.
-        fs_ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), fooProvider.getInstanceName());
+        fs_ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
         assertNotNull("Check foo service (1) reference", fs_ref);
-        fs = (FooService) context.getService(fs_ref);
+        fs = (FooService) getContext().getService(fs_ref);
         fs.foo(); //(grade = 3)
         
-        cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         // Check grade
         grade = (Integer) cs.getProps().get("int");
         assertEquals("Check fifth grade", 3, grade.intValue());
         		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
-		context.ungetService(fs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
+		getContext().ungetService(fs_ref);
 		fooProvider.stop();
 		fooProvider2.stop();
 	}
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodOptionalDependencies.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodOptionalDependencies.java
index 23ccf55..8443197 100644
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodOptionalDependencies.java
+++ b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodOptionalDependencies.java
@@ -39,20 +39,20 @@
         try {
             Properties prov = new Properties();
             prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
             fooProvider.stop();
 
             Properties i3 = new Properties();
             i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(context, "StaticMObjectOptionalCheckServiceProvider").createComponentInstance(i3);
+            instance3 = Utils.getFactoryByName(getContext(), "StaticMObjectOptionalCheckServiceProvider").createComponentInstance(i3);
 
             Properties i4 = new Properties();
             i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(context, "StaticMRefOptionalCheckServiceProvider").createComponentInstance(i4);
+            instance4 = Utils.getFactoryByName(getContext(), "StaticMRefOptionalCheckServiceProvider").createComponentInstance(i4);
 
             Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "StaticMBothOptionalCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "StaticMBothOptionalCheckServiceProvider").createComponentInstance(i5);
         } catch (Exception e) {
             fail(e.getMessage());
         }
@@ -71,14 +71,14 @@
 
     public void testObject() {
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
 
         Properties props = cs.getProps();
 
@@ -95,11 +95,11 @@
 
         fooProvider.start();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -114,10 +114,10 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
@@ -132,19 +132,19 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 
     public void testRef() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
@@ -159,11 +159,11 @@
 
         fooProvider.start();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -178,10 +178,10 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
@@ -196,19 +196,19 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
     
     public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
@@ -223,11 +223,11 @@
 
         fooProvider.start();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -242,10 +242,10 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
@@ -260,8 +260,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 
 }
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodSimpleDependencies.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodSimpleDependencies.java
index adb4c4f..66f75fd 100644
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodSimpleDependencies.java
+++ b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodSimpleDependencies.java
@@ -38,22 +38,22 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider.stop();
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "StaticMObjectCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "StaticMObjectCheckServiceProvider").createComponentInstance(i3);
             assertNotNull("check instance 3", instance3);
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "StaticMRefCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "StaticMRefCheckServiceProvider").createComponentInstance(i4);
             assertNotNull("check instance 4", instance4);
             
             Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "StaticMBothCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "StaticMBothCheckServiceProvider").createComponentInstance(i5);
             assertNotNull("check instance 5", instance5);
 		} catch(Exception e) { fail(e.getMessage()); }
 		
@@ -72,19 +72,19 @@
 
 	
 	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -99,29 +99,29 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -136,29 +136,29 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -173,13 +173,13 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 
 }
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MultipleDependencies.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MultipleDependencies.java
index 8352ec6..3b036a5 100644
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MultipleDependencies.java
+++ b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MultipleDependencies.java
@@ -38,29 +38,29 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider1.stop();
 		
 			Properties prov2 = new Properties();
 			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
 			fooProvider2.stop();
 		
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "StaticSimpleMultipleCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "StaticSimpleMultipleCheckServiceProvider").createComponentInstance(i1);
 		
 			Properties i2 = new Properties();
 			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(context, "StaticVoidMultipleCheckServiceProvider").createComponentInstance(i2);
+			instance2 = Utils.getFactoryByName(getContext(), "StaticVoidMultipleCheckServiceProvider").createComponentInstance(i2);
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "StaticObjectMultipleCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "StaticObjectMultipleCheckServiceProvider").createComponentInstance(i3);
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "StaticRefMultipleCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "StaticRefMultipleCheckServiceProvider").createComponentInstance(i4);
 		} catch(Exception e) { fail(e.getMessage()); }
 		
 	}
@@ -85,14 +85,14 @@
 	    fooProvider1.start();
 	    instance1.start();
 	    
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		
 		//Check properties
@@ -108,10 +108,10 @@
 		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
 		
 		fooProvider2.start();
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -127,13 +127,13 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testVoid() {
@@ -141,14 +141,14 @@
         fooProvider1.start();
         instance2.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
 
         // Check properties
@@ -164,10 +164,10 @@
         assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(), 1.0);
 
         fooProvider2.start();
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation - 2", ((Boolean) props.get("result")).booleanValue()); // True, two providers are here
@@ -183,13 +183,13 @@
 
         fooProvider1.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 	
 	public void testObject() {
@@ -197,14 +197,14 @@
         fooProvider1.start();
         instance3.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
 
         // Check properties
@@ -220,10 +220,10 @@
         assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(), 1.0);
 
         fooProvider2.start();
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation - 2", ((Boolean) props.get("result")).booleanValue()); // True, two providers are here
@@ -239,13 +239,13 @@
 
         fooProvider1.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 	
 	public void testRef() {
@@ -253,14 +253,14 @@
         fooProvider1.start();
         instance4.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
 
         //Check properties
@@ -276,10 +276,10 @@
         assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(), 1.0);
 
         fooProvider2.start();
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 2", ((Boolean) props.get("result")).booleanValue()); // True, two providers are here
@@ -295,13 +295,13 @@
 
         fooProvider1.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 
 	
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/OptionalDependencies.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/OptionalDependencies.java
index ca51add..dad741d 100644
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/OptionalDependencies.java
+++ b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/OptionalDependencies.java
@@ -41,28 +41,28 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider.stop();
 			
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "StaticSimpleOptionalCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "StaticSimpleOptionalCheckServiceProvider").createComponentInstance(i1);
 		
 			Properties i2 = new Properties();
 			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(context, "StaticVoidOptionalCheckServiceProvider").createComponentInstance(i2);
+			instance2 = Utils.getFactoryByName(getContext(), "StaticVoidOptionalCheckServiceProvider").createComponentInstance(i2);
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "StaticObjectOptionalCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "StaticObjectOptionalCheckServiceProvider").createComponentInstance(i3);
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "StaticRefOptionalCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "StaticRefOptionalCheckServiceProvider").createComponentInstance(i4);
 			
 			Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "StaticBothOptionalCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "StaticBothOptionalCheckServiceProvider").createComponentInstance(i5);
 		} catch(Exception e) { fail(e.getMessage()); }		
 	}
 	
@@ -82,14 +82,14 @@
 	}
 	
 	public void atestSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		
 		//Check properties
@@ -107,11 +107,11 @@
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		
 		//Check properties
@@ -129,13 +129,13 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void atestDelayedSimple() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
@@ -143,14 +143,14 @@
 	    fooProvider.start();
 	    instance1.start();
         
-	    ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+	    ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         
         //Check properties
@@ -168,24 +168,24 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.INVALID); // Dependency broken
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);       
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);       
     }
 	
 	public void atestVoid() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
@@ -202,11 +202,11 @@
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -223,10 +223,10 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
@@ -243,8 +243,8 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);	
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);	
 	}
 	
 	public void testDelayedVoid() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
@@ -252,14 +252,14 @@
         fooProvider.start();
         instance2.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         
         //Check properties
@@ -277,24 +277,24 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3 (" + id.getState() + ")", id.getState() == ComponentInstance.INVALID); // Dependency broken
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);       
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);       
     }
 	
 	public void atestObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
@@ -307,11 +307,11 @@
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -324,10 +324,10 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
@@ -340,8 +340,8 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void atestDelayedObject() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
@@ -349,14 +349,14 @@
         fooProvider.start();
         instance3.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         
         //Check properties
@@ -374,24 +374,24 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.INVALID); // Dependency broken
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);       
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);       
     }
 	
 	public void atestRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
@@ -404,11 +404,11 @@
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -421,10 +421,10 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
@@ -437,19 +437,19 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void atestBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
@@ -462,11 +462,11 @@
         
         fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -481,10 +481,10 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3 (" + id.getState() + ")", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
@@ -499,8 +499,8 @@
   
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 
 
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/SimpleDependencies.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/SimpleDependencies.java
index 800f445..a145022 100644
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/SimpleDependencies.java
+++ b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/SimpleDependencies.java
@@ -38,28 +38,28 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider.stop();
 		
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "StaticSimpleCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "StaticSimpleCheckServiceProvider").createComponentInstance(i1);
 		
 			Properties i2 = new Properties();
 			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(context, "StaticVoidCheckServiceProvider").createComponentInstance(i2);
+			instance2 = Utils.getFactoryByName(getContext(), "StaticVoidCheckServiceProvider").createComponentInstance(i2);
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "StaticObjectCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "StaticObjectCheckServiceProvider").createComponentInstance(i3);
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "StaticRefCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "StaticRefCheckServiceProvider").createComponentInstance(i4);
 			
 			Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "StaticBothCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "StaticBothCheckServiceProvider").createComponentInstance(i5);
 		} catch(Exception e) { 
 		    e.printStackTrace();
 		    fail(e.getMessage()); }
@@ -82,58 +82,58 @@
 	}
 	
 	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.INVALID);
 		
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNull("Check CheckService availability", cs_ref);
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
+		getContext().ungetService(arch_ref);
 	}
 	
 	public void testVoid() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		Object o = context.getService(cs_ref);
+		Object o = getContext().getService(cs_ref);
 		CheckService cs = (CheckService) o;
 		Properties props = cs.getProps();
 		//Check properties
@@ -149,41 +149,41 @@
         
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.INVALID);
         
-        cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNull("Check CheckService availability - 2", cs_ref);
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);		
+		getContext().ungetService(arch_ref);		
 	}
 	
 	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -198,41 +198,41 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.INVALID);
         
-        cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNull("Check CheckService availability - 2", cs_ref);
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);     
+        getContext().ungetService(arch_ref);     
 	}
 	
 	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -247,41 +247,41 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.INVALID);
         
-        cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
         assertNull("Check CheckService availability - 2", cs_ref);
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);     
+        getContext().ungetService(arch_ref);     
 	}
 	
 	public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -296,25 +296,25 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.INVALID);
         
-        cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNull("Check CheckService availability - 2", cs_ref);
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);     
+        getContext().ungetService(arch_ref);     
     }
 
 }
diff --git a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/FromDependencies.java b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/FromDependencies.java
index 2d36193..9ddcb09 100644
--- a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/FromDependencies.java
+++ b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/FromDependencies.java
@@ -36,29 +36,29 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","A");
-			providerA = Utils.getFactoryByName(context, "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
+			providerA = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
 			providerA.stop();
 			
 			Properties prov2 = new Properties();
             prov2.put("instance.name","B");
-            providerB = Utils.getFactoryByName(context, "SimpleFilterCheckServiceProvider").createComponentInstance(prov2);
+            providerB = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov2);
             providerB.stop();
             
             Properties prov3 = new Properties();
             prov3.put("service.pid", "A");
-            providerC = Utils.getFactoryByName(context, "SimplePIDCheckServiceProvider").createComponentInstance(prov3);
+            providerC = Utils.getFactoryByName(getContext(), "SimplePIDCheckServiceProvider").createComponentInstance(prov3);
             providerC.stop();
             
             Properties prov4 = new Properties();
             prov4.put("service.pid", "D");
             prov4.put("instance.name","D");
-            providerD = Utils.getFactoryByName(context, "SimplePIDCheckServiceProvider").createComponentInstance(prov4);
+            providerD = Utils.getFactoryByName(getContext(), "SimplePIDCheckServiceProvider").createComponentInstance(prov4);
             providerD.stop();
 		
             // Uses the component type from value
 			Properties i1 = new Properties();
 			i1.put("instance.name","Subscriber1");
-			instance1 = Utils.getFactoryByName(context, "SimpleFromCheckServiceSubscriber").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "SimpleFromCheckServiceSubscriber").createComponentInstance(i1);
 			
 			// Uses the instance configuration from value
 			Properties i2 = new Properties();
@@ -66,7 +66,7 @@
             Properties ii2 = new Properties();
             ii2.put("id1", "B");
             i2.put("requires.from", ii2);
-            instance2 = Utils.getFactoryByName(context, "SimpleFromCheckServiceSubscriber").createComponentInstance(i2);
+            instance2 = Utils.getFactoryByName(getContext(), "SimpleFromCheckServiceSubscriber").createComponentInstance(i2);
             
             // Uses the instance configuration from value (*)
             Properties i3 = new Properties();
@@ -74,7 +74,7 @@
             Properties ii3 = new Properties();
             ii3.put("id1", "*");
             i3.put("requires.from", ii3);
-            instance3 = Utils.getFactoryByName(context, "SimpleFromCheckServiceSubscriber").createComponentInstance(i3);
+            instance3 = Utils.getFactoryByName(getContext(), "SimpleFromCheckServiceSubscriber").createComponentInstance(i3);
 			
             // Uses the instance configuration from value, merge filter and from
             Properties i4 = new Properties();
@@ -85,7 +85,7 @@
             Properties iii4 = new Properties();
             iii4.put("id1", "(service.pid=D)");
             i4.put("requires.filters", iii4);
-            instance4 = Utils.getFactoryByName(context, "SimpleFromCheckServiceSubscriber").createComponentInstance(i4);
+            instance4 = Utils.getFactoryByName(getContext(), "SimpleFromCheckServiceSubscriber").createComponentInstance(i4);
 		
 		} catch(Exception e) { 
 		    e.printStackTrace();
@@ -115,192 +115,192 @@
 	public void testFromInstanceName() {
 	    instance1.start();
 	    
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		providerB.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		providerA.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
 		providerA.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 4", id.getState() == ComponentInstance.INVALID);
 		
 		providerA.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
 		
 		providerA.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 5", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		providerB.stop();
-		context.ungetService(arch_ref);
+		getContext().ungetService(arch_ref);
 	}
 	
 	public void testFromPID() {
         instance1.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         providerB.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         providerC.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
         providerC.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 4", id.getState() == ComponentInstance.INVALID);
         
         providerC.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
         providerC.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 5", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         providerB.stop();
-        context.ungetService(arch_ref);
+        getContext().ungetService(arch_ref);
     }
 	
 	public void testFromInstanceNameInstanceConfiguration() {
         instance2.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         providerA.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         providerB.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
         providerB.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 4", id.getState() == ComponentInstance.INVALID);
         
         providerB.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
         providerB.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 5", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         providerA.stop();
-        context.ungetService(arch_ref);
+        getContext().ungetService(arch_ref);
     }
 	
 	public void testFromInstanceNameStar() {
         instance3.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         providerA.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 0", id.getState() == ComponentInstance.VALID);
         
         providerB.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
         providerB.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 4", id.getState() == ComponentInstance.VALID);
         
         providerA.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.INVALID);
         
         providerB.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 5", id.getState() == ComponentInstance.VALID);
         
         id = null;
         providerB.stop();
-        context.ungetService(arch_ref);
+        getContext().ungetService(arch_ref);
     }
 	
 	public void testFromAndFilter() {
         instance4.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         providerA.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         providerD.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
         providerD.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 4", id.getState() == ComponentInstance.INVALID);
         
         providerD.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
         providerD.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 5", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         providerA.stop();
-        context.ungetService(arch_ref);
+        getContext().ungetService(arch_ref);
     }
 	
 	
diff --git a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/MultipleFilterDependencies.java b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/MultipleFilterDependencies.java
index 499b3f8..6334c5c 100644
--- a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/MultipleFilterDependencies.java
+++ b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/MultipleFilterDependencies.java
@@ -38,31 +38,31 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
 			fooProvider1.stop();
 			
 			prov = new Properties();
             prov.put("instance.name","FooProvider2");
-            fooProvider2 = Utils.getFactoryByName(context, "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
+            fooProvider2 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
             fooProvider2.stop();
 		
 			Properties i1 = new Properties();
 			i1.put("instance.name","Subscriber1");
-			instance1 = Utils.getFactoryByName(context, "MultipleFilterCheckServiceSubscriber").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "MultipleFilterCheckServiceSubscriber").createComponentInstance(i1);
 			
 			Properties i2 = new Properties();
             i2.put("instance.name","Subscriber2");
             Properties ii2 = new Properties();
             ii2.put("id2", "(toto=A)");
             i2.put("requires.filters", ii2);
-            instance2 = Utils.getFactoryByName(context, "MultipleFilterCheckServiceSubscriber2").createComponentInstance(i2);
+            instance2 = Utils.getFactoryByName(getContext(), "MultipleFilterCheckServiceSubscriber2").createComponentInstance(i2);
             
             Properties i3 = new Properties();
             i3.put("instance.name","Subscriber3");
             Properties ii3 = new Properties();
             ii3.put("id1", "(toto=A)");
             i3.put("requires.filters", ii3);
-            instance3 = Utils.getFactoryByName(context, "MultipleFilterCheckServiceSubscriber").createComponentInstance(i3);
+            instance3 = Utils.getFactoryByName(getContext(), "MultipleFilterCheckServiceSubscriber").createComponentInstance(i3);
 		
 		} catch(Exception e) { 
 		    e.printStackTrace();
@@ -86,45 +86,45 @@
 	public void testMultipleNotMatch() {
 	    instance1.start();
 	    
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 
         
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		// change the value of the property toto
 		cs.check();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check Array size - 3", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         
         fooProvider2.start();
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider2.getInstanceName());
+        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref2);
-        CheckService cs2 = (CheckService) context.getService(cs_ref2);
+        CheckService cs2 = (CheckService) getContext().getService(cs_ref2);
         // change the value of the property toto
         cs2.check();
         assertTrue("Check service invocation", cs_instance.check());
@@ -133,40 +133,40 @@
         
         // change the value of the property toto
         cs.check();
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertTrue("Check Array size - 6", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 7", id.getState() == ComponentInstance.INVALID);
 		
 		
 		fooProvider2.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 8", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service Binding - 8", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertTrue("Check Array size - 8", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 9", id.getState() == ComponentInstance.INVALID);
 		
         id = null;
         cs = null;
         cs2 = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
-        context.ungetService(cs_ref2);		
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
+        getContext().ungetService(cs_ref2);		
 	}
 	
 	public void testMultipleMatch() {
@@ -174,28 +174,28 @@
 	    fooProvider1.start();
 	    fooProvider2.start();
 	    
-	    ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+	    ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
         
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider2.getInstanceName());
+        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref2);
-        CheckService cs2 = (CheckService) context.getService(cs_ref2);
+        CheckService cs2 = (CheckService) getContext().getService(cs_ref2);
         // change the value of the property toto
         cs2.check();
 	    
         instance1.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
         assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
@@ -203,7 +203,7 @@
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -211,23 +211,23 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
         
         fooProvider2.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
@@ -237,59 +237,59 @@
         cs = null;
         cs2 = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
-        context.ungetService(cs_ref2);      
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
+        getContext().ungetService(cs_ref2);      
     }
 	
 	public void testMultipleNotMatchInstance() {
         instance3.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         
         fooProvider1.start();
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         
-        cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         
         fooProvider2.start();
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider2.getInstanceName());
+        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref2);
-        CheckService cs2 = (CheckService) context.getService(cs_ref2);
+        CheckService cs2 = (CheckService) getContext().getService(cs_ref2);
         // change the value of the property toto
         cs2.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -302,40 +302,40 @@
         
         // change the value of the property toto
         cs.check();
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertTrue("Check Array size - 6", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 7", id.getState() == ComponentInstance.INVALID);
         
         fooProvider2.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 8", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 8", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertTrue("Check Array size - 8", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 9", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
         cs2 = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
-        context.ungetService(cs_ref2);
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
+        getContext().ungetService(cs_ref2);
     }
     
     public void testMultipleMatchInstance() {
@@ -344,21 +344,21 @@
         fooProvider2.start();
         instance3.start();
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider2.getInstanceName());
+        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref2);
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
         assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
@@ -366,7 +366,7 @@
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -374,24 +374,24 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
        
         
         fooProvider2.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
@@ -400,59 +400,59 @@
         id = null;
         cs = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
-        context.ungetService(cs_ref2);        
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
+        getContext().ungetService(cs_ref2);        
     }
 	
     public void testMultipleNotMatchInstanceWithoutFilter() {
         instance2.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         
         fooProvider1.start();
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         
-        cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         
         fooProvider2.start();
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider2.getInstanceName());
+        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref2);
-        CheckService cs2 = (CheckService) context.getService(cs_ref2);
+        CheckService cs2 = (CheckService) getContext().getService(cs_ref2);
         // change the value of the property toto
         cs2.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -465,40 +465,40 @@
         
         // change the value of the property toto
         cs.check();
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertTrue("Check Array size - 6", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 7", id.getState() == ComponentInstance.INVALID);
         
         fooProvider2.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 8", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 8", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertTrue("Check Array size - 8", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 9", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
         cs2 = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
-        context.ungetService(cs_ref2);
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
+        getContext().ungetService(cs_ref2);
     }
     
     public void testMultipleMatchInstanceWithoutFilter() {
@@ -506,21 +506,21 @@
         fooProvider2.start();
         instance2.start();
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider2.getInstanceName());
+        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref2);
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
         assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
@@ -528,7 +528,7 @@
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -536,24 +536,24 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
        
         
         fooProvider2.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
@@ -562,10 +562,10 @@
         id = null;
         cs = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
-        context.ungetService(cs_ref2);        
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
+        getContext().ungetService(cs_ref2);        
     }
 
 }
diff --git a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/OptionalMultipleFilterDependencies.java b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/OptionalMultipleFilterDependencies.java
index 445dc45..61bba51 100644
--- a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/OptionalMultipleFilterDependencies.java
+++ b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/OptionalMultipleFilterDependencies.java
@@ -38,31 +38,31 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
 			fooProvider1.stop();
 			
 			prov = new Properties();
             prov.put("instance.name","FooProvider2");
-            fooProvider2 = Utils.getFactoryByName(context, "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
+            fooProvider2 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
             fooProvider2.stop();
 		
 			Properties i1 = new Properties();
 			i1.put("instance.name","Subscriber1");
-			instance1 = Utils.getFactoryByName(context, "OptionalMultipleFilterCheckServiceSubscriber").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "OptionalMultipleFilterCheckServiceSubscriber").createComponentInstance(i1);
 			
 			Properties i2 = new Properties();
             i2.put("instance.name","Subscriber2");
             Properties ii2 = new Properties();
             ii2.put("id2", "(toto=A)");
             i2.put("requires.filters", ii2);
-            instance2 = Utils.getFactoryByName(context, "OptionalMultipleFilterCheckServiceSubscriber2").createComponentInstance(i2);
+            instance2 = Utils.getFactoryByName(getContext(), "OptionalMultipleFilterCheckServiceSubscriber2").createComponentInstance(i2);
             
             Properties i3 = new Properties();
             i3.put("instance.name","Subscriber3");
             Properties ii3 = new Properties();
             ii3.put("id1", "(toto=A)");
             i3.put("requires.filters", ii3);
-            instance3 = Utils.getFactoryByName(context, "OptionalMultipleFilterCheckServiceSubscriber").createComponentInstance(i3);
+            instance3 = Utils.getFactoryByName(getContext(), "OptionalMultipleFilterCheckServiceSubscriber").createComponentInstance(i3);
 		
 		} catch(Exception e) { 
 		    e.printStackTrace();
@@ -86,53 +86,53 @@
 	public void testMultipleNotMatch() {
 	    instance1.start();
 	    
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
         assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
         
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
         assertTrue("Check Array size - 2", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		// change the value of the property toto
 		cs.check();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check Array size - 3", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         
         fooProvider2.start();
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider2.getInstanceName());
+        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref2);
-        CheckService cs2 = (CheckService) context.getService(cs_ref2);
+        CheckService cs2 = (CheckService) getContext().getService(cs_ref2);
         // change the value of the property toto
         cs2.check();
         assertTrue("Check service invocation", cs_instance.check());
@@ -141,28 +141,28 @@
         
         // change the value of the property toto
         cs.check();
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertTrue("Check Array size - 6", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 7", id.getState() == ComponentInstance.VALID);
 		assertTrue("Check service Binding - 7", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
 		assertTrue("Check Array size - 7", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
 		
 		fooProvider2.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 8", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service Binding - 8", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertTrue("Check Array size - 8", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 9", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service Binding - 9", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
         assertTrue("Check Array size - 9", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
@@ -171,10 +171,10 @@
         cs = null;
         cs2 = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
-        context.ungetService(cs_ref2);		
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
+        getContext().ungetService(cs_ref2);		
 	}
 	
 	public void testMultipleMatch() {
@@ -182,28 +182,28 @@
 	    fooProvider1.start();
 	    fooProvider2.start();
 	    
-	    ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+	    ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
         
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider2.getInstanceName());
+        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref2);
-        CheckService cs2 = (CheckService) context.getService(cs_ref2);
+        CheckService cs2 = (CheckService) getContext().getService(cs_ref2);
         // change the value of the property toto
         cs2.check();
 	    
         instance1.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
         assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
@@ -211,7 +211,7 @@
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -219,7 +219,7 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -227,7 +227,7 @@
         
         fooProvider2.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -235,7 +235,7 @@
         
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
@@ -245,66 +245,66 @@
         cs = null;
         cs2 = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
-        context.ungetService(cs_ref2);      
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
+        getContext().ungetService(cs_ref2);      
     }
 	
 	public void testMultipleNotMatchInstance() {
         instance3.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
         assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
         
         fooProvider1.start();
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
         assertTrue("Check Array size - 2", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
         
-        cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check Array size - 3", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         
         fooProvider2.start();
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider2.getInstanceName());
+        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref2);
-        CheckService cs2 = (CheckService) context.getService(cs_ref2);
+        CheckService cs2 = (CheckService) getContext().getService(cs_ref2);
         // change the value of the property toto
         cs2.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -317,28 +317,28 @@
         
         // change the value of the property toto
         cs.check();
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertTrue("Check Array size - 6", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 7", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service Binding - 7", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
         assertTrue("Check Array size - 7", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
         
         fooProvider2.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 8", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service Binding - 8", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertTrue("Check Array size - 8", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 9", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service Binding - 9", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
         assertTrue("Check Array size - 9", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
@@ -347,10 +347,10 @@
         cs = null;
         cs2 = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
-        context.ungetService(cs_ref2);
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
+        getContext().ungetService(cs_ref2);
     }
     
     public void testMultipleMatchInstance() {
@@ -359,21 +359,21 @@
         fooProvider2.start();
         instance3.start();
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider2.getInstanceName());
+        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref2);
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
         assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
@@ -381,7 +381,7 @@
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -389,7 +389,7 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -397,7 +397,7 @@
         
         fooProvider2.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -405,7 +405,7 @@
         
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
@@ -414,66 +414,66 @@
         id = null;
         cs = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
-        context.ungetService(cs_ref2);        
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
+        getContext().ungetService(cs_ref2);        
     }
 	
     public void testMultipleNotMatchInstanceWithoutFilter() {
         instance2.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
         assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
         
         fooProvider1.start();
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
         assertTrue("Check Array size - 2", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
         
-        cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check Array size - 3", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         
         fooProvider2.start();
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider2.getInstanceName());
+        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref2);
-        CheckService cs2 = (CheckService) context.getService(cs_ref2);
+        CheckService cs2 = (CheckService) getContext().getService(cs_ref2);
         // change the value of the property toto
         cs2.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -486,28 +486,28 @@
         
         // change the value of the property toto
         cs.check();
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertTrue("Check Array size - 6", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 7", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service Binding - 7", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
         assertTrue("Check Array size - 7", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
         
         fooProvider2.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 8", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service Binding - 8", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertTrue("Check Array size - 8", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 9", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service Binding - 9", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
         assertTrue("Check Array size - 9", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
@@ -516,10 +516,10 @@
         cs = null;
         cs2 = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
-        context.ungetService(cs_ref2);   
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
+        getContext().ungetService(cs_ref2);   
     }
     
     public void testMultipleMatchInstanceWithoutFilter() {
@@ -529,21 +529,21 @@
         fooProvider2.start();
         instance2.start();
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider2.getInstanceName());
+        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref2);
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
         assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
@@ -551,7 +551,7 @@
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -559,7 +559,7 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -567,7 +567,7 @@
         
         fooProvider2.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -575,7 +575,7 @@
         
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
@@ -584,10 +584,10 @@
         id = null;
         cs = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
-        context.ungetService(cs_ref2);      
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
+        getContext().ungetService(cs_ref2);      
     }
 
 }
diff --git a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/OptionalSimpleFilterDependencies.java b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/OptionalSimpleFilterDependencies.java
index fe08278..628dbef 100644
--- a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/OptionalSimpleFilterDependencies.java
+++ b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/OptionalSimpleFilterDependencies.java
@@ -38,31 +38,31 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
 			fooProvider1.stop();
 			
 			prov = new Properties();
             prov.put("instance.name","FooProvider2");
-            fooProvider2 = Utils.getFactoryByName(context, "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
+            fooProvider2 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
             fooProvider2.stop();
 		
 			Properties i1 = new Properties();
 			i1.put("instance.name","Subscriber1");
-			instance1 = Utils.getFactoryByName(context, "OptionalSimpleFilterCheckServiceSubscriber").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "OptionalSimpleFilterCheckServiceSubscriber").createComponentInstance(i1);
 			
 			Properties i2 = new Properties();
             i2.put("instance.name","Subscriber2");
             Properties ii2 = new Properties();
             ii2.put("id2", "(toto=A)");
             i2.put("requires.filters", ii2);
-            instance2 = Utils.getFactoryByName(context, "OptionalSimpleFilterCheckServiceSubscriber2").createComponentInstance(i2);
+            instance2 = Utils.getFactoryByName(getContext(), "OptionalSimpleFilterCheckServiceSubscriber2").createComponentInstance(i2);
             
             Properties i3 = new Properties();
             i3.put("instance.name","Subscriber3");
             Properties ii3 = new Properties();
             ii3.put("id1", "(toto=A)");
             i3.put("requires.filters", ii3);
-            instance3 = Utils.getFactoryByName(context, "OptionalSimpleFilterCheckServiceSubscriber").createComponentInstance(i3);
+            instance3 = Utils.getFactoryByName(getContext(), "OptionalSimpleFilterCheckServiceSubscriber").createComponentInstance(i3);
 		
 		} catch(Exception e) { 
 		    e.printStackTrace();
@@ -86,81 +86,81 @@
 	public void testSimpleNotMatch() {
 	    instance1.start();
 	    
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
         assertTrue("Check Nullable - 1", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
         
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
         assertTrue("Check Nullable - 2", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		// change the value of the property toto
 		cs.check();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertFalse("Check Nullable - 3", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
         assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
         assertTrue("Check Nullable - 4", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
         
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("check CheckService invocation", cs_instance.check());
         assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertFalse("Check Nullable - 5", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
         
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
 		assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
 		assertTrue("Check Nullable - 6", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_instance_ref);
-		cs_instance = (CheckService) context.getService(cs_instance_ref);
+		cs_instance = (CheckService) getContext().getService(cs_instance_ref);
 		assertTrue("check CheckService invocation", cs_instance.check());
 		assertTrue("Check service Binding - 7", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
 		assertFalse("Check Nullable - 7", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
 		assertTrue("Check service Binding - 8", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
 		assertTrue("Check Nullable - 8", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
@@ -168,31 +168,31 @@
 		id = null;
 		cs = null;
 		cs_instance = null;
-		context.ungetService(cs_instance_ref);
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(cs_instance_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void testSimpleMatch() {
 	    
 	    fooProvider1.start();
 	    
-	    ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+	    ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
 	    
         instance1.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertFalse("Check Nullable - 1", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
@@ -200,7 +200,7 @@
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -208,7 +208,7 @@
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -216,7 +216,7 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -224,7 +224,7 @@
         
         fooProvider1.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -232,7 +232,7 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -241,33 +241,33 @@
         id = null;
         cs = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);       
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);       
     }
 	
 	public void testSimpleNotMatchInstance() {
         instance3.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
         assertTrue("Check Nullable - 1", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
         
         fooProvider1.start();
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -276,7 +276,7 @@
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -285,7 +285,7 @@
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -294,7 +294,7 @@
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -302,7 +302,7 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -310,7 +310,7 @@
         
         fooProvider1.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 7", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 7", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -318,7 +318,7 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 8", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 8", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -326,9 +326,9 @@
         id = null;
         cs = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);       
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);       
     }
     
     public void testSimpleMatchInstance() {
@@ -336,25 +336,25 @@
         fooProvider1.start();
         instance3.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertFalse("Check Nullable - 1", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -363,7 +363,7 @@
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -371,7 +371,7 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -379,7 +379,7 @@
         
         fooProvider1.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -387,7 +387,7 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -396,33 +396,33 @@
         id = null;
         cs = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);       
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);       
     }
 	
     public void testSimpleNotMatchInstanceWithoutFilter() {
         instance2.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
         assertTrue("Check Nullable - 1", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
         
         fooProvider1.start();
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -431,7 +431,7 @@
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -440,7 +440,7 @@
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -449,7 +449,7 @@
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -457,7 +457,7 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -465,7 +465,7 @@
         
         fooProvider1.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 7", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 7", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -473,7 +473,7 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 8", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 8", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -481,9 +481,9 @@
         id = null;
         cs = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);      
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);      
     }
     
     public void testSimpleMatchInstanceWithoutFilter() {
@@ -491,25 +491,25 @@
         fooProvider1.start();
         instance2.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
         assertFalse("Check Nullable - 1", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -518,7 +518,7 @@
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -526,7 +526,7 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -534,7 +534,7 @@
         
         fooProvider1.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
@@ -542,7 +542,7 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
         assertTrue("Check service invocation", cs_instance.check());
         assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
@@ -551,9 +551,9 @@
         id = null;
         cs = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);       
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);       
     }
 
 }
diff --git a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/SimpleFilterDependencies.java b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/SimpleFilterDependencies.java
index a20c955..409e279 100644
--- a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/SimpleFilterDependencies.java
+++ b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/SimpleFilterDependencies.java
@@ -38,31 +38,31 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
 			fooProvider1.stop();
 			
 			prov = new Properties();
             prov.put("instance.name","FooProvider2");
-            fooProvider2 = Utils.getFactoryByName(context, "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
+            fooProvider2 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
             fooProvider2.stop();
 		
 			Properties i1 = new Properties();
 			i1.put("instance.name","Subscriber1");
-			instance1 = Utils.getFactoryByName(context, "SimpleFilterCheckServiceSubscriber").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceSubscriber").createComponentInstance(i1);
 			
 			Properties i2 = new Properties();
             i2.put("instance.name","Subscriber2");
             Properties ii2 = new Properties();
             ii2.put("id2", "(toto=A)");
             i2.put("requires.filters", ii2);
-            instance2 = Utils.getFactoryByName(context, "SimpleFilterCheckServiceSubscriber2").createComponentInstance(i2);
+            instance2 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceSubscriber2").createComponentInstance(i2);
             
             Properties i3 = new Properties();
             i3.put("instance.name","Subscriber3");
             Properties ii3 = new Properties();
             ii3.put("id1", "(toto=A)");
             i3.put("requires.filters", ii3);
-            instance3 = Utils.getFactoryByName(context, "SimpleFilterCheckServiceSubscriber").createComponentInstance(i3);
+            instance3 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceSubscriber").createComponentInstance(i3);
 		
 		} catch(Exception e) { 
 		    e.printStackTrace();
@@ -86,214 +86,214 @@
 	public void testSimpleNotMatch() {
 	    instance1.start();
 	    
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		// change the value of the property toto
 		cs.check();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
         
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("check CheckService invocation", cs_instance.check());
         
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 4", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_instance_ref);
-		cs_instance = (CheckService) context.getService(cs_instance_ref);
+		cs_instance = (CheckService) getContext().getService(cs_instance_ref);
 		assertTrue("check CheckService invocation", cs_instance.check());
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 5", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
 		cs_instance = null;
-		context.ungetService(cs_instance_ref);
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(cs_instance_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void testSimpleMatch() {
 	    
 	    fooProvider1.start();
 	    
-	    ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+	    ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
 	    
         instance1.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("check CheckService invocation", cs_instance.check());
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         fooProvider1.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("check CheckService invocation", cs_instance.check());
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);       
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);       
     }
 	
 	public void testSimpleNotMatchInstance() {
         instance3.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         fooProvider1.start();
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
         
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("check CheckService invocation", cs_instance.check());
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 4", id.getState() == ComponentInstance.INVALID);
         
         fooProvider1.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("check CheckService invocation", cs_instance.check());
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 5", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);       
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);       
     }
     
     public void testSimpleMatchInstance() {
@@ -301,136 +301,136 @@
         fooProvider1.start();
         instance3.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("check CheckService invocation", cs_instance.check());
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         fooProvider1.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("check CheckService invocation", cs_instance.check());
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);       
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);       
     }
 	
     public void testSimpleNotMatchInstanceWithoutFilter() {
         instance2.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         fooProvider1.start();
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
         
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("check CheckService invocation", cs_instance.check());
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 4", id.getState() == ComponentInstance.INVALID);
         
         fooProvider1.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("check CheckService invocation", cs_instance.check());
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 5", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);       
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);       
     }
     
     public void testSimpleMatchInstanceWithoutFilter() {
@@ -438,62 +438,62 @@
         fooProvider1.start();
         instance2.start();
         
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) context.getService(cs_instance_ref);
+        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("Check service invocation", cs_instance.check());
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), fooProvider1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         // change the value of the property toto
         cs.check();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("check CheckService invocation", cs_instance.check());
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         fooProvider1.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs_instance_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) context.getService(cs_instance_ref);
+        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
         assertTrue("check CheckService invocation", cs_instance.check());
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
         cs_instance = null;
-        context.ungetService(cs_instance_ref);
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);       
+        getContext().ungetService(cs_instance_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);       
     }
 
 }
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
index 534c85f..8dbe98e 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
@@ -50,7 +50,7 @@
         if (bc ==null) {
             throw new RuntimeException("Injected bundle context null");
         }
-            m_context = bc;
+        m_context = bc;
     }
 
 	public boolean foo() {
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/CollectionMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/CollectionMultipleDependencies.java
index 00ff782..3027fa0 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/CollectionMultipleDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/CollectionMultipleDependencies.java
@@ -37,21 +37,21 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider1.stop();
 		
 			Properties prov2 = new Properties();
 			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
 			fooProvider2.stop();
 		
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "SimpleCollectionCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "SimpleCollectionCheckServiceProvider").createComponentInstance(i1);
 			
 			Properties i2 = new Properties();
             i2.put("instance.name","Optional");
-            instance2 = Utils.getFactoryByName(context, "OptionalCollectionCheckServiceProvider").createComponentInstance(i2);
+            instance2 = Utils.getFactoryByName(getContext(), "OptionalCollectionCheckServiceProvider").createComponentInstance(i2);
 		} catch(Exception e) { fail(e.getMessage()); }
 		
 	}
@@ -68,19 +68,19 @@
 	}
 	
 	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -95,10 +95,10 @@
 		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
 		
 		fooProvider2.start();
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -114,10 +114,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -132,24 +132,24 @@
 		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
 		
 		fooProvider2.stop();
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testOptional() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -165,10 +165,10 @@
         
         fooProvider1.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -184,10 +184,10 @@
         
         fooProvider2.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -203,10 +203,10 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
@@ -222,10 +222,10 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
@@ -241,8 +241,8 @@
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);       
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);       
     }
 	
 }
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedMultipleDependencies.java
index 1f9e102..4df02b9 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedMultipleDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedMultipleDependencies.java
@@ -38,46 +38,46 @@
 		try {
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "SimpleMultipleCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "SimpleMultipleCheckServiceProvider").createComponentInstance(i1);
 			instance1.stop();
 		
 			Properties i2 = new Properties();
 			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(context, "VoidMultipleCheckServiceProvider").createComponentInstance(i2);
+			instance2 = Utils.getFactoryByName(getContext(), "VoidMultipleCheckServiceProvider").createComponentInstance(i2);
 			instance2.stop();
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "ObjectMultipleCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "ObjectMultipleCheckServiceProvider").createComponentInstance(i3);
 			instance3.stop();
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "RefMultipleCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "RefMultipleCheckServiceProvider").createComponentInstance(i4);
 			instance4.stop();
 			
 	         Properties i5 = new Properties();
 	         i5.put("instance.name","Both");
-	         instance5 = Utils.getFactoryByName(context, "BothMultipleCheckServiceProvider").createComponentInstance(i5);
+	         instance5 = Utils.getFactoryByName(getContext(), "BothMultipleCheckServiceProvider").createComponentInstance(i5);
 	         instance5.stop();
 	         
 	         Properties i6 = new Properties();
              i6.put("instance.name","Map");
-             instance6 = Utils.getFactoryByName(context, "MapMultipleCheckServiceProvider").createComponentInstance(i6);
+             instance6 = Utils.getFactoryByName(getContext(), "MapMultipleCheckServiceProvider").createComponentInstance(i6);
              instance6.stop();
              
              Properties i7 = new Properties();
              i7.put("instance.name","Dict");
-             instance7 = Utils.getFactoryByName(context, "DictMultipleCheckServiceProvider").createComponentInstance(i7);
+             instance7 = Utils.getFactoryByName(getContext(), "DictMultipleCheckServiceProvider").createComponentInstance(i7);
              instance7.stop();
 		
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 		
 			Properties prov2 = new Properties();
 			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
 		} catch(Exception e) { fail(e.getMessage()); }
 	}
 	
@@ -105,14 +105,14 @@
 	public void testSimple() {
 		instance1.start();
 		
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -128,10 +128,10 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -147,13 +147,13 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 		
 		instance1.stop();
 	}
@@ -161,14 +161,14 @@
 	public void testVoid() {
 		instance2.start();
 		
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -184,10 +184,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -203,30 +203,30 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);	
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);	
 		instance2.stop();
 	}
 	
 	public void testObject() {
 		instance3.start();
 		
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -242,10 +242,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -261,26 +261,26 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 		instance3.stop();
 	}
 	
 	public void testRef() {
 		instance4.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -296,10 +296,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -315,26 +315,26 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
+		getContext().ungetService(arch_ref);
 		instance4.stop();
-		context.ungetService(cs_ref);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testBoth() {
         instance5.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -355,10 +355,10 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -378,26 +378,26 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
+        getContext().ungetService(arch_ref);
         instance5.stop();
-        context.ungetService(cs_ref);
+        getContext().ungetService(cs_ref);
     }
 	
 	public void testMap() {
 	        instance6.start();
-	        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance6.getInstanceName());
+	        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
 	        assertNotNull("Check architecture availability", arch_ref);
-	        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 	        
-	        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance6.getInstanceName());
+	        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
 	        assertNotNull("Check CheckService availability", cs_ref);
-	        CheckService cs = (CheckService) context.getService(cs_ref);
+	        CheckService cs = (CheckService) getContext().getService(cs_ref);
 	        Properties props = cs.getProps();
 	        //Check properties
 	        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -418,10 +418,10 @@
 	        
 	        fooProvider1.stop();
 	        
-	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 	        
-	        cs = (CheckService) context.getService(cs_ref);
+	        cs = (CheckService) getContext().getService(cs_ref);
 	        props = cs.getProps();
 	        //Check properties
 	        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -441,26 +441,26 @@
 	        
 	        fooProvider2.stop();
 	        
-	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
 	        
 	        id = null;
 	        cs = null;
-	        context.ungetService(arch_ref);
+	        getContext().ungetService(arch_ref);
 	        instance6.stop();
-	        context.ungetService(cs_ref);
+	        getContext().ungetService(cs_ref);
 	}
 	
 	public void testDict() {
         instance7.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance7.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance7.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -481,10 +481,10 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -504,14 +504,14 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
+        getContext().ungetService(arch_ref);
         instance7.stop();
-        context.ungetService(cs_ref);
+        getContext().ungetService(cs_ref);
 	}
 
 	
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalDependencies.java
index caebfe7..8a0ff11 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalDependencies.java
@@ -39,41 +39,41 @@
         try {
             Properties prov = new Properties();
             prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 
             Properties i1 = new Properties();
             i1.put("instance.name","Simple");
-            instance1 = Utils.getFactoryByName(context, "SimpleOptionalCheckServiceProvider").createComponentInstance(i1);
+            instance1 = Utils.getFactoryByName(getContext(), "SimpleOptionalCheckServiceProvider").createComponentInstance(i1);
             instance1.stop();
 
             Properties i2 = new Properties();
             i2.put("instance.name","Void");
-            instance2 = Utils.getFactoryByName(context, "VoidOptionalCheckServiceProvider").createComponentInstance(i2);
+            instance2 = Utils.getFactoryByName(getContext(), "VoidOptionalCheckServiceProvider").createComponentInstance(i2);
             instance2.stop();
 
             Properties i3 = new Properties();
             i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(context, "ObjectOptionalCheckServiceProvider").createComponentInstance(i3);
+            instance3 = Utils.getFactoryByName(getContext(), "ObjectOptionalCheckServiceProvider").createComponentInstance(i3);
             instance3.stop();
 
             Properties i4 = new Properties();
             i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(context, "RefOptionalCheckServiceProvider").createComponentInstance(i4);
+            instance4 = Utils.getFactoryByName(getContext(), "RefOptionalCheckServiceProvider").createComponentInstance(i4);
             instance4.stop();
 
             Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "BothOptionalCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "BothOptionalCheckServiceProvider").createComponentInstance(i5);
             instance5.stop();
             
             Properties i6 = new Properties();
             i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(context, "MapOptionalCheckServiceProvider").createComponentInstance(i6);
+            instance6 = Utils.getFactoryByName(getContext(), "MapOptionalCheckServiceProvider").createComponentInstance(i6);
             instance6.stop();
             
             Properties i7 = new Properties();
             i7.put("instance.name","Dict");
-            instance7 = Utils.getFactoryByName(context, "DictOptionalCheckServiceProvider").createComponentInstance(i7);
+            instance7 = Utils.getFactoryByName(getContext(), "DictOptionalCheckServiceProvider").createComponentInstance(i7);
             instance7.stop();
         } catch (Exception e) {
             fail(e.getMessage());
@@ -103,14 +103,14 @@
     public void testSimple() {
         instance1.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
 
         // Check properties
@@ -130,11 +130,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation - 2", ((Boolean) props.get("result")).booleanValue()); // True, a provider is here
@@ -153,22 +153,22 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance1.stop();
     }
 
     public void testVoid() {
         instance2.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation - 1", ((Boolean) props.get("result")).booleanValue());
@@ -187,11 +187,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -210,22 +210,22 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance2.stop();
     }
 
     public void testObject() {
         instance3.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -240,11 +240,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -259,8 +259,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance3.stop();
     }
@@ -268,14 +268,14 @@
     public void testRef() {
         instance4.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -290,11 +290,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -309,8 +309,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance4.stop();
     }
@@ -318,14 +318,14 @@
     public void testBoth() {
         instance5.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -344,11 +344,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -367,8 +367,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance5.stop();
     }
@@ -376,14 +376,14 @@
     public void testMap() {
         instance6.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance6.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance6.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -402,11 +402,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -425,8 +425,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance6.stop();
     }
@@ -434,14 +434,14 @@
     public void testDict() {
         instance7.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance7.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance7.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -460,11 +460,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -483,8 +483,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance7.stop();
     }
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalMultipleDependencies.java
index b458d9d..518a9d8 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalMultipleDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalMultipleDependencies.java
@@ -37,31 +37,31 @@
 		try {
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "SimpleOptionalMultipleCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "SimpleOptionalMultipleCheckServiceProvider").createComponentInstance(i1);
 			instance1.stop();
 		
 			Properties i2 = new Properties();
 			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(context, "VoidOptionalMultipleCheckServiceProvider").createComponentInstance(i2);
+			instance2 = Utils.getFactoryByName(getContext(), "VoidOptionalMultipleCheckServiceProvider").createComponentInstance(i2);
 			instance2.stop();
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "ObjectOptionalMultipleCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "ObjectOptionalMultipleCheckServiceProvider").createComponentInstance(i3);
 			instance3.stop();
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "RefOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "RefOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
 			instance4.stop();
 		
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 		
 			Properties prov2 = new Properties();
 			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
 		} catch(Exception e) { fail(e.getMessage()); }		
 	}
 	
@@ -82,14 +82,14 @@
 	
 	public void testSimple() {
 		instance1.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue());
@@ -105,10 +105,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
@@ -124,10 +124,10 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
@@ -143,21 +143,21 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 		instance1.stop();
 	}
 	
 	public void testVoid() {
 		instance2.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue());
@@ -173,10 +173,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -192,10 +192,10 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -211,21 +211,21 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 		instance2.stop();
 	}
 	
 	public void testObject() {
 		instance3.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue());
@@ -241,10 +241,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue());
@@ -260,10 +260,10 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -279,21 +279,21 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 		instance3.stop();
 	}
 	
 	public void testRef() {
 		instance4.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue());
@@ -309,10 +309,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue());
@@ -328,10 +328,10 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -347,8 +347,8 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 		instance4.stop();
 	}
 
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedSimpleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedSimpleDependencies.java
index a0b4ff0..4adf04b 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedSimpleDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedSimpleDependencies.java
@@ -37,41 +37,41 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 		
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "SimpleCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "SimpleCheckServiceProvider").createComponentInstance(i1);
 			instance1.stop();
 		
 			Properties i2 = new Properties();
 			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(context, "VoidCheckServiceProvider").createComponentInstance(i2);
+			instance2 = Utils.getFactoryByName(getContext(), "VoidCheckServiceProvider").createComponentInstance(i2);
 			instance2.stop();
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "ObjectCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "ObjectCheckServiceProvider").createComponentInstance(i3);
 			instance3.stop();
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "RefCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "RefCheckServiceProvider").createComponentInstance(i4);
 			instance4.stop();
 			
 			Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "BothCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "BothCheckServiceProvider").createComponentInstance(i5);
             instance5.stop();
             
             Properties i6 = new Properties();
             i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(context, "MapCheckServiceProvider").createComponentInstance(i6);
+            instance6 = Utils.getFactoryByName(getContext(), "MapCheckServiceProvider").createComponentInstance(i6);
             instance6.stop();
             
             Properties i7 = new Properties();
             i7.put("instance.name","Dict");
-            instance7 = Utils.getFactoryByName(context, "DictCheckServiceProvider").createComponentInstance(i7);
+            instance7 = Utils.getFactoryByName(getContext(), "DictCheckServiceProvider").createComponentInstance(i7);
             instance7.stop();
 		} catch(Exception e) { fail(e.getMessage()); } 
 		
@@ -100,44 +100,44 @@
 	
 	public void testSimple() {
 		instance1.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		fooProvider.stop();
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		fooProvider.start();
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		fooProvider.stop();
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 		instance1.stop();
 	}
 	
 	public void testVoid() {
 		instance2.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();		
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();		
 		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -152,28 +152,28 @@
 	        
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 		
 		instance2.stop();
 	}
 	
 	public void testObject() {
 		instance3.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();		
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -188,29 +188,29 @@
 	        
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 		
 		instance3.stop();
 	}
 	
 	public void testRef() {
 		instance4.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -225,29 +225,29 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 		
 		instance4.stop();
 	}
 	
 	public void testBoth() {
         instance5.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -267,29 +267,29 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
         
         instance5.stop();
     }
 	
 	public void testMap() {
         instance6.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance6.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance6.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -309,28 +309,28 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
         
         instance6.stop();
     }
 	   public void testDict() {
 	        instance7.start();
-	        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance7.getInstanceName());
+	        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
 	        assertNotNull("Check architecture availability", arch_ref);
-	        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        
-	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
 	        
-	        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance7.getInstanceName());
+	        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
 	        assertNotNull("Check CheckService availability", cs_ref);
-	        CheckService cs = (CheckService) context.getService(cs_ref);
+	        CheckService cs = (CheckService) getContext().getService(cs_ref);
 	        Properties props = cs.getProps();
 	        //Check properties
 	        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -350,13 +350,13 @@
 	        
 	        fooProvider.stop();
 	        
-	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 	        
 	        id = null;
 	        cs = null;
-	        context.ungetService(arch_ref);
-	        context.ungetService(cs_ref);
+	        getContext().ungetService(arch_ref);
+	        getContext().ungetService(cs_ref);
 	        
 	        instance7.stop();
 	    }
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java
index 3db7ccc..175205a 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java
@@ -42,29 +42,29 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider");
-			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider1.stop();
 		
 			Properties prov2 = new Properties();
 			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
 			fooProvider2.stop();
 		
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "SimpleCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "SimpleCheckServiceProvider").createComponentInstance(i1);
 		
 			Properties i2 = new Properties();
 			i2.put("instance.name","Optional");
-			instance2 = Utils.getFactoryByName(context, "SimpleOptionalCheckServiceProvider").createComponentInstance(i2);
+			instance2 = Utils.getFactoryByName(getContext(), "SimpleOptionalCheckServiceProvider").createComponentInstance(i2);
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Multiple");
-			instance3 = Utils.getFactoryByName(context, "SimpleMultipleCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "SimpleMultipleCheckServiceProvider").createComponentInstance(i3);
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","OptionalMultiple");
-			instance4 = Utils.getFactoryByName(context, "SimpleOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "SimpleOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
 		} catch(Exception e) {
 			throw new RuntimeException(e.getMessage());
 		}
@@ -106,9 +106,9 @@
 	}
 	
 	public void testSimpleDependency() {
-		ServiceReference arch_dep = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_dep);
-		InstanceDescription id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
 		
 		// Check dependency handler invalidity
@@ -124,26 +124,26 @@
 		
 		fooProvider1.start();
 		
-		ServiceReference arch_ps = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
+		ServiceReference arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps);
-		InstanceDescription id_ps = ((Architecture) context.getService(arch_ps)).getInstanceDescription();
+		InstanceDescription id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);				
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler validity", dhd.isValid());
 		assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps = ((Architecture) context.getService(arch_ps)).getInstanceDescription();
+		id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
 		ProvidedServiceHandlerDescription psh = getPSDesc(id_ps);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertEquals("Check POJO creation", id_ps.getCreatedObjects().length, 1);
@@ -151,18 +151,18 @@
 		
 		fooProvider1.stop();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
 		dhd = getDependencyDesc(id_dep);
 		assertFalse("Check dependency handler invalidity", dhd.isValid());
 		
 		fooProvider1.start();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		arch_ps = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
+		arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps);
-		id_ps = ((Architecture) context.getService(arch_ps)).getInstanceDescription();
+		id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);
 		psh = getPSDesc(id_ps);
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
@@ -170,36 +170,36 @@
 		
 		assertEquals("Check dependency ref -3", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph 
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps = ((Architecture) context.getService(arch_ps)).getInstanceDescription();
+		id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
 		psh = getPSDesc(id_ps);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertTrue("Check service reference - 1", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
 		
 		fooProvider1.stop();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
 		dhd = getDependencyDesc(id_dep);
 		assertFalse("Check dependency handler invalidity", dhd.isValid());
 		
 		id_dep = null;
 		cs = null;
-		context.ungetService(arch_dep);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_dep);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testOptionalDependency() {
-		ServiceReference arch_dep = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+		ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_dep);
-		InstanceDescription id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.VALID);
 		
 		// Check dependency handler invalidity
@@ -215,26 +215,26 @@
 		
 		fooProvider1.start();
 		
-		ServiceReference arch_ps = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
+		ServiceReference arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps);
-		InstanceDescription id_ps = ((Architecture) context.getService(arch_ps)).getInstanceDescription();
+		InstanceDescription id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);				
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler validity", dhd.isValid());
 		assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps = ((Architecture) context.getService(arch_ps)).getInstanceDescription();
+		id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
 		ProvidedServiceHandlerDescription psh = getPSDesc(id_ps);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertEquals("Check POJO creation", id_ps.getCreatedObjects().length, 1);
@@ -242,18 +242,18 @@
 		
 		fooProvider1.stop();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler invalidity", dhd.isValid());
 		
 		fooProvider1.start();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		arch_ps = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
+		arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps);
-		id_ps = ((Architecture) context.getService(arch_ps)).getInstanceDescription();
+		id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);
 		psh = getPSDesc(id_ps);
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
@@ -261,36 +261,36 @@
 		
 		assertEquals("Check dependency ref -3", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph 
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps = ((Architecture) context.getService(arch_ps)).getInstanceDescription();
+		id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
 		psh = getPSDesc(id_ps);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertTrue("Check service reference - 1", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
 		
 		fooProvider1.stop();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler invalidity", dhd.isValid());
 		
 		id_dep = null;
 		cs = null;
-		context.ungetService(arch_dep);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_dep);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testMultipleDependency() {
-		ServiceReference arch_dep = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_dep);
-		InstanceDescription id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
 		
 		// Check dependency handler invalidity
@@ -305,27 +305,27 @@
 		
 		fooProvider1.start();
 		
-		ServiceReference arch_ps1 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
+		ServiceReference arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
-		InstanceDescription id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		InstanceDescription id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id_ps1.getState() == ComponentInstance.VALID);				
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler validity", dhd.isValid());
 		assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		assertEquals("Check used ref - 1 (" + dhd.getDependencies()[0].getUsedServices().size() + ")", dhd.getDependencies()[0].getUsedServices().size(), 0);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		ProvidedServiceHandlerDescription psh = getPSDesc(id_ps1);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);
@@ -334,32 +334,32 @@
 		// Start a second foo service provider
 		fooProvider2.start();
 		
-		arch_ps1 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
-		ServiceReference arch_ps2 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider2.getInstanceName());
+		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
+		ServiceReference arch_ps2 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
 		assertNotNull("Check architecture 2 availability", arch_ps2);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
-		InstanceDescription id_ps2 = ((Architecture) context.getService(arch_ps2)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
+		InstanceDescription id_ps2 = ((Architecture) getContext().getService(arch_ps2)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);
 		assertTrue("Check instance 2 invalidity - 1", id_ps2.getState() == ComponentInstance.VALID);
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler validity", dhd.isValid());
 		assertEquals("Check dependency ref - 3 ", dhd.getDependencies()[0].getServiceReferences().size(), 2);
 		assertEquals("Check used ref - 2 ", dhd.getDependencies()[0].getUsedServices().size(), 1); // provider 2 not already used
 		
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
-		id_ps2 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
+		id_ps2 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		ProvidedServiceHandlerDescription psh1 = getPSDesc(id_ps1);
 		ProvidedServiceHandlerDescription psh2 = getPSDesc(id_ps2);
 		assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);
@@ -370,27 +370,27 @@
 		
 		fooProvider2.stop();
 		
-		arch_ps1 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
+		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id_ps1.getState() == ComponentInstance.VALID);				
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler validity", dhd.isValid());
 		assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		assertEquals("Check used ref - 4 ", dhd.getDependencies()[0].getUsedServices().size(), 1);
 		
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		psh = getPSDesc(id_ps1);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);
@@ -399,18 +399,18 @@
 		
 		fooProvider1.stop();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertFalse("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertFalse("Check dependency handler invalidity", dhd.isValid());
 		
 		fooProvider2.start();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		arch_ps1 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider2.getInstanceName());
+		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);
 		psh = getPSDesc(id_ps1);
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
@@ -419,15 +419,15 @@
 		assertEquals("Check dependency ref -3", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		assertEquals("Check used ref - 6 ", dhd.getDependencies()[0].getUsedServices().size(), 0);
 		
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph 
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		psh = getPSDesc(id_ps1);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertTrue("Check service reference - 4", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
@@ -435,21 +435,21 @@
 		
 		fooProvider2.stop();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertFalse("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertFalse("Check dependency handler invalidity", dhd.isValid());
 		
 		id_dep = null;
 		cs = null;
-		context.ungetService(arch_dep);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_dep);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testMultipleOptionalDependency() {
-		ServiceReference arch_dep = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_dep);
-		InstanceDescription id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.VALID);
 		
 		// Check dependency handler invalidity
@@ -464,26 +464,26 @@
 		
 		fooProvider1.start();
 		
-		ServiceReference arch_ps1 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
+		ServiceReference arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
-		InstanceDescription id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		InstanceDescription id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);				
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler validity", dhd.isValid());
 		assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		ProvidedServiceHandlerDescription psh = getPSDesc(id_ps1);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);
@@ -492,31 +492,31 @@
 		// Start a second foo service provider
 		fooProvider2.start();
 		
-		arch_ps1 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
-		ServiceReference arch_ps2 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider2.getInstanceName());
+		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
+		ServiceReference arch_ps2 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
 		assertNotNull("Check architecture 2 availability", arch_ps2);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
-		InstanceDescription id_ps2 = ((Architecture) context.getService(arch_ps2)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
+		InstanceDescription id_ps2 = ((Architecture) getContext().getService(arch_ps2)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);
 		assertTrue("Check instance 2 invalidity - 1", id_ps2.getState() == ComponentInstance.VALID);
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler validity", dhd.isValid());
 		assertEquals("Check dependency ref - 3 ", dhd.getDependencies()[0].getServiceReferences().size(), 2);
 		
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
-		id_ps2 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
+		id_ps2 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		ProvidedServiceHandlerDescription psh1 = getPSDesc(id_ps1);
 		ProvidedServiceHandlerDescription psh2 = getPSDesc(id_ps2);
 		assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);
@@ -526,26 +526,26 @@
 		
 		fooProvider2.stop();
 		
-		arch_ps1 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
+		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);				
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler validity", dhd.isValid());
 		assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		psh = getPSDesc(id_ps1);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);
@@ -553,18 +553,18 @@
 
 		fooProvider1.stop();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler invalidity", dhd.isValid());
 		
 		fooProvider2.start();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		arch_ps1 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider2.getInstanceName());
+		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);
 		psh = getPSDesc(id_ps1);
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
@@ -572,30 +572,30 @@
 		
 		assertEquals("Check dependency ref -3", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph 
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		psh = getPSDesc(id_ps1);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertTrue("Check service reference - 4", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
 
 		fooProvider2.stop();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler invalidity", dhd.isValid());
 		
 		id_dep = null;
 		cs = null;
-		context.ungetService(arch_dep);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_dep);
+		getContext().ungetService(cs_ref);
 	}
 	
 	
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ListMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ListMultipleDependencies.java
index 8c34214..5c0afee 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ListMultipleDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ListMultipleDependencies.java
@@ -37,21 +37,21 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider1.stop();
 		
 			Properties prov2 = new Properties();
 			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
 			fooProvider2.stop();
 		
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "SimpleListCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "SimpleListCheckServiceProvider").createComponentInstance(i1);
 			
 			Properties i2 = new Properties();
             i2.put("instance.name","Optional");
-            instance2 = Utils.getFactoryByName(context, "OptionalListCheckServiceProvider").createComponentInstance(i2);
+            instance2 = Utils.getFactoryByName(getContext(), "OptionalListCheckServiceProvider").createComponentInstance(i2);
 		} catch(Exception e) { fail(e.getMessage()); }
 		
 	}
@@ -68,19 +68,19 @@
 	}
 	
 	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -95,10 +95,10 @@
 		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
 		
 		fooProvider2.start();
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -114,10 +114,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -132,24 +132,24 @@
 		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
 		
 		fooProvider2.stop();
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testOptional() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -165,10 +165,10 @@
         
         fooProvider1.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -184,10 +184,10 @@
         
         fooProvider2.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -203,10 +203,10 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
@@ -222,10 +222,10 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
@@ -241,8 +241,8 @@
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);       
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);       
     }
 	
 }
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java
index 5997dac..f454970 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java
@@ -38,36 +38,36 @@
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "MObjectMultipleCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "MObjectMultipleCheckServiceProvider").createComponentInstance(i3);
 			instance3.stop();
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "MRefMultipleCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "MRefMultipleCheckServiceProvider").createComponentInstance(i4);
 			instance4.stop();
 			
 			Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "MBothMultipleCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "MBothMultipleCheckServiceProvider").createComponentInstance(i5);
             instance5.stop();
             
             Properties i6 = new Properties();
             i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(context, "MMapMultipleCheckServiceProvider").createComponentInstance(i6);
+            instance6 = Utils.getFactoryByName(getContext(), "MMapMultipleCheckServiceProvider").createComponentInstance(i6);
             instance6.stop();
             
             Properties i7 = new Properties();
             i7.put("instance.name","Dict");
-            instance7 = Utils.getFactoryByName(context, "MDictMultipleCheckServiceProvider").createComponentInstance(i7);
+            instance7 = Utils.getFactoryByName(getContext(), "MDictMultipleCheckServiceProvider").createComponentInstance(i7);
             instance7.stop();
 		
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 		
 			Properties prov2 = new Properties();
 			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
 		} catch(Exception e) { fail(e.getMessage()); }
 	}
 	
@@ -91,17 +91,17 @@
 	public void testObject() {
 		instance3.start();
 		
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -117,10 +117,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -136,26 +136,26 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 		instance3.stop();
 	}
 	
 	public void testRef() {
 		instance4.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -171,10 +171,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -190,26 +190,26 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
+		getContext().ungetService(arch_ref);
 		instance4.stop();
-		context.ungetService(cs_ref);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testBoth() {
         instance5.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -229,10 +229,10 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -252,26 +252,26 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
+        getContext().ungetService(arch_ref);
         instance5.stop();
-        context.ungetService(cs_ref);
+        getContext().ungetService(cs_ref);
     }
 	
 	public void testMap() {
         instance6.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance6.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance6.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -291,10 +291,10 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -314,26 +314,26 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
+        getContext().ungetService(arch_ref);
         instance6.stop();
-        context.ungetService(cs_ref);
+        getContext().ungetService(cs_ref);
     }
 	
 	public void testDict() {
         instance7.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance7.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance7.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -353,10 +353,10 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -376,14 +376,14 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
+        getContext().ungetService(arch_ref);
         instance7.stop();
-        context.ungetService(cs_ref);
+        getContext().ungetService(cs_ref);
     }
 
 	
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalDependencies.java
index a071c88..e897558 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalDependencies.java
@@ -38,31 +38,31 @@
         try {
             Properties prov = new Properties();
             prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 
             Properties i3 = new Properties();
             i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(context, "MObjectOptionalCheckServiceProvider").createComponentInstance(i3);
+            instance3 = Utils.getFactoryByName(getContext(), "MObjectOptionalCheckServiceProvider").createComponentInstance(i3);
             instance3.stop();
 
             Properties i4 = new Properties();
             i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(context, "MRefOptionalCheckServiceProvider").createComponentInstance(i4);
+            instance4 = Utils.getFactoryByName(getContext(), "MRefOptionalCheckServiceProvider").createComponentInstance(i4);
             instance4.stop();
 
             Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "MBothOptionalCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "MBothOptionalCheckServiceProvider").createComponentInstance(i5);
             instance5.stop();
             
             Properties i6 = new Properties();
             i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(context, "MMapOptionalCheckServiceProvider").createComponentInstance(i6);
+            instance6 = Utils.getFactoryByName(getContext(), "MMapOptionalCheckServiceProvider").createComponentInstance(i6);
             instance6.stop();
             
             Properties i7 = new Properties();
             i7.put("instance.name","Dict");
-            instance7 = Utils.getFactoryByName(context, "MDictOptionalCheckServiceProvider").createComponentInstance(i7);
+            instance7 = Utils.getFactoryByName(getContext(), "MDictOptionalCheckServiceProvider").createComponentInstance(i7);
             instance7.stop();
         } catch (Exception e) {
             fail(e.getMessage());
@@ -87,14 +87,14 @@
 
     public void testObject() {
         instance3.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -111,11 +111,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -130,8 +130,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance3.stop();
     }
@@ -139,14 +139,14 @@
     public void testRef() {
         instance4.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -161,11 +161,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -180,8 +180,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance4.stop();
     }
@@ -189,14 +189,14 @@
     public void testBoth() {
         instance5.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -215,11 +215,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -238,8 +238,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance5.stop();
     }
@@ -247,14 +247,14 @@
     public void testMap() {
         instance6.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance6.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance6.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -273,11 +273,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -296,8 +296,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance6.stop();
     }
@@ -305,14 +305,14 @@
     public void testDict() {
         instance7.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance7.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance7.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -331,11 +331,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -354,8 +354,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance7.stop();
     }
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalMultipleDependencies.java
index 36ef22d..96e5f37 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalMultipleDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalMultipleDependencies.java
@@ -38,21 +38,21 @@
 		try {
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "MObjectOptionalMultipleCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "MObjectOptionalMultipleCheckServiceProvider").createComponentInstance(i3);
 			instance3.stop();
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "MRefOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "MRefOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
 			instance4.stop();
 		
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 		
 			Properties prov2 = new Properties();
 			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
 		} catch(Exception e) { fail(e.getMessage()); }		
 	}
 	
@@ -69,14 +69,14 @@
 	
 	public void testObject() {
 		instance3.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue());
@@ -92,10 +92,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue());
@@ -111,10 +111,10 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -130,21 +130,21 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 		instance3.stop();
 	}
 	
 	public void testRef() {
 		instance4.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue());
@@ -160,10 +160,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue());
@@ -179,10 +179,10 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -198,8 +198,8 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 		instance4.stop();
 	}
 
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedSimpleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedSimpleDependencies.java
index 9a3829c..b0e6f68 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedSimpleDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedSimpleDependencies.java
@@ -38,31 +38,31 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "MObjectCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "MObjectCheckServiceProvider").createComponentInstance(i3);
 			instance3.stop();
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "MRefCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "MRefCheckServiceProvider").createComponentInstance(i4);
 			instance4.stop();
 			
 			Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "MBothCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "MBothCheckServiceProvider").createComponentInstance(i5);
             instance5.stop();
             
             Properties i6 = new Properties();
             i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(context, "MMapCheckServiceProvider").createComponentInstance(i6);
+            instance6 = Utils.getFactoryByName(getContext(), "MMapCheckServiceProvider").createComponentInstance(i6);
             instance6.stop();
             
             Properties i7 = new Properties();
             i7.put("instance.name","Dictionary");
-            instance7 = Utils.getFactoryByName(context, "MDictCheckServiceProvider").createComponentInstance(i7);
+            instance7 = Utils.getFactoryByName(getContext(), "MDictCheckServiceProvider").createComponentInstance(i7);
             instance7.stop();
 		} catch(Exception e) { fail(e.getMessage()); } 
 		
@@ -85,15 +85,15 @@
 	
 	public void testObject() {
 		instance3.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();		
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -108,29 +108,29 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 		
 		instance3.stop();
 	}
 	
 	public void testRef() {
 		instance4.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -145,29 +145,29 @@
 	        
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 		
 		instance4.stop();
 	}
 	
 	public void testBoth() {
         instance5.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -182,29 +182,29 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
         
         instance5.stop();
     }
 	
 	public void testMap() {
 	        instance6.start();
-	        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance6.getInstanceName());
+	        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
 	        assertNotNull("Check architecture availability", arch_ref);
-	        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        
-	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
 	        
-	        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance6.getInstanceName());
+	        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
 	        assertNotNull("Check CheckService availability", cs_ref);
-	        CheckService cs = (CheckService) context.getService(cs_ref);
+	        CheckService cs = (CheckService) getContext().getService(cs_ref);
 	        Properties props = cs.getProps();
 	        //Check properties
 	        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -223,29 +223,29 @@
 	        
 	        fooProvider.stop();
 	        
-	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 	        
 	        id = null;
 	        cs = null;
-	        context.ungetService(arch_ref);
-	        context.ungetService(cs_ref);
+	        getContext().ungetService(arch_ref);
+	        getContext().ungetService(cs_ref);
 	        
 	        instance6.stop();
 	}
 	
 	public void testDict() {
         instance7.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance7.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance7.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -264,13 +264,13 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
         
         instance7.stop();
 }
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodMultipleDependencies.java
index 93aaef5..b2aa4e5 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodMultipleDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodMultipleDependencies.java
@@ -37,33 +37,33 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider1.stop();
 		
 			Properties prov2 = new Properties();
 			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
 			fooProvider2.stop();
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "MObjectMultipleCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "MObjectMultipleCheckServiceProvider").createComponentInstance(i3);
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "MRefMultipleCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "MRefMultipleCheckServiceProvider").createComponentInstance(i4);
 			
 			Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "MBothMultipleCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "MBothMultipleCheckServiceProvider").createComponentInstance(i5);
             
             Properties i6 = new Properties();
             i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(context, "MMapMultipleCheckServiceProvider").createComponentInstance(i6);
+            instance6 = Utils.getFactoryByName(getContext(), "MMapMultipleCheckServiceProvider").createComponentInstance(i6);
             
             Properties i7 = new Properties();
             i7.put("instance.name","Dictionary");
-            instance7 = Utils.getFactoryByName(context, "MDictMultipleCheckServiceProvider").createComponentInstance(i7);
+            instance7 = Utils.getFactoryByName(getContext(), "MDictMultipleCheckServiceProvider").createComponentInstance(i7);
 		} catch(Exception e) { fail(e.getMessage()); }
 		
 	}
@@ -86,19 +86,19 @@
 	}
 	
 	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -114,10 +114,10 @@
 		
 		fooProvider2.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -133,10 +133,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -152,29 +152,29 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -190,10 +190,10 @@
 		
 		fooProvider2.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -209,10 +209,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -228,29 +228,29 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         fooProvider1.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -270,10 +270,10 @@
         
         fooProvider2.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -293,10 +293,10 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -316,29 +316,29 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 	
 	   public void testMap() {
-	        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance6.getInstanceName());
+	        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
 	        assertNotNull("Check architecture availability", arch_ref);
-	        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 	        
 	        fooProvider1.start();
 	        
-	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 	        
-	        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance6.getInstanceName());
+	        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
 	        assertNotNull("Check CheckService availability", cs_ref);
-	        CheckService cs = (CheckService) context.getService(cs_ref);
+	        CheckService cs = (CheckService) getContext().getService(cs_ref);
 	        Properties props = cs.getProps();
 	        //Check properties
 	        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -358,10 +358,10 @@
 	        
 	        fooProvider2.start();
 	        
-	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 	        
-	        cs = (CheckService) context.getService(cs_ref);
+	        cs = (CheckService) getContext().getService(cs_ref);
 	        props = cs.getProps();
 	        //Check properties
 	        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -381,10 +381,10 @@
 	        
 	        fooProvider1.stop();
 	        
-	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
 	        
-	        cs = (CheckService) context.getService(cs_ref);
+	        cs = (CheckService) getContext().getService(cs_ref);
 	        props = cs.getProps();
 	        //Check properties
 	        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -404,29 +404,29 @@
 	        
 	        fooProvider2.stop();
 	        
-	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 	        
 	        id = null;
 	        cs = null;
-	        context.ungetService(arch_ref);
-	        context.ungetService(cs_ref);
+	        getContext().ungetService(arch_ref);
+	        getContext().ungetService(cs_ref);
 	    }
 	   
        public void testDict() {
-           ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance7.getInstanceName());
+           ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
            assertNotNull("Check architecture availability", arch_ref);
-           InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+           InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
            assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
            
            fooProvider1.start();
            
-           id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+           id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
            assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
            
-           ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance7.getInstanceName());
+           ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
            assertNotNull("Check CheckService availability", cs_ref);
-           CheckService cs = (CheckService) context.getService(cs_ref);
+           CheckService cs = (CheckService) getContext().getService(cs_ref);
            Properties props = cs.getProps();
            //Check properties
            assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -446,10 +446,10 @@
            
            fooProvider2.start();
            
-           id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+           id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
            assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
            
-           cs = (CheckService) context.getService(cs_ref);
+           cs = (CheckService) getContext().getService(cs_ref);
            props = cs.getProps();
            //Check properties
            assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -469,10 +469,10 @@
            
            fooProvider1.stop();
            
-           id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+           id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
            assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
            
-           cs = (CheckService) context.getService(cs_ref);
+           cs = (CheckService) getContext().getService(cs_ref);
            props = cs.getProps();
            //Check properties
            assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -492,13 +492,13 @@
            
            fooProvider2.stop();
            
-           id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+           id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
            assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
            
            id = null;
            cs = null;
-           context.ungetService(arch_ref);
-           context.ungetService(cs_ref);
+           getContext().ungetService(arch_ref);
+           getContext().ungetService(cs_ref);
        }
 
 	
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalDependencies.java
index 5bc6f10..8118bf5 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalDependencies.java
@@ -38,28 +38,28 @@
         try {
             Properties prov = new Properties();
             prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
             fooProvider.stop();
 
             Properties i3 = new Properties();
             i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(context, "MObjectOptionalCheckServiceProvider").createComponentInstance(i3);
+            instance3 = Utils.getFactoryByName(getContext(), "MObjectOptionalCheckServiceProvider").createComponentInstance(i3);
 
             Properties i4 = new Properties();
             i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(context, "MRefOptionalCheckServiceProvider").createComponentInstance(i4);
+            instance4 = Utils.getFactoryByName(getContext(), "MRefOptionalCheckServiceProvider").createComponentInstance(i4);
 
             Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "MBothOptionalCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "MBothOptionalCheckServiceProvider").createComponentInstance(i5);
             
             Properties i6 = new Properties();
             i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(context, "MMapOptionalCheckServiceProvider").createComponentInstance(i6);
+            instance6 = Utils.getFactoryByName(getContext(), "MMapOptionalCheckServiceProvider").createComponentInstance(i6);
             
             Properties i7 = new Properties();
             i7.put("instance.name","Dictionary");
-            instance7 = Utils.getFactoryByName(context, "MDictOptionalCheckServiceProvider").createComponentInstance(i7);
+            instance7 = Utils.getFactoryByName(getContext(), "MDictOptionalCheckServiceProvider").createComponentInstance(i7);
         } catch (Exception e) {
             fail(e.getMessage());
         }
@@ -82,14 +82,14 @@
 
     public void testObject() {
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
 
         Properties props = cs.getProps();
 
@@ -106,11 +106,11 @@
 
         fooProvider.start();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -125,10 +125,10 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
@@ -143,19 +143,19 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 
     public void testRef() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
@@ -170,11 +170,11 @@
 
         fooProvider.start();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -189,10 +189,10 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
@@ -207,19 +207,19 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
     
     public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
@@ -234,11 +234,11 @@
 
         fooProvider.start();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -253,10 +253,10 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
@@ -271,19 +271,19 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
     
     public void testMap() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance6.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance6.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
@@ -302,11 +302,11 @@
 
         fooProvider.start();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -325,10 +325,10 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
@@ -347,19 +347,19 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
     
     public void testDict() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance7.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance7.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
@@ -378,11 +378,11 @@
 
         fooProvider.start();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -401,10 +401,10 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
@@ -423,8 +423,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 
 }
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalMultipleDependencies.java
index 10c246e..a1312f2 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalMultipleDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalMultipleDependencies.java
@@ -37,21 +37,21 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider1.stop();
 		
 			Properties prov2 = new Properties();
 			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
 			fooProvider2.stop();
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "MObjectOptionalMultipleCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "MObjectOptionalMultipleCheckServiceProvider").createComponentInstance(i3);
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "MRefOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "MRefOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
 			
 		} catch(Exception e) { fail(e.getMessage()); }
 		
@@ -69,14 +69,14 @@
 	}
 	
 	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -92,10 +92,10 @@
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -111,10 +111,10 @@
 		
 		fooProvider2.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -130,10 +130,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -149,10 +149,10 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -168,19 +168,19 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -196,10 +196,10 @@
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -215,10 +215,10 @@
 		
 		fooProvider2.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -234,10 +234,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -253,10 +253,10 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -272,8 +272,8 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 	}
 
 	
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodSimpleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodSimpleDependencies.java
index 37dcefc..238a63d 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodSimpleDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodSimpleDependencies.java
@@ -37,31 +37,31 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider.stop();
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "MObjectCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "MObjectCheckServiceProvider").createComponentInstance(i3);
             assertNotNull("check instance 3", instance3);
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "MRefCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "MRefCheckServiceProvider").createComponentInstance(i4);
             assertNotNull("check instance 4", instance4);
             
             Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "MBothCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "MBothCheckServiceProvider").createComponentInstance(i5);
             assertNotNull("check instance 5", instance5);
             
             Properties i6 = new Properties();
             i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(context, "MMapCheckServiceProvider").createComponentInstance(i6);
+            instance6 = Utils.getFactoryByName(getContext(), "MMapCheckServiceProvider").createComponentInstance(i6);
             
             Properties i7 = new Properties();
             i7.put("instance.name","Dictionary");
-            instance7 = Utils.getFactoryByName(context, "MDictCheckServiceProvider").createComponentInstance(i7);
+            instance7 = Utils.getFactoryByName(getContext(), "MDictCheckServiceProvider").createComponentInstance(i7);
 		} catch(Exception e) { fail(e.getMessage()); }
 		
 	}
@@ -83,19 +83,19 @@
 
 	
 	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -110,29 +110,29 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -147,29 +147,29 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -184,29 +184,29 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 	
 	public void testMap() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance6.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance6.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -225,29 +225,29 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 	
 	public void testDict() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance7.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance7.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -266,13 +266,13 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 
 
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MultipleDependencies.java
index f749e4f..837afc0 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MultipleDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MultipleDependencies.java
@@ -37,29 +37,29 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider1.stop();
 		
 			Properties prov2 = new Properties();
 			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
 			fooProvider2.stop();
 		
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "SimpleMultipleCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "SimpleMultipleCheckServiceProvider").createComponentInstance(i1);
 		
 			Properties i2 = new Properties();
 			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(context, "VoidMultipleCheckServiceProvider").createComponentInstance(i2);
+			instance2 = Utils.getFactoryByName(getContext(), "VoidMultipleCheckServiceProvider").createComponentInstance(i2);
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "ObjectMultipleCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "ObjectMultipleCheckServiceProvider").createComponentInstance(i3);
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "RefMultipleCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "RefMultipleCheckServiceProvider").createComponentInstance(i4);
 		} catch(Exception e) { fail(e.getMessage()); }
 		
 	}
@@ -80,19 +80,19 @@
 	}
 	
 	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -107,10 +107,10 @@
 		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
 		
 		fooProvider2.start();
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -126,10 +126,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -144,29 +144,29 @@
 		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
 		
 		fooProvider2.stop();
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testVoid() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -182,10 +182,10 @@
 		
 		fooProvider2.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -201,10 +201,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -220,29 +220,29 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);	
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);	
 	}
 	
 	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -258,10 +258,10 @@
 		
 		fooProvider2.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -277,10 +277,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -296,29 +296,29 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -334,10 +334,10 @@
 		
 		fooProvider2.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -353,10 +353,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -372,13 +372,13 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 	}
 
 	
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalDependencies.java
index 7515e5e..61450be 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalDependencies.java
@@ -38,36 +38,36 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider.stop();
 			
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "SimpleOptionalCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "SimpleOptionalCheckServiceProvider").createComponentInstance(i1);
 		
 			Properties i2 = new Properties();
 			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(context, "VoidOptionalCheckServiceProvider").createComponentInstance(i2);
+			instance2 = Utils.getFactoryByName(getContext(), "VoidOptionalCheckServiceProvider").createComponentInstance(i2);
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "ObjectOptionalCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "ObjectOptionalCheckServiceProvider").createComponentInstance(i3);
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "RefOptionalCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "RefOptionalCheckServiceProvider").createComponentInstance(i4);
 			
 			Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "BothOptionalCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "BothOptionalCheckServiceProvider").createComponentInstance(i5);
             
             Properties i6 = new Properties();
             i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(context, "MapOptionalCheckServiceProvider").createComponentInstance(i6);
+            instance6 = Utils.getFactoryByName(getContext(), "MapOptionalCheckServiceProvider").createComponentInstance(i6);
             
             Properties i7 = new Properties();
             i7.put("instance.name","Dictionary");
-            instance7 = Utils.getFactoryByName(context, "DictOptionalCheckServiceProvider").createComponentInstance(i7);
+            instance7 = Utils.getFactoryByName(getContext(), "DictOptionalCheckServiceProvider").createComponentInstance(i7);
 		} catch(Exception e) { fail(e.getMessage()); }		
 	}
 	
@@ -91,14 +91,14 @@
 	}
 	
 	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		
 		//Check properties
@@ -116,11 +116,11 @@
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		
 		//Check properties
@@ -138,24 +138,24 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void testVoid() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
@@ -172,11 +172,11 @@
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -193,10 +193,10 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
@@ -213,19 +213,19 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);	
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);	
 	}
 	
 	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
@@ -238,11 +238,11 @@
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -255,10 +255,10 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue()); // Nullable object.
@@ -271,19 +271,19 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
@@ -296,11 +296,11 @@
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -313,10 +313,10 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
@@ -329,19 +329,19 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
@@ -354,11 +354,11 @@
         
         fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -373,10 +373,10 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
@@ -391,19 +391,19 @@
   
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 	
 	public void testMap() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance6.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance6.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
@@ -420,11 +420,11 @@
         
         fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -443,10 +443,10 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
@@ -465,19 +465,19 @@
   
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 	
 	   public void testDict() {
-	        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance7.getInstanceName());
+	        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
 	        assertNotNull("Check architecture availability", arch_ref);
-	        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 	        
-	        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance7.getInstanceName());
+	        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
 	        assertNotNull("Check CheckService availability", cs_ref);
-	        CheckService cs = (CheckService) context.getService(cs_ref);
+	        CheckService cs = (CheckService) getContext().getService(cs_ref);
 	        Properties props = cs.getProps();
 	        //Check properties
 	        assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
@@ -494,11 +494,11 @@
 	        
 	        fooProvider.start();
 	        
-	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 	        
 	        assertNotNull("Check CheckService availability", cs_ref);
-	        cs = (CheckService) context.getService(cs_ref);
+	        cs = (CheckService) getContext().getService(cs_ref);
 	        props = cs.getProps();
 	        //Check properties
 	        assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -517,10 +517,10 @@
 	        
 	        fooProvider.stop();
 	        
-	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 	        
-	        cs = (CheckService) context.getService(cs_ref);
+	        cs = (CheckService) getContext().getService(cs_ref);
 	        props = cs.getProps();
 	        //Check properties
 	        assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
@@ -539,8 +539,8 @@
 	  
 	        id = null;
 	        cs = null;
-	        context.ungetService(arch_ref);
-	        context.ungetService(cs_ref);
+	        getContext().ungetService(arch_ref);
+	        getContext().ungetService(cs_ref);
 	    }
 
 
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalMultipleDependencies.java
index 077546f..7c1f0da 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalMultipleDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalMultipleDependencies.java
@@ -38,29 +38,29 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider1.stop();
 		
 			Properties prov2 = new Properties();
 			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
 			fooProvider2.stop();
 		
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "SimpleOptionalMultipleCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "SimpleOptionalMultipleCheckServiceProvider").createComponentInstance(i1);
 		
 			Properties i2 = new Properties();
 			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(context, "VoidOptionalMultipleCheckServiceProvider").createComponentInstance(i2);
+			instance2 = Utils.getFactoryByName(getContext(), "VoidOptionalMultipleCheckServiceProvider").createComponentInstance(i2);
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "ObjectOptionalMultipleCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "ObjectOptionalMultipleCheckServiceProvider").createComponentInstance(i3);
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "RefOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "RefOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
 		} catch(Exception e) { fail(e.getMessage()); }
 		
 	}
@@ -81,14 +81,14 @@
 	}
 	
 	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -104,10 +104,10 @@
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -123,10 +123,10 @@
 		
 		fooProvider2.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -142,10 +142,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
@@ -161,10 +161,10 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
@@ -180,19 +180,19 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void testVoid() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -208,10 +208,10 @@
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -227,10 +227,10 @@
 		
 		fooProvider2.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -246,10 +246,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -265,10 +265,10 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -284,19 +284,19 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);	
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);	
 	}
 	
 	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -312,10 +312,10 @@
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -331,10 +331,10 @@
 		
 		fooProvider2.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -350,10 +350,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -369,10 +369,10 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -388,19 +388,19 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -416,10 +416,10 @@
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -435,10 +435,10 @@
 		
 		fooProvider2.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -454,10 +454,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -473,10 +473,10 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -492,8 +492,8 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 	}
 
 	
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalNoNullableDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalNoNullableDependencies.java
index e4e3c31a..0326527 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalNoNullableDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalNoNullableDependencies.java
@@ -38,36 +38,36 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider.stop();
 			
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "SimpleOptionalNoNullableCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "SimpleOptionalNoNullableCheckServiceProvider").createComponentInstance(i1);
 		
 			Properties i2 = new Properties();
 			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(context, "VoidOptionalNoNullableCheckServiceProvider").createComponentInstance(i2);
+			instance2 = Utils.getFactoryByName(getContext(), "VoidOptionalNoNullableCheckServiceProvider").createComponentInstance(i2);
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "ObjectOptionalNoNullableCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "ObjectOptionalNoNullableCheckServiceProvider").createComponentInstance(i3);
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "RefOptionalNoNullableCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "RefOptionalNoNullableCheckServiceProvider").createComponentInstance(i4);
 			
 			Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "BothOptionalNoNullableCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "BothOptionalNoNullableCheckServiceProvider").createComponentInstance(i5);
             
             Properties i6 = new Properties();
             i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(context, "MapOptionalNoNullableCheckServiceProvider").createComponentInstance(i6);
+            instance6 = Utils.getFactoryByName(getContext(), "MapOptionalNoNullableCheckServiceProvider").createComponentInstance(i6);
             
             Properties i7 = new Properties();
             i7.put("instance.name","Dictionary");
-            instance7 = Utils.getFactoryByName(context, "DictOptionalNoNullableCheckServiceProvider").createComponentInstance(i7);
+            instance7 = Utils.getFactoryByName(getContext(), "DictOptionalNoNullableCheckServiceProvider").createComponentInstance(i7);
 		} catch(Exception e) { 
 		    e.getMessage();
 		    fail(e.getMessage()); 
@@ -94,14 +94,14 @@
 	}
 	
 	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		
 		//Check properties
@@ -116,11 +116,11 @@
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		
 		//Check properties
@@ -138,24 +138,24 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void testVoid() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertNull("check CheckService invocation - 1", props.get("result")); // Null, no provider
@@ -169,11 +169,11 @@
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -190,10 +190,10 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertNull("check CheckService invocation -3", props.get("result"));
@@ -207,19 +207,19 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);	
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);	
 	}
 	
 	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertNull("check CheckService invocation -1", props.get("result")); // Null, no provider
@@ -232,11 +232,11 @@
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -249,10 +249,10 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertNull("check CheckService invocation -3", props.get("result")); // No provider.
@@ -265,19 +265,19 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertNull("check CheckService invocation -1", props.get("result")); //Null, no provider
@@ -290,11 +290,11 @@
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -307,10 +307,10 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertNull("check CheckService invocation -3", props.get("result")); // Null, no provider
@@ -323,19 +323,19 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertNull("check CheckService invocation -1", props.get("result")); // Null, no provider
@@ -348,11 +348,11 @@
         
         fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -367,10 +367,10 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertNull("check CheckService invocation -3", props.get("result")); // Null, no provider
@@ -385,19 +385,19 @@
   
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 	
 	public void testDict() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance7.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance7.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertNull("check CheckService invocation -1", props.get("result")); // Null, no provider
@@ -414,11 +414,11 @@
         
         fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -437,10 +437,10 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertNull("check CheckService invocation -3", props.get("result")); // Null, no provider
@@ -459,19 +459,19 @@
   
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 
     public void testMap() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance6.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance6.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertNull("check CheckService invocation -1", props.get("result")); // Null, no provider
@@ -488,11 +488,11 @@
         
         fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -511,10 +511,10 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertNull("check CheckService invocation -3", props.get("result")); // Null, no provider
@@ -533,8 +533,8 @@
     
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 
 
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SetMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SetMultipleDependencies.java
index db097d4..9ec946d 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SetMultipleDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SetMultipleDependencies.java
@@ -37,21 +37,21 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider1.stop();
 		
 			Properties prov2 = new Properties();
 			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
 			fooProvider2.stop();
 		
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "SimpleSetCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "SimpleSetCheckServiceProvider").createComponentInstance(i1);
 			
 			Properties i2 = new Properties();
             i2.put("instance.name","Optional");
-            instance2 = Utils.getFactoryByName(context, "OptionalSetCheckServiceProvider").createComponentInstance(i2);
+            instance2 = Utils.getFactoryByName(getContext(), "OptionalSetCheckServiceProvider").createComponentInstance(i2);
 		} catch(Exception e) { fail(e.getMessage()); }
 		
 	}
@@ -68,19 +68,19 @@
 	}
 	
 	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -95,10 +95,10 @@
 		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
 		
 		fooProvider2.start();
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -114,10 +114,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -132,24 +132,24 @@
 		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
 		
 		fooProvider2.stop();
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testOptional() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -165,10 +165,10 @@
         
         fooProvider1.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -184,10 +184,10 @@
         
         fooProvider2.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -203,10 +203,10 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
@@ -222,10 +222,10 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
@@ -241,8 +241,8 @@
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);       
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);       
     }
 	
 }
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SimpleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SimpleDependencies.java
index aa26400..8c03ab2 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SimpleDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SimpleDependencies.java
@@ -38,40 +38,40 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider.stop();
 		
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "SimpleCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "SimpleCheckServiceProvider").createComponentInstance(i1);
 		
 			Properties i2 = new Properties();
 			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(context, "VoidCheckServiceProvider").createComponentInstance(i2);
+			instance2 = Utils.getFactoryByName(getContext(), "VoidCheckServiceProvider").createComponentInstance(i2);
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "ObjectCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "ObjectCheckServiceProvider").createComponentInstance(i3);
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "RefCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "RefCheckServiceProvider").createComponentInstance(i4);
 			
 			Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "BothCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "BothCheckServiceProvider").createComponentInstance(i5);
             
             Properties i6 = new Properties();
             i6.put("instance.name","Double");
-            instance6 = Utils.getFactoryByName(context, "DoubleCheckServiceProvider").createComponentInstance(i6);
+            instance6 = Utils.getFactoryByName(getContext(), "DoubleCheckServiceProvider").createComponentInstance(i6);
             
             Properties i7 = new Properties();
             i7.put("instance.name","Map");
-            instance7 = Utils.getFactoryByName(context, "MapCheckServiceProvider").createComponentInstance(i7);
+            instance7 = Utils.getFactoryByName(getContext(), "MapCheckServiceProvider").createComponentInstance(i7);
             
             Properties i8 = new Properties();
             i8.put("instance.name","Dictionary");
-            instance8 = Utils.getFactoryByName(context, "DictCheckServiceProvider").createComponentInstance(i8);
+            instance8 = Utils.getFactoryByName(getContext(), "DictCheckServiceProvider").createComponentInstance(i8);
 		} catch(Exception e) { 
 		    e.printStackTrace();
 		    fail(e.getMessage()); }
@@ -100,61 +100,61 @@
 	}
 	
 	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void testVoid() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		Object o = context.getService(cs_ref);
+		Object o = getContext().getService(cs_ref);
 		CheckService cs = (CheckService) o;
 		Properties props = cs.getProps();
 		//Check properties
@@ -170,29 +170,29 @@
         
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -207,29 +207,29 @@
         
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -244,29 +244,29 @@
         
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -281,29 +281,29 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 	
 	public void testDouble() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance6.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance6.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         assertNotNull("Check cs", cs);
         cs.check();
         Properties props = cs.getProps();
@@ -320,29 +320,29 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);       
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);       
     }
 	
 	public void testMap() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance7.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
         
         fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance7.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -361,29 +361,29 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 	
 	   public void testDict() {
-	        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance8.getInstanceName());
+	        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance8.getInstanceName());
 	        assertNotNull("Check architecture availability", arch_ref);
-	        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 	        
 	        fooProvider.start();
 	        
-	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
 	        
-	        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance8.getInstanceName());
+	        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance8.getInstanceName());
 	        assertNotNull("Check CheckService availability", cs_ref);
-	        CheckService cs = (CheckService) context.getService(cs_ref);
+	        CheckService cs = (CheckService) getContext().getService(cs_ref);
 	        Properties props = cs.getProps();
 	        //Check properties
 	        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
@@ -402,13 +402,13 @@
 	        
 	        fooProvider.stop();
 	        
-	        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 	        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
 	        
 	        id = null;
 	        cs = null;
-	        context.ungetService(arch_ref);
-	        context.ungetService(cs_ref);
+	        getContext().ungetService(arch_ref);
+	        getContext().ungetService(cs_ref);
 	    }
 
 }
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/VectorMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/VectorMultipleDependencies.java
index 77f7329..9397917 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/VectorMultipleDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/VectorMultipleDependencies.java
@@ -37,21 +37,21 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider1.stop();
 		
 			Properties prov2 = new Properties();
 			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
 			fooProvider2.stop();
 		
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "SimpleVectorCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "SimpleVectorCheckServiceProvider").createComponentInstance(i1);
 			
 			Properties i2 = new Properties();
             i2.put("instance.name","Optional");
-            instance2 = Utils.getFactoryByName(context, "OptionalVectorCheckServiceProvider").createComponentInstance(i2);
+            instance2 = Utils.getFactoryByName(getContext(), "OptionalVectorCheckServiceProvider").createComponentInstance(i2);
 		} catch(Exception e) { fail(e.getMessage()); }
 		
 	}
@@ -68,19 +68,19 @@
 	}
 	
 	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -95,10 +95,10 @@
 		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
 		
 		fooProvider2.start();
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -114,10 +114,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -132,24 +132,24 @@
 		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
 		
 		fooProvider2.stop();
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testOptional() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -165,10 +165,10 @@
         
         fooProvider1.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -184,10 +184,10 @@
         
         fooProvider2.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -203,10 +203,10 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
@@ -222,10 +222,10 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
@@ -241,8 +241,8 @@
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);       
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);       
     }
 	
 }
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/DelayedOptionalDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/DelayedOptionalDependencies.java
index 611225b..3bcd003 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/DelayedOptionalDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/DelayedOptionalDependencies.java
@@ -39,31 +39,31 @@
         try {
             Properties prov = new Properties();
             prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 
             Properties i1 = new Properties();
             i1.put("instance.name","Simple");
-            instance1 = Utils.getFactoryByName(context, "DISimpleOptionalCheckServiceProvider").createComponentInstance(i1);
+            instance1 = Utils.getFactoryByName(getContext(), "DISimpleOptionalCheckServiceProvider").createComponentInstance(i1);
             instance1.stop();
 
             Properties i2 = new Properties();
             i2.put("instance.name","Void");
-            instance2 = Utils.getFactoryByName(context, "DIVoidOptionalCheckServiceProvider").createComponentInstance(i2);
+            instance2 = Utils.getFactoryByName(getContext(), "DIVoidOptionalCheckServiceProvider").createComponentInstance(i2);
             instance2.stop();
 
             Properties i3 = new Properties();
             i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(context, "DIObjectOptionalCheckServiceProvider").createComponentInstance(i3);
+            instance3 = Utils.getFactoryByName(getContext(), "DIObjectOptionalCheckServiceProvider").createComponentInstance(i3);
             instance3.stop();
 
             Properties i4 = new Properties();
             i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(context, "DIRefOptionalCheckServiceProvider").createComponentInstance(i4);
+            instance4 = Utils.getFactoryByName(getContext(), "DIRefOptionalCheckServiceProvider").createComponentInstance(i4);
             instance4.stop();
 
             Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "DIBothOptionalCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "DIBothOptionalCheckServiceProvider").createComponentInstance(i5);
             instance5.stop();
         } catch (Exception e) {
             fail(e.getMessage());
@@ -89,14 +89,14 @@
     public void testSimple() {
         instance1.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
 
         // Check properties
@@ -116,11 +116,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation - 2", ((Boolean) props.get("result")).booleanValue()); // True, a provider is here
@@ -139,22 +139,22 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance1.stop();
     }
 
     public void testVoid() {
         instance2.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation - 1", ((Boolean) props.get("result")).booleanValue());
@@ -173,11 +173,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -196,22 +196,22 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance2.stop();
     }
 
     public void testObject() {
         instance3.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -226,11 +226,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -245,8 +245,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance3.stop();
     }
@@ -254,14 +254,14 @@
     public void testRef() {
         instance4.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -276,11 +276,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -295,8 +295,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance4.stop();
     }
@@ -304,14 +304,14 @@
     public void testBoth() {
         instance5.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -326,11 +326,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -345,8 +345,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance4.stop();
     }
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodDelayedOptionalDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodDelayedOptionalDependencies.java
index f87540a..a2ba8d0 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodDelayedOptionalDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodDelayedOptionalDependencies.java
@@ -39,21 +39,21 @@
         try {
             Properties prov = new Properties();
             prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 
             Properties i3 = new Properties();
             i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(context, "DIMObjectOptionalCheckServiceProvider").createComponentInstance(i3);
+            instance3 = Utils.getFactoryByName(getContext(), "DIMObjectOptionalCheckServiceProvider").createComponentInstance(i3);
             instance3.stop();
 
             Properties i4 = new Properties();
             i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(context, "DIMRefOptionalCheckServiceProvider").createComponentInstance(i4);
+            instance4 = Utils.getFactoryByName(getContext(), "DIMRefOptionalCheckServiceProvider").createComponentInstance(i4);
             instance4.stop();
 
             Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "DIMBothOptionalCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "DIMBothOptionalCheckServiceProvider").createComponentInstance(i5);
             instance5.stop();
         } catch (Exception e) {
             fail(e.getMessage());
@@ -74,14 +74,14 @@
 
     public void testObject() {
         instance3.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -98,11 +98,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -117,8 +117,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance3.stop();
     }
@@ -126,14 +126,14 @@
     public void testRef() {
         instance4.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -148,11 +148,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -167,8 +167,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance4.stop();
     }
@@ -176,14 +176,14 @@
     public void testBoth() {
         instance5.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -198,11 +198,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -217,8 +217,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance4.stop();
     }
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodOptionalDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodOptionalDependencies.java
index 82f58b5..cbfab94 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodOptionalDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodOptionalDependencies.java
@@ -39,20 +39,20 @@
         try {
             Properties prov = new Properties();
             prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
             fooProvider.stop();
 
             Properties i3 = new Properties();
             i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(context, "DIMObjectOptionalCheckServiceProvider").createComponentInstance(i3);
+            instance3 = Utils.getFactoryByName(getContext(), "DIMObjectOptionalCheckServiceProvider").createComponentInstance(i3);
 
             Properties i4 = new Properties();
             i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(context, "DIMRefOptionalCheckServiceProvider").createComponentInstance(i4);
+            instance4 = Utils.getFactoryByName(getContext(), "DIMRefOptionalCheckServiceProvider").createComponentInstance(i4);
 
             Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "DIMBothOptionalCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "DIMBothOptionalCheckServiceProvider").createComponentInstance(i5);
         } catch (Exception e) {
             fail(e.getMessage());
         }
@@ -71,14 +71,14 @@
 
     public void testObject() {
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
 
         Properties props = cs.getProps();
 
@@ -95,11 +95,11 @@
 
         fooProvider.start();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -114,10 +114,10 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
@@ -132,19 +132,19 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 
     public void testRef() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
@@ -159,11 +159,11 @@
 
         fooProvider.start();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -178,10 +178,10 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
@@ -196,19 +196,19 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
     
     public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
@@ -223,11 +223,11 @@
 
         fooProvider.start();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -242,10 +242,10 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
@@ -260,8 +260,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 
 }
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/OptionalDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/OptionalDependencies.java
index aed8630..d1ca439 100644
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/OptionalDependencies.java
+++ b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/OptionalDependencies.java
@@ -38,28 +38,28 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider.stop();
 			
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "DISimpleOptionalCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "DISimpleOptionalCheckServiceProvider").createComponentInstance(i1);
 		
 			Properties i2 = new Properties();
 			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(context, "DIVoidOptionalCheckServiceProvider").createComponentInstance(i2);
+			instance2 = Utils.getFactoryByName(getContext(), "DIVoidOptionalCheckServiceProvider").createComponentInstance(i2);
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "DIObjectOptionalCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "DIObjectOptionalCheckServiceProvider").createComponentInstance(i3);
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "DIRefOptionalCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "DIRefOptionalCheckServiceProvider").createComponentInstance(i4);
 			
 			Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "DIBothOptionalCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "DIBothOptionalCheckServiceProvider").createComponentInstance(i5);
 		} catch(Exception e) { fail(e.getMessage()); }		
 	}
 	
@@ -79,14 +79,14 @@
 	}
 	
 	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		
 		//Check properties
@@ -104,11 +104,11 @@
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		
 		//Check properties
@@ -126,24 +126,24 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void testVoid() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
@@ -160,11 +160,11 @@
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -181,10 +181,10 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
@@ -201,19 +201,19 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);	
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);	
 	}
 	
 	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
@@ -226,11 +226,11 @@
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -243,10 +243,10 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
@@ -259,19 +259,19 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);		
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);		
 	}
 	
 	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
@@ -284,11 +284,11 @@
 		
 		fooProvider.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -301,10 +301,10 @@
 		
 		fooProvider.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
@@ -317,19 +317,19 @@
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
@@ -342,11 +342,11 @@
         
         fooProvider.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
@@ -361,10 +361,10 @@
         
         fooProvider.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
@@ -379,8 +379,8 @@
   
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
     }
 
 
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
index 6abb0b1..cac57b2 100644
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
@@ -50,7 +50,7 @@
         if (bc ==null) {
             throw new RuntimeException("Injected bundle context null");
         }
-            m_context = bc;
+        m_context = bc;
     }
 
 	public boolean foo() {
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/BadTests.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/BadTests.java
index e9e0063..bdab8ab 100644
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/BadTests.java
+++ b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/BadTests.java
@@ -147,12 +147,12 @@
      * 
      */
     public void setUp() {
-    	m_utils = new EahTestUtils(context);
+    	m_utils = new EahTestUtils(getContext());
         /**
          * Get the list of available components.
          */
         try {
-            String header = (String) context.getBundle().getHeaders().get(
+            String header = (String) getContext().getBundle().getHeaders().get(
                     "iPOJO-Components");
             m_components = ManifestMetadataParser.parseHeaderMetadata(header)
                     .getElements("component");
@@ -279,21 +279,21 @@
         Dictionary properties = new Hashtable();
 
         // Provider
-        ComponentFactory providerFactory = new ComponentFactory(context,
+        ComponentFactory providerFactory = new ComponentFactory(getContext(),
                 m_provider);
         providerFactory.start();
         properties.put("instance.name","Emperor of donuts");
         ComponentInstance providerInstance = providerFactory
                 .createComponentInstance(properties);
         ServiceReference providerService = IPojoTestUtils
-                .getServiceReferenceByName(context, DonutProvider.class
+                .getServiceReferenceByName(getContext(), DonutProvider.class
                         .getName(), providerInstance.getInstanceName());
-        DonutProvider provider = (DonutProvider) context
+        DonutProvider provider = (DonutProvider) getContext()
                 .getService(providerService);
 
         // The consumer
         properties = new Hashtable();
-        ComponentFactory consumerFactory = new ComponentFactory(context,
+        ComponentFactory consumerFactory = new ComponentFactory(getContext(),
                 m_consumer);
         consumerFactory.start();
         properties.put("instance.name","Homer Simpson");
@@ -301,9 +301,9 @@
         ComponentInstance consumerInstance = consumerFactory
                 .createComponentInstance(properties);
         ServiceReference consumerService = IPojoTestUtils
-                .getServiceReferenceByName(context, DonutConsumer.class
+                .getServiceReferenceByName(getContext(), DonutConsumer.class
                         .getName(), consumerInstance.getInstanceName());
-        DonutConsumer consumer = (DonutConsumer) context
+        DonutConsumer consumer = (DonutConsumer) getContext()
                 .getService(consumerService);
 
         /**
@@ -318,9 +318,9 @@
         /**
          * Destroy component's instances.
          */
-        context.ungetService(providerService);
+        getContext().ungetService(providerService);
         providerInstance.dispose();
-        context.ungetService(consumerService);
+        getContext().ungetService(consumerService);
         consumerInstance.dispose();
         providerFactory.stop();
         consumerFactory.stop();
@@ -344,7 +344,7 @@
         m_publisher.removeAttribute(m_publisherName);
 
         // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(context, m_provider);
+        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
         try {
             fact.start();
             // Should not be executed
@@ -376,7 +376,7 @@
         m_publisher.removeAttribute(m_publisherField);
 
         // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(context, m_provider);
+        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
         try {
             fact.start();
             // Should not be executed
@@ -411,7 +411,7 @@
         m_publisher.addAttribute(unexistingField);
 
         // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(context, m_provider);
+        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
         try {
             fact.start();
             // Should not be executed
@@ -447,7 +447,7 @@
         m_publisher.addAttribute(badTypedField);
 
         // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(context, m_provider);
+        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
         try {
             fact.start();
             // Should not be executed
@@ -478,7 +478,7 @@
 
         // Remove the topics attribute of the publisher
         m_publisher.removeAttribute(m_publisherTopics);
-        ComponentFactory fact = new ComponentFactory(context, m_provider);
+        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
         fact.start();
 
         // Try to create an instance without specified topics
@@ -522,7 +522,7 @@
         m_publisher.addAttribute(malformedTopics);
 
         // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(context, m_provider);
+        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
         try {
             fact.start();
             // Should not be executed
@@ -559,7 +559,7 @@
         m_publisher.addAttribute(malformedTopics);
 
         // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(context, m_provider);
+        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
         try {
             fact.start();
             // Should not be executed
@@ -591,7 +591,7 @@
         // Remove the topics attribute of the publisher and replace with a
         // malformed one
         m_publisher.removeAttribute(m_publisherTopics);
-        ComponentFactory fact = new ComponentFactory(context, m_provider);
+        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
         fact.start();
 
         // Try to create an instance with malformed specified topics
@@ -634,7 +634,7 @@
         m_subscriber.removeAttribute(m_subscriberName);
 
         // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(context, m_consumer);
+        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
         try {
             fact.start();
             // Should not be executed
@@ -666,7 +666,7 @@
         m_subscriber.removeAttribute(m_subscriberCallback);
 
         // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(context, m_consumer);
+        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
         try {
             fact.start();
             // Should not be executed
@@ -696,7 +696,7 @@
 
         // Remove the topics attribute of the subscriber
         m_subscriber.removeAttribute(m_subscriberTopics);
-        ComponentFactory fact = new ComponentFactory(context, m_consumer);
+        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
         fact.start();
 
         // Try to create an instance without specified topics
@@ -741,7 +741,7 @@
         m_subscriber.addAttribute(malformedTopics);
 
         // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(context, m_consumer);
+        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
         try {
             fact.start();
             // Should not be executed
@@ -773,7 +773,7 @@
         // Remove the topics attribute of the subscriber and replace with a
         // malformed one
         m_subscriber.removeAttribute(m_subscriberTopics);
-        ComponentFactory fact = new ComponentFactory(context, m_consumer);
+        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
         fact.start();
 
         // Try to create an instance with malformed specified topics
@@ -819,7 +819,7 @@
         m_subscriber.addAttribute(unknownType);
 
         // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(context, m_consumer);
+        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
         try {
             fact.start();
             // Should not be executed
@@ -856,7 +856,7 @@
         m_subscriber.addAttribute(unknownType);
 
         // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(context, m_consumer);
+        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
         try {
             fact.start();
             // Should not be executed
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/GoodTests.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/GoodTests.java
index 42e6272..ff949ac 100644
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/GoodTests.java
+++ b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/GoodTests.java
@@ -283,7 +283,7 @@
         throws UnacceptableConfiguration, MissingHandlerException,
         ConfigurationException {
 
-        m_utils = new EahTestUtils(context);
+        m_utils = new EahTestUtils(getContext());
         Dictionary properties = new Hashtable();
 
         // All the providers
@@ -336,9 +336,9 @@
         // Get all the services references
         for (int i = 0; i < NUMBER_OF_PROVIDERS; i++) {
             m_providersServices[i] = IPojoTestUtils.getServiceReferenceByName(
-                    context, DonutProvider.class.getName(),
+                    getContext(), DonutProvider.class.getName(),
                     m_providersInstances[i].getInstanceName());
-            m_providers[i] = (DonutProvider) context
+            m_providers[i] = (DonutProvider) getContext()
                     .getService(m_providersServices[i]);
         }
         m_synchronousProviders[0] = m_providers[1];
@@ -408,9 +408,9 @@
         // Get all the services references
         for (int i = 0; i < NUMBER_OF_CONSUMERS; i++) {
             m_consumersServices[i] = IPojoTestUtils.getServiceReferenceByName(
-                    context, DonutConsumer.class.getName(),
+                    getContext(), DonutConsumer.class.getName(),
                     m_consumersInstances[i].getInstanceName());
-            m_consumers[i] = (DonutConsumer) context
+            m_consumers[i] = (DonutConsumer) getContext()
                     .getService(m_consumersServices[i]);
         }
         m_quickConsumers[0] = m_consumers[0];
@@ -423,9 +423,9 @@
         m_eventTrackerInstance = m_utils.getEventTrackerFactory()
                 .createComponentInstance(properties);
         m_eventTrackerService = IPojoTestUtils.getServiceReferenceByName(
-                context, EventTracker.class.getName(), m_eventTrackerInstance
+                getContext(), EventTracker.class.getName(), m_eventTrackerInstance
                         .getInstanceName());
-        m_eventTracker = (EventTracker) context
+        m_eventTracker = (EventTracker) getContext()
                 .getService(m_eventTrackerService);
 
         // Create the filtered consumer
@@ -440,10 +440,10 @@
                     .getDonutEventConsumerFactory().createComponentInstance(
                             properties);
             m_filteredConsumersServices[i] = IPojoTestUtils
-                    .getServiceReferenceByName(context, DonutConsumer.class
+                    .getServiceReferenceByName(getContext(), DonutConsumer.class
                             .getName(), m_filteredConsumersInstances[i]
                             .getInstanceName());
-            m_filteredConsumers[i] = (DonutConsumer) context
+            m_filteredConsumers[i] = (DonutConsumer) getContext()
                     .getService(m_filteredConsumersServices[i]);
         }
 
@@ -461,10 +461,10 @@
                     .getSynchronousDonutProviderFactory()
                     .createComponentInstance(properties);
             m_topicsProvidersServices[i] = IPojoTestUtils
-                    .getServiceReferenceByName(context, DonutProvider.class
+                    .getServiceReferenceByName(getContext(), DonutProvider.class
                             .getName(), m_topicsProvidersInstances[i]
                             .getInstanceName());
-            m_topicsProviders[i] = (DonutProvider) context
+            m_topicsProviders[i] = (DonutProvider) getContext()
                     .getService(m_topicsProvidersServices[i]);
 
             // Create consumer
@@ -476,10 +476,10 @@
             m_topicsConsumersInstances[i] = m_utils.getDonutConsumerFactory()
                     .createComponentInstance(properties);
             m_topicsConsumersServices[i] = IPojoTestUtils
-                    .getServiceReferenceByName(context, DonutConsumer.class
+                    .getServiceReferenceByName(getContext(), DonutConsumer.class
                             .getName(), m_topicsConsumersInstances[i]
                             .getInstanceName());
-            m_topicsConsumers[i] = (DonutConsumer) context
+            m_topicsConsumers[i] = (DonutConsumer) getContext()
                     .getService(m_topicsConsumersServices[i]);
             topics.remove("donut-subscriber");
         }
@@ -721,23 +721,23 @@
     public void tearDown() {
         int index;
         for (index = 0; index < NUMBER_OF_PROVIDERS; index++) {
-            context.ungetService(m_providersServices[index]);
+            getContext().ungetService(m_providersServices[index]);
             m_providersInstances[index].dispose();
         }
         for (index = 0; index < NUMBER_OF_CONSUMERS; index++) {
-            context.ungetService(m_consumersServices[index]);
+            getContext().ungetService(m_consumersServices[index]);
             m_consumersInstances[index].dispose();
         }
-        context.ungetService(m_eventTrackerService);
+        getContext().ungetService(m_eventTrackerService);
         m_eventTrackerInstance.dispose();
         for (int i = 0; i < Donut.FLAVOURS.length; i++) {
-            context.ungetService(m_filteredConsumersServices[i]);
+            getContext().ungetService(m_filteredConsumersServices[i]);
             m_filteredConsumersInstances[i].dispose();
         }
         for (int i = 0; i < TOPICS_LIST.length; i++) {
-            context.ungetService(m_topicsProvidersServices[i]);
+            getContext().ungetService(m_topicsProvidersServices[i]);
             m_topicsProvidersInstances[i].dispose();
-            context.ungetService(m_topicsConsumersServices[i]);
+            getContext().ungetService(m_topicsConsumersServices[i]);
             m_topicsConsumersInstances[i].dispose();
         }
 
diff --git a/ipojo/tests/integration-tests/pom.xml b/ipojo/tests/integration-tests/pom.xml
index f795d99..f1fb35c 100644
--- a/ipojo/tests/integration-tests/pom.xml
+++ b/ipojo/tests/integration-tests/pom.xml
@@ -13,8 +13,7 @@
 	<build>
 		<plugins>
 			<plugin>
-				<groupId>org.apache.felix.ipojo.junit4osgi 
-				</groupId>
+				<groupId>org.apache.felix</groupId>
 				<artifactId>maven-junit4osgi-plugin 
 				</artifactId>
 				<version>1.1.0-SNAPSHOT</version>
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
index eec3052..7fea38d 100644
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
@@ -50,7 +50,7 @@
         if (bc ==null) {
             throw new RuntimeException("Injected bundle context null");
         }
-            m_context = bc;
+        m_context = bc;
     }
 
 	public boolean foo() {
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java
index 78e92e9..165d1e1 100644
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java
+++ b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java
@@ -217,11 +217,11 @@
      * Not manipulated.
      */
     public void testCustomConstuctor() {
-        FooService fs = new FooProviderType1(0, "foo", context);
+        FooService fs = new FooProviderType1(0, "foo", getContext());
         Properties props = fs.fooProps();
         assertEquals("Check bar", 0, ((Integer) props.get("bar")).intValue());
         assertEquals("Check foo", "foo", props.get("foo"));
-        assertEquals("Check context", context, props.get("context"));
+        assertEquals("Check context", getContext(), props.get("context"));
     }
     
     public void testSuperCall() {
diff --git a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
index eec3052..7fea38d 100644
--- a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
@@ -50,7 +50,7 @@
         if (bc ==null) {
             throw new RuntimeException("Injected bundle context null");
         }
-            m_context = bc;
+        m_context = bc;
     }
 
 	public boolean foo() {
diff --git a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ExceptionTest.java b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ExceptionTest.java
index 737edbe..a0761e0 100644
--- a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ExceptionTest.java
+++ b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ExceptionTest.java
@@ -82,7 +82,7 @@
     public void testTry() {
         ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy.getInstanceName());
         assertNotNull("Check that a FooService from " + ci_lazzy.getInstanceName() + " is available",ref);
-        FooProviderType1 fs = (FooProviderType1) context.getService(ref);
+        FooProviderType1 fs = (FooProviderType1) getServiceObject(ref);
         try {
             fs.testTry();
         } catch(Exception e) {
diff --git a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java
index 1789a47..04efa5d 100644
--- a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java
+++ b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java
@@ -87,9 +87,6 @@
 		assertEquals("Check created pojo count", id.getCreatedObjects().length, 1);
 		assertEquals("Check instance description name", id.getName(), compName); 
 		
-		// Unget the service
-		context.ungetService(ref);
-		
 		ci.dispose();
 		
 		// Check that there is no more FooService
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/Annotation.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/Annotation.java
index 0dba85d..6128a1d 100644
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/Annotation.java
+++ b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/Annotation.java
@@ -13,7 +13,7 @@
     
     public void setUp() {
         try {
-            clazz = context.getBundle().
+            clazz = getContext().getBundle().
                 loadClass("org.apache.felix.ipojo.test.scenarios.component.Annotation");
         } catch (ClassNotFoundException e) {
             fail("Cannot load the annotation class : " + e.getMessage());
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
index eec3052..7fea38d 100644
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
@@ -50,7 +50,7 @@
         if (bc ==null) {
             throw new RuntimeException("Injected bundle context null");
         }
-            m_context = bc;
+        m_context = bc;
     }
 
 	public boolean foo() {
