felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r722146 [11/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/composi...
Date Mon, 01 Dec 2008 17:44:17 GMT
Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java Mon Dec  1 09:44:13 2008
@@ -42,29 +42,29 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider");
-			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider1.stop();
 		
 			Properties prov2 = new Properties();
 			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
 			fooProvider2.stop();
 		
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "SimpleCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "SimpleCheckServiceProvider").createComponentInstance(i1);
 		
 			Properties i2 = new Properties();
 			i2.put("instance.name","Optional");
-			instance2 = Utils.getFactoryByName(context, "SimpleOptionalCheckServiceProvider").createComponentInstance(i2);
+			instance2 = Utils.getFactoryByName(getContext(), "SimpleOptionalCheckServiceProvider").createComponentInstance(i2);
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Multiple");
-			instance3 = Utils.getFactoryByName(context, "SimpleMultipleCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "SimpleMultipleCheckServiceProvider").createComponentInstance(i3);
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","OptionalMultiple");
-			instance4 = Utils.getFactoryByName(context, "SimpleOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "SimpleOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
 		} catch(Exception e) {
 			throw new RuntimeException(e.getMessage());
 		}
@@ -106,9 +106,9 @@
 	}
 	
 	public void testSimpleDependency() {
-		ServiceReference arch_dep = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_dep);
-		InstanceDescription id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
 		
 		// Check dependency handler invalidity
@@ -124,26 +124,26 @@
 		
 		fooProvider1.start();
 		
-		ServiceReference arch_ps = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
+		ServiceReference arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps);
-		InstanceDescription id_ps = ((Architecture) context.getService(arch_ps)).getInstanceDescription();
+		InstanceDescription id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);				
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler validity", dhd.isValid());
 		assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps = ((Architecture) context.getService(arch_ps)).getInstanceDescription();
+		id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
 		ProvidedServiceHandlerDescription psh = getPSDesc(id_ps);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertEquals("Check POJO creation", id_ps.getCreatedObjects().length, 1);
@@ -151,18 +151,18 @@
 		
 		fooProvider1.stop();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
 		dhd = getDependencyDesc(id_dep);
 		assertFalse("Check dependency handler invalidity", dhd.isValid());
 		
 		fooProvider1.start();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		arch_ps = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
+		arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps);
-		id_ps = ((Architecture) context.getService(arch_ps)).getInstanceDescription();
+		id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);
 		psh = getPSDesc(id_ps);
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
@@ -170,36 +170,36 @@
 		
 		assertEquals("Check dependency ref -3", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph 
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps = ((Architecture) context.getService(arch_ps)).getInstanceDescription();
+		id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
 		psh = getPSDesc(id_ps);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertTrue("Check service reference - 1", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
 		
 		fooProvider1.stop();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
 		dhd = getDependencyDesc(id_dep);
 		assertFalse("Check dependency handler invalidity", dhd.isValid());
 		
 		id_dep = null;
 		cs = null;
-		context.ungetService(arch_dep);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_dep);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testOptionalDependency() {
-		ServiceReference arch_dep = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+		ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_dep);
-		InstanceDescription id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.VALID);
 		
 		// Check dependency handler invalidity
@@ -215,26 +215,26 @@
 		
 		fooProvider1.start();
 		
-		ServiceReference arch_ps = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
+		ServiceReference arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps);
-		InstanceDescription id_ps = ((Architecture) context.getService(arch_ps)).getInstanceDescription();
+		InstanceDescription id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);				
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler validity", dhd.isValid());
 		assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps = ((Architecture) context.getService(arch_ps)).getInstanceDescription();
+		id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
 		ProvidedServiceHandlerDescription psh = getPSDesc(id_ps);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertEquals("Check POJO creation", id_ps.getCreatedObjects().length, 1);
@@ -242,18 +242,18 @@
 		
 		fooProvider1.stop();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler invalidity", dhd.isValid());
 		
 		fooProvider1.start();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		arch_ps = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
+		arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps);
-		id_ps = ((Architecture) context.getService(arch_ps)).getInstanceDescription();
+		id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);
 		psh = getPSDesc(id_ps);
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
@@ -261,36 +261,36 @@
 		
 		assertEquals("Check dependency ref -3", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph 
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps = ((Architecture) context.getService(arch_ps)).getInstanceDescription();
+		id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
 		psh = getPSDesc(id_ps);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertTrue("Check service reference - 1", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
 		
 		fooProvider1.stop();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler invalidity", dhd.isValid());
 		
 		id_dep = null;
 		cs = null;
-		context.ungetService(arch_dep);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_dep);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testMultipleDependency() {
-		ServiceReference arch_dep = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_dep);
-		InstanceDescription id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
 		
 		// Check dependency handler invalidity
@@ -305,27 +305,27 @@
 		
 		fooProvider1.start();
 		
-		ServiceReference arch_ps1 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
+		ServiceReference arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
-		InstanceDescription id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		InstanceDescription id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id_ps1.getState() == ComponentInstance.VALID);				
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler validity", dhd.isValid());
 		assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		assertEquals("Check used ref - 1 (" + dhd.getDependencies()[0].getUsedServices().size() + ")", dhd.getDependencies()[0].getUsedServices().size(), 0);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		ProvidedServiceHandlerDescription psh = getPSDesc(id_ps1);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);
@@ -334,32 +334,32 @@
 		// Start a second foo service provider
 		fooProvider2.start();
 		
-		arch_ps1 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
-		ServiceReference arch_ps2 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider2.getInstanceName());
+		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
+		ServiceReference arch_ps2 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
 		assertNotNull("Check architecture 2 availability", arch_ps2);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
-		InstanceDescription id_ps2 = ((Architecture) context.getService(arch_ps2)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
+		InstanceDescription id_ps2 = ((Architecture) getContext().getService(arch_ps2)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);
 		assertTrue("Check instance 2 invalidity - 1", id_ps2.getState() == ComponentInstance.VALID);
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler validity", dhd.isValid());
 		assertEquals("Check dependency ref - 3 ", dhd.getDependencies()[0].getServiceReferences().size(), 2);
 		assertEquals("Check used ref - 2 ", dhd.getDependencies()[0].getUsedServices().size(), 1); // provider 2 not already used
 		
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
-		id_ps2 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
+		id_ps2 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		ProvidedServiceHandlerDescription psh1 = getPSDesc(id_ps1);
 		ProvidedServiceHandlerDescription psh2 = getPSDesc(id_ps2);
 		assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);
@@ -370,27 +370,27 @@
 		
 		fooProvider2.stop();
 		
-		arch_ps1 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
+		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id_ps1.getState() == ComponentInstance.VALID);				
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler validity", dhd.isValid());
 		assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		assertEquals("Check used ref - 4 ", dhd.getDependencies()[0].getUsedServices().size(), 1);
 		
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		psh = getPSDesc(id_ps1);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);
@@ -399,18 +399,18 @@
 		
 		fooProvider1.stop();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertFalse("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertFalse("Check dependency handler invalidity", dhd.isValid());
 		
 		fooProvider2.start();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		arch_ps1 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider2.getInstanceName());
+		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);
 		psh = getPSDesc(id_ps1);
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
@@ -419,15 +419,15 @@
 		assertEquals("Check dependency ref -3", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		assertEquals("Check used ref - 6 ", dhd.getDependencies()[0].getUsedServices().size(), 0);
 		
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph 
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		psh = getPSDesc(id_ps1);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertTrue("Check service reference - 4", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
@@ -435,21 +435,21 @@
 		
 		fooProvider2.stop();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertFalse("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertFalse("Check dependency handler invalidity", dhd.isValid());
 		
 		id_dep = null;
 		cs = null;
-		context.ungetService(arch_dep);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_dep);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testMultipleOptionalDependency() {
-		ServiceReference arch_dep = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_dep);
-		InstanceDescription id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.VALID);
 		
 		// Check dependency handler invalidity
@@ -464,26 +464,26 @@
 		
 		fooProvider1.start();
 		
-		ServiceReference arch_ps1 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
+		ServiceReference arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
-		InstanceDescription id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		InstanceDescription id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);				
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler validity", dhd.isValid());
 		assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		ProvidedServiceHandlerDescription psh = getPSDesc(id_ps1);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);
@@ -492,31 +492,31 @@
 		// Start a second foo service provider
 		fooProvider2.start();
 		
-		arch_ps1 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
-		ServiceReference arch_ps2 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider2.getInstanceName());
+		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
+		ServiceReference arch_ps2 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
 		assertNotNull("Check architecture 2 availability", arch_ps2);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
-		InstanceDescription id_ps2 = ((Architecture) context.getService(arch_ps2)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
+		InstanceDescription id_ps2 = ((Architecture) getContext().getService(arch_ps2)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);
 		assertTrue("Check instance 2 invalidity - 1", id_ps2.getState() == ComponentInstance.VALID);
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler validity", dhd.isValid());
 		assertEquals("Check dependency ref - 3 ", dhd.getDependencies()[0].getServiceReferences().size(), 2);
 		
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
-		id_ps2 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
+		id_ps2 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		ProvidedServiceHandlerDescription psh1 = getPSDesc(id_ps1);
 		ProvidedServiceHandlerDescription psh2 = getPSDesc(id_ps2);
 		assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);
@@ -526,26 +526,26 @@
 		
 		fooProvider2.stop();
 		
-		arch_ps1 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider1.getInstanceName());
+		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);				
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler validity", dhd.isValid());
 		assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		psh = getPSDesc(id_ps1);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);
@@ -553,18 +553,18 @@
 
 		fooProvider1.stop();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler invalidity", dhd.isValid());
 		
 		fooProvider2.start();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		arch_ps1 = Utils.getServiceReferenceByName(context, Architecture.class.getName(), fooProvider2.getInstanceName());
+		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);
 		psh = getPSDesc(id_ps1);
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
@@ -572,30 +572,30 @@
 		
 		assertEquals("Check dependency ref -3", dhd.getDependencies()[0].getServiceReferences().size(), 1);
 		
-		cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph 
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) context.getService(arch_ps1)).getInstanceDescription();
+		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		psh = getPSDesc(id_ps1);
 		assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
 		assertTrue("Check service reference - 4", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
 
 		fooProvider2.stop();
 		
-		id_dep = ((Architecture) context.getService(arch_dep)).getInstanceDescription();
+		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);
 		dhd = getDependencyDesc(id_dep);
 		assertTrue("Check dependency handler invalidity", dhd.isValid());
 		
 		id_dep = null;
 		cs = null;
-		context.ungetService(arch_dep);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_dep);
+		getContext().ungetService(cs_ref);
 	}
 	
 	

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ListMultipleDependencies.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ListMultipleDependencies.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ListMultipleDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ListMultipleDependencies.java Mon Dec  1 09:44:13 2008
@@ -37,21 +37,21 @@
 		try {
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 			fooProvider1.stop();
 		
 			Properties prov2 = new Properties();
 			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
 			fooProvider2.stop();
 		
 			Properties i1 = new Properties();
 			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(context, "SimpleListCheckServiceProvider").createComponentInstance(i1);
+			instance1 = Utils.getFactoryByName(getContext(), "SimpleListCheckServiceProvider").createComponentInstance(i1);
 			
 			Properties i2 = new Properties();
             i2.put("instance.name","Optional");
-            instance2 = Utils.getFactoryByName(context, "OptionalListCheckServiceProvider").createComponentInstance(i2);
+            instance2 = Utils.getFactoryByName(getContext(), "OptionalListCheckServiceProvider").createComponentInstance(i2);
 		} catch(Exception e) { fail(e.getMessage()); }
 		
 	}
@@ -68,19 +68,19 @@
 	}
 	
 	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance1.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
 		
 		fooProvider1.start();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -95,10 +95,10 @@
 		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
 		
 		fooProvider2.start();
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -114,10 +114,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -132,24 +132,24 @@
 		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
 		
 		fooProvider2.stop();
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testOptional() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance2.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance2.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
@@ -165,10 +165,10 @@
         
         fooProvider1.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -184,10 +184,10 @@
         
         fooProvider2.start();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -203,10 +203,10 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
@@ -222,10 +222,10 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
@@ -241,8 +241,8 @@
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);       
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);       
     }
 	
 }

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java Mon Dec  1 09:44:13 2008
@@ -38,36 +38,36 @@
 		
 			Properties i3 = new Properties();
 			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(context, "MObjectMultipleCheckServiceProvider").createComponentInstance(i3);
+			instance3 = Utils.getFactoryByName(getContext(), "MObjectMultipleCheckServiceProvider").createComponentInstance(i3);
 			instance3.stop();
 		
 			Properties i4 = new Properties();
 			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(context, "MRefMultipleCheckServiceProvider").createComponentInstance(i4);
+			instance4 = Utils.getFactoryByName(getContext(), "MRefMultipleCheckServiceProvider").createComponentInstance(i4);
 			instance4.stop();
 			
 			Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "MBothMultipleCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "MBothMultipleCheckServiceProvider").createComponentInstance(i5);
             instance5.stop();
             
             Properties i6 = new Properties();
             i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(context, "MMapMultipleCheckServiceProvider").createComponentInstance(i6);
+            instance6 = Utils.getFactoryByName(getContext(), "MMapMultipleCheckServiceProvider").createComponentInstance(i6);
             instance6.stop();
             
             Properties i7 = new Properties();
             i7.put("instance.name","Dict");
-            instance7 = Utils.getFactoryByName(context, "MDictMultipleCheckServiceProvider").createComponentInstance(i7);
+            instance7 = Utils.getFactoryByName(getContext(), "MDictMultipleCheckServiceProvider").createComponentInstance(i7);
             instance7.stop();
 		
 			Properties prov = new Properties();
 			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 		
 			Properties prov2 = new Properties();
 			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov2);
+			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
 		} catch(Exception e) { fail(e.getMessage()); }
 	}
 	
@@ -91,17 +91,17 @@
 	public void testObject() {
 		instance3.start();
 		
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -117,10 +117,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -136,26 +136,26 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
-		context.ungetService(cs_ref);
+		getContext().ungetService(arch_ref);
+		getContext().ungetService(cs_ref);
 		instance3.stop();
 	}
 	
 	public void testRef() {
 		instance4.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
 		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) context.getService(cs_ref);
+		CheckService cs = (CheckService) getContext().getService(cs_ref);
 		Properties props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -171,10 +171,10 @@
 		
 		fooProvider1.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
 		
-		cs = (CheckService) context.getService(cs_ref);
+		cs = (CheckService) getContext().getService(cs_ref);
 		props = cs.getProps();
 		//Check properties
 		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -190,26 +190,26 @@
 		
 		fooProvider2.stop();
 		
-		id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
 		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
 		
 		id = null;
 		cs = null;
-		context.ungetService(arch_ref);
+		getContext().ungetService(arch_ref);
 		instance4.stop();
-		context.ungetService(cs_ref);
+		getContext().ungetService(cs_ref);
 	}
 	
 	public void testBoth() {
         instance5.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -229,10 +229,10 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -252,26 +252,26 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
+        getContext().ungetService(arch_ref);
         instance5.stop();
-        context.ungetService(cs_ref);
+        getContext().ungetService(cs_ref);
     }
 	
 	public void testMap() {
         instance6.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance6.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance6.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -291,10 +291,10 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -314,26 +314,26 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
+        getContext().ungetService(arch_ref);
         instance6.stop();
-        context.ungetService(cs_ref);
+        getContext().ungetService(cs_ref);
     }
 	
 	public void testDict() {
         instance7.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance7.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
         
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance7.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
@@ -353,10 +353,10 @@
         
         fooProvider1.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
         
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         //Check properties
         assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
@@ -376,14 +376,14 @@
         
         fooProvider2.stop();
         
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
         
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
+        getContext().ungetService(arch_ref);
         instance7.stop();
-        context.ungetService(cs_ref);
+        getContext().ungetService(cs_ref);
     }
 
 	

Modified: felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalDependencies.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalDependencies.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalDependencies.java Mon Dec  1 09:44:13 2008
@@ -38,31 +38,31 @@
         try {
             Properties prov = new Properties();
             prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(context, "FooProviderType-1").createComponentInstance(prov);
+            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
 
             Properties i3 = new Properties();
             i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(context, "MObjectOptionalCheckServiceProvider").createComponentInstance(i3);
+            instance3 = Utils.getFactoryByName(getContext(), "MObjectOptionalCheckServiceProvider").createComponentInstance(i3);
             instance3.stop();
 
             Properties i4 = new Properties();
             i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(context, "MRefOptionalCheckServiceProvider").createComponentInstance(i4);
+            instance4 = Utils.getFactoryByName(getContext(), "MRefOptionalCheckServiceProvider").createComponentInstance(i4);
             instance4.stop();
 
             Properties i5 = new Properties();
             i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(context, "MBothOptionalCheckServiceProvider").createComponentInstance(i5);
+            instance5 = Utils.getFactoryByName(getContext(), "MBothOptionalCheckServiceProvider").createComponentInstance(i5);
             instance5.stop();
             
             Properties i6 = new Properties();
             i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(context, "MMapOptionalCheckServiceProvider").createComponentInstance(i6);
+            instance6 = Utils.getFactoryByName(getContext(), "MMapOptionalCheckServiceProvider").createComponentInstance(i6);
             instance6.stop();
             
             Properties i7 = new Properties();
             i7.put("instance.name","Dict");
-            instance7 = Utils.getFactoryByName(context, "MDictOptionalCheckServiceProvider").createComponentInstance(i7);
+            instance7 = Utils.getFactoryByName(getContext(), "MDictOptionalCheckServiceProvider").createComponentInstance(i7);
             instance7.stop();
         } catch (Exception e) {
             fail(e.getMessage());
@@ -87,14 +87,14 @@
 
     public void testObject() {
         instance3.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance3.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance3.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -111,11 +111,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -130,8 +130,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance3.stop();
     }
@@ -139,14 +139,14 @@
     public void testRef() {
         instance4.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance4.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance4.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -161,11 +161,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -180,8 +180,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance4.stop();
     }
@@ -189,14 +189,14 @@
     public void testBoth() {
         instance5.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance5.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance5.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -215,11 +215,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -238,8 +238,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance5.stop();
     }
@@ -247,14 +247,14 @@
     public void testMap() {
         instance6.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance6.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance6.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -273,11 +273,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -296,8 +296,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance6.stop();
     }
@@ -305,14 +305,14 @@
     public void testDict() {
         instance7.start();
 
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(context, Architecture.class.getName(), instance7.getInstanceName());
+        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
         assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
 
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance7.getInstanceName());
+        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
         assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) context.getService(cs_ref);
+        CheckService cs = (CheckService) getContext().getService(cs_ref);
         Properties props = cs.getProps();
         // Check properties
         assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
@@ -331,11 +331,11 @@
 
         fooProvider.stop();
 
-        id = ((Architecture) context.getService(arch_ref)).getInstanceDescription();
+        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
         assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
 
         assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) context.getService(cs_ref);
+        cs = (CheckService) getContext().getService(cs_ref);
         props = cs.getProps();
         // Check properties
         assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
@@ -354,8 +354,8 @@
 
         id = null;
         cs = null;
-        context.ungetService(arch_ref);
-        context.ungetService(cs_ref);
+        getContext().ungetService(arch_ref);
+        getContext().ungetService(cs_ref);
 
         instance7.stop();
     }



Mime
View raw message