felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r722146 [6/15] - in /felix/trunk/ipojo: examples/junit4osgi/felix-command/ examples/junit4osgi/immediate-launcher/ examples/junit4osgi/junit4osgi/ examples/junit4osgi/maven-junit4osgi-plugin/ examples/junit4osgi/swing-runner/ tests/composit...
Date Mon, 01 Dec 2008 17:44:17 GMT
Modified: felix/trunk/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ObedienceTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ObedienceTest.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ObedienceTest.java (original)
+++ felix/trunk/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ObedienceTest.java Mon Dec  1 09:44:13 2008
@@ -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);
         
 	}

Modified: felix/trunk/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java (original)
+++ felix/trunk/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java Mon Dec  1 09:44:13 2008
@@ -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 {

Modified: felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java (original)
+++ felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java Mon Dec  1 09:44:13 2008
@@ -50,7 +50,7 @@
         if (bc ==null) {
             throw new RuntimeException("Injected bundle context null");
         }
-            m_context = bc;
+        m_context = bc;
     }
 
 	public boolean foo() {

Modified: felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/CallbackTestCase.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/CallbackTestCase.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/CallbackTestCase.java (original)
+++ felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/CallbackTestCase.java Mon Dec  1 09:44:13 2008
@@ -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;
 	}

Modified: felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSeveralFactoryTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSeveralFactoryTest.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSeveralFactoryTest.java (original)
+++ felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSeveralFactoryTest.java Mon Dec  1 09:44:13 2008
@@ -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;
     }

Modified: felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSingletonFactoryTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSingletonFactoryTest.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSingletonFactoryTest.java (original)
+++ felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSingletonFactoryTest.java Mon Dec  1 09:44:13 2008
@@ -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;
     }

Modified: felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackTest.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackTest.java (original)
+++ felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackTest.java Mon Dec  1 09:44:13 2008
@@ -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;
     }

Modified: felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateLifeCycleControllerTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateLifeCycleControllerTest.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateLifeCycleControllerTest.java (original)
+++ felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateLifeCycleControllerTest.java Mon Dec  1 09:44:13 2008
@@ -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();

Modified: felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ParentCallbackTestCase.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ParentCallbackTestCase.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ParentCallbackTestCase.java (original)
+++ felix/trunk/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ParentCallbackTestCase.java Mon Dec  1 09:44:13 2008
@@ -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;
 	}

Modified: felix/trunk/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/ImmediateLifeCycleControllerTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/ImmediateLifeCycleControllerTest.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/ImmediateLifeCycleControllerTest.java (original)
+++ felix/trunk/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/ImmediateLifeCycleControllerTest.java Mon Dec  1 09:44:13 2008
@@ -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();

Modified: felix/trunk/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTest.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTest.java (original)
+++ felix/trunk/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTest.java Mon Dec  1 09:44:13 2008
@@ -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();

Modified: felix/trunk/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/SimpleDPDependencies.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/SimpleDPDependencies.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/SimpleDPDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/SimpleDPDependencies.java Mon Dec  1 09:44:13 2008
@@ -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();
 	}

Modified: felix/trunk/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodOptionalDependencies.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodOptionalDependencies.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodOptionalDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodOptionalDependencies.java Mon Dec  1 09:44:13 2008
@@ -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);
     }
 
 }

Modified: felix/trunk/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodSimpleDependencies.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodSimpleDependencies.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodSimpleDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodSimpleDependencies.java Mon Dec  1 09:44:13 2008
@@ -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);
     }
 
 }



Mime
View raw message