felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r722146 [2/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/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/SimpleImport.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/SimpleImport.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/SimpleImport.java (original)
+++ felix/trunk/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/SimpleImport.java Mon Dec  1 09:44:13 2008
@@ -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) {

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

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

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

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

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

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

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

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

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

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

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

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

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

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



Mime
View raw message