felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r730353 [3/3] - in /felix/trunk/ipojo: composite/src/main/java/org/apache/felix/ipojo/composite/ composite/src/main/java/org/apache/felix/ipojo/composite/instance/ composite/src/main/java/org/apache/felix/ipojo/composite/service/instantiato...
Date Wed, 31 Dec 2008 09:02:57 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=730353&r1=730352&r2=730353&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 Wed Dec 31 01:02:55 2008
@@ -21,16 +21,16 @@
 import java.util.Properties;
 
 import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.PrimitiveInstanceDescription;
 import org.apache.felix.ipojo.architecture.Architecture;
 import org.apache.felix.ipojo.architecture.InstanceDescription;
 import org.apache.felix.ipojo.handlers.dependency.DependencyHandlerDescription;
 import org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandlerDescription;
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
 import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
 import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+import org.osgi.framework.ServiceReference;
 
 public class DependencyArchitectureTest extends OSGiTestCase {
 	
@@ -86,29 +86,29 @@
 	}
 	
 	private DependencyHandlerDescription getDependencyDesc(InstanceDescription id) {
-		for(int i = 0; i < id.getHandlers().length; i++) {
-			if(id.getHandlers()[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.dependency.DependencyHandler")) {
-				return (DependencyHandlerDescription) id.getHandlers()[i];
-			}
+	    DependencyHandlerDescription handler = (DependencyHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:requires");
+		if (handler == null) {
+		    fail("Dependency Handler not found");
+		    return null;
+		} else {
+		    return handler;
 		}
-		fail("Dependency Handler not found");
-		return null;
 	}
 	
 	private ProvidedServiceHandlerDescription getPSDesc(InstanceDescription id) {
-		for(int i = 0; i < id.getHandlers().length; i++) {
-			if(id.getHandlers()[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {
-				return (ProvidedServiceHandlerDescription) id.getHandlers()[i];
-			}
-		}
-		fail("Provided Service Handler not found");
-		return null;
+	    ProvidedServiceHandlerDescription handler = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");
+        if (handler == null) {
+            fail("Provided Service Handler not found");
+            return null;
+        } else {
+            return handler;
+        }
 	}
 	
 	public void testSimpleDependency() {
 		ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_dep);
-		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
+		PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
 		
 		// Check dependency handler invalidity
@@ -126,10 +126,10 @@
 		
 		ServiceReference arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps);
-		InstanceDescription id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
+		PrimitiveInstanceDescription id_ps = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);				
 		
-		id_dep = ((Architecture) getContext().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());
@@ -141,9 +141,9 @@
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps = ((Architecture) getContext().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) getContext().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) getContext().getService(arch_dep)).getInstanceDescription();
+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
 		arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps);
-		id_ps = ((Architecture) getContext().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);
@@ -176,16 +176,16 @@
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph 
-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps = ((Architecture) getContext().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) getContext().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());
@@ -199,7 +199,7 @@
 	public void testOptionalDependency() {
 		ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_dep);
-		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
+		PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.VALID);
 		
 		// Check dependency handler invalidity
@@ -217,10 +217,10 @@
 		
 		ServiceReference arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps);
-		InstanceDescription id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
+		PrimitiveInstanceDescription id_ps = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);				
 		
-		id_dep = ((Architecture) getContext().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());
@@ -232,9 +232,9 @@
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps = ((Architecture) getContext().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) getContext().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) getContext().getService(arch_dep)).getInstanceDescription();
+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
 		arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps);
-		id_ps = ((Architecture) getContext().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);
@@ -267,16 +267,16 @@
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph 
-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps = ((Architecture) getContext().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) getContext().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());
@@ -290,7 +290,7 @@
 	public void testMultipleDependency() {
 		ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
 		assertNotNull("Check architecture availability", arch_dep);
-		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
+		PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
 		
 		// Check dependency handler invalidity
@@ -307,10 +307,10 @@
 		
 		ServiceReference arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
-		InstanceDescription id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
+		PrimitiveInstanceDescription id_ps1 = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		assertTrue("Check instance validity - 1", id_ps1.getState() == ComponentInstance.VALID);				
 		
-		id_dep = ((Architecture) getContext().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());
@@ -323,9 +323,9 @@
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) getContext().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);
@@ -338,12 +338,12 @@
 		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) getContext().getService(arch_ps1)).getInstanceDescription();
-		InstanceDescription id_ps2 = ((Architecture) getContext().getService(arch_ps2)).getInstanceDescription();
+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
+		PrimitiveInstanceDescription id_ps2 = (PrimitiveInstanceDescription) ((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) getContext().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());
@@ -356,10 +356,10 @@
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-		id_ps2 = ((Architecture) getContext().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);
@@ -372,10 +372,10 @@
 		
 		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
-		id_ps1 = ((Architecture) getContext().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) getContext().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());
@@ -388,9 +388,9 @@
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) getContext().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,20 +399,22 @@
 		
 		fooProvider1.stop();
 		
-		id_dep = ((Architecture) getContext().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) getContext().getService(arch_dep)).getInstanceDescription();
+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());
+		arch_ps2 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);
-		psh = getPSDesc(id_ps1);
+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
+		
+		assertTrue("Check instance invalidity - 1", id_ps2.getState() == ComponentInstance.VALID);
+		
+		psh = getPSDesc(id_ps2);
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
 		assertTrue("Check dependency handler validity", dhd.isValid());
 		
@@ -425,17 +427,17 @@
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph 
-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-		psh = getPSDesc(id_ps1);
+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
+		psh = getPSDesc(id_ps2);
 		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()));
 		assertEquals("Check used ref - 7 ", dhd.getDependencies()[0].getUsedServices().size(), 1);
 		
 		fooProvider2.stop();
 		
-		id_dep = ((Architecture) getContext().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());
@@ -449,7 +451,7 @@
 	public void testMultipleOptionalDependency() {
 		ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
 		assertNotNull("Check architecture availability", arch_dep);
-		InstanceDescription id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
+		PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.VALID);
 		
 		// Check dependency handler invalidity
@@ -466,10 +468,10 @@
 		
 		ServiceReference arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
-		InstanceDescription id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
+		PrimitiveInstanceDescription id_ps1 = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
 		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);				
 		
-		id_dep = ((Architecture) getContext().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());
@@ -481,9 +483,9 @@
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) getContext().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);
@@ -496,12 +498,12 @@
 		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) getContext().getService(arch_ps1)).getInstanceDescription();
-		InstanceDescription id_ps2 = ((Architecture) getContext().getService(arch_ps2)).getInstanceDescription();
+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
+		PrimitiveInstanceDescription id_ps2 = (PrimitiveInstanceDescription) ((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) getContext().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());
@@ -513,10 +515,10 @@
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-		id_ps2 = ((Architecture) getContext().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);
@@ -528,10 +530,10 @@
 		
 		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
 		assertNotNull("Check architecture availability", arch_ps1);
-		id_ps1 = ((Architecture) getContext().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) getContext().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());
@@ -543,9 +545,9 @@
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph
-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) getContext().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,20 +555,20 @@
 
 		fooProvider1.stop();
 		
-		id_dep = ((Architecture) getContext().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) getContext().getService(arch_dep)).getInstanceDescription();
+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ps1);
-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);
-		psh = getPSDesc(id_ps1);
+		arch_ps2 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());
+		assertNotNull("Check architecture availability", arch_ps2);
+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
+		assertTrue("Check instance invalidity - 1", id_ps2.getState() == ComponentInstance.VALID);
+		psh = getPSDesc(id_ps2);
 		assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
 		assertTrue("Check dependency handler validity", dhd.isValid());
 		
@@ -578,16 +580,16 @@
 		assertTrue("check CheckService invocation", cs.check());
 		
 		// Check object graph 
-		id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
+		//id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
 		dhd = getDependencyDesc(id_dep);
-		id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-		psh = getPSDesc(id_ps1);
+		//id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
+		psh = getPSDesc(id_ps2);
 		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) getContext().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());

Modified: felix/trunk/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/CustomStrategyTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/CustomStrategyTest.java?rev=730353&r1=730352&r2=730353&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/CustomStrategyTest.java (original)
+++ felix/trunk/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/CustomStrategyTest.java Wed Dec 31 01:02:55 2008
@@ -3,6 +3,7 @@
 import java.util.Properties;
 
 import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.PrimitiveInstanceDescription;
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
 import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.test.scenarios.component.strategies.FooBarProviderType1;
@@ -43,7 +44,7 @@
     }
     
     private void checkCreatedObjects(ComponentInstance ci, int expected) {
-        assertEquals("Number of created objects", expected, ci.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Number of created objects", expected, ((PrimitiveInstanceDescription) ci.getInstanceDescription()).getCreatedObjects().length);
     }
     
     public void testOneService() {

Modified: felix/trunk/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/PerInstanceStrategyTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/PerInstanceStrategyTest.java?rev=730353&r1=730352&r2=730353&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/PerInstanceStrategyTest.java (original)
+++ felix/trunk/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/PerInstanceStrategyTest.java Wed Dec 31 01:02:55 2008
@@ -3,6 +3,7 @@
 import java.util.Properties;
 
 import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.PrimitiveInstanceDescription;
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
 import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.test.scenarios.component.strategies.FooBarProviderType1;
@@ -43,7 +44,7 @@
     }
     
     private void checkCreatedObjects(ComponentInstance ci, int expected) {
-        assertEquals("Number of created objects", expected, ci.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Number of created objects", expected, ((PrimitiveInstanceDescription) ci.getInstanceDescription()).getCreatedObjects().length);
     }
     
     public void testOneService() {

Modified: felix/trunk/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceArchitectureTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceArchitectureTest.java?rev=730353&r1=730352&r2=730353&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceArchitectureTest.java (original)
+++ felix/trunk/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceArchitectureTest.java Wed Dec 31 01:02:55 2008
@@ -68,12 +68,14 @@
 		
 		//Look for the ProvidedService Handler
 		ProvidedServiceHandlerDescription pshd = null;
-		for(int i = 0; i < handlers.length; i++) {
-			if(handlers[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {
-				pshd = (ProvidedServiceHandlerDescription) handlers[i];
-			}
-		}
-		
+        pshd = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");
+
+//		for(int i = 0; i < handlers.length; i++) {
+//			if(handlers[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {
+//				pshd = (ProvidedServiceHandlerDescription) handlers[i];
+//			}
+//		}
+//		
 		assertNotNull("Check ProvidedServiceHandlerDescription", pshd);
 		ProvidedServiceDescription[] ps = pshd.getProvidedServices();
 		
@@ -117,11 +119,8 @@
 		
 		//Look for the ProvidedService Handler
 		ProvidedServiceHandlerDescription pshd = null;
-		for(int i = 0; i < handlers.length; i++) {
-			if(handlers[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {
-				pshd = (ProvidedServiceHandlerDescription) handlers[i];
-			}
-		}
+		pshd = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");
+
 		
 		assertNotNull("Check ProvidedServiceHandlerDescription", pshd);
 		ProvidedServiceDescription[] ps = pshd.getProvidedServices();
@@ -136,9 +135,9 @@
 		assertEquals("Check service properties number (#" + prop + "?=5)" , prop.size(), 5);
 		assertEquals("Check instance.name property", prop.getProperty("instance.name"), compName);
 		assertEquals("Check factory.name property", prop.getProperty("factory.name"), factName);
-		assertEquals("Check foo property", prop.getProperty("foo"), "foo");
-		assertEquals("Check bar property", prop.getProperty("bar"), "2");
-		assertEquals("Check baz property", prop.getProperty("baz"), "baz");
+		assertEquals("Check foo property", prop.get("foo"), "foo");
+		assertEquals("Check bar property", prop.get("bar"), new Integer(2));
+		assertEquals("Check baz property", prop.get("baz"), "baz");
 		
 	}
 	
@@ -166,11 +165,13 @@
 		
 		//Look for the ProvidedService Handler
 		ProvidedServiceHandlerDescription pshd = null;
-		for(int i = 0; i < handlers.length; i++) {
-			if(handlers[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {
-				pshd = (ProvidedServiceHandlerDescription) handlers[i];
-			}
-		}
+        pshd = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");
+
+//		for(int i = 0; i < handlers.length; i++) {
+//			if(handlers[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {
+//				pshd = (ProvidedServiceHandlerDescription) handlers[i];
+//			}
+//		}
 		
 		assertNotNull("Check ProvidedServiceHandlerDescription", pshd);
 		ProvidedServiceDescription[] ps = pshd.getProvidedServices();
@@ -207,11 +208,13 @@
     	
     	//Look for the ProvidedService Handler
     	ProvidedServiceHandlerDescription pshd = null;
-    	for(int i = 0; i < handlers.length; i++) {
-    		if(handlers[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {
-    			pshd = (ProvidedServiceHandlerDescription) handlers[i];
-    		}
-    	}
+        pshd = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");
+
+//    	for(int i = 0; i < handlers.length; i++) {
+//    		if(handlers[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {
+//    			pshd = (ProvidedServiceHandlerDescription) handlers[i];
+//    		}
+//    	}
     	
     	assertNotNull("Check ProvidedServiceHandlerDescription", pshd);
     	ProvidedServiceDescription[] ps = pshd.getProvidedServices();

Modified: felix/trunk/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java?rev=730353&r1=730352&r2=730353&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java (original)
+++ felix/trunk/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java Wed Dec 31 01:02:55 2008
@@ -21,6 +21,7 @@
 import java.util.Properties;
 
 import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.PrimitiveInstanceDescription;
 import org.apache.felix.ipojo.architecture.Architecture;
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
 import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
@@ -110,50 +111,50 @@
 	 * Check lazy creation.
 	 */
 	public void testLazyCreation() {
-		assertEquals("Check that no objects are created ", 0, lazzyArch.getInstanceDescription().getCreatedObjects().length);
+		assertEquals("Check that no objects are created ", 0, ((PrimitiveInstanceDescription) lazzyArch.getInstanceDescription()).getCreatedObjects().length);
 		ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy.getInstanceName());
 		assertNotNull("Check that a FooService from " + ci_lazzy.getInstanceName() + " is available",ref);
 		FooService fs = (FooService) getServiceObject(ref);
 		assertTrue("Check the FooService invocation", fs.foo());
-		assertEquals("Check the creation of 1 object",1, lazzyArch.getInstanceDescription().getCreatedObjects().length);
+		assertEquals("Check the creation of 1 object",1,  ((PrimitiveInstanceDescription) lazzyArch.getInstanceDescription()).getCreatedObjects().length);
 	}
 	
 	/**
 	 * Check lazy and singleton creation.
 	 */
 	public void testLazyCreationSingleton() {
-        assertEquals("Check that no objects are created ", 0, lazzyArchSing.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check that no objects are created ", 0,  ((PrimitiveInstanceDescription) lazzyArchSing.getInstanceDescription()).getCreatedObjects().length);
         ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy_sing.getInstanceName());
         assertNotNull("Check that a FooService from " + ci_lazzy_sing.getInstanceName() + " is available",ref);
         FooService fs = (FooService) getServiceObject(ref);
         assertTrue("Check the FooService invocation", fs.foo());
-        assertEquals("Check the creation of 1 object",1, lazzyArchSing.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check the creation of 1 object",1,  ((PrimitiveInstanceDescription) lazzyArchSing.getInstanceDescription()).getCreatedObjects().length);
     }
 	
 	/**
 	 * Check lazy and "several" creation.
 	 */
 	public void testLazyCreationSeveral() {
-        assertEquals("Check that no objects are created ", 0, lazzyArchSev.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check that no objects are created ", 0,  ((PrimitiveInstanceDescription) lazzyArchSev.getInstanceDescription()).getCreatedObjects().length);
         ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy_sev.getInstanceName());
         assertNotNull("Check that a FooService from " + ci_lazzy_sev.getInstanceName() + " is available", ref);
         FooService fs = (FooService) getServiceObject(ref);
         FooService fs2 = (FooService) getServiceObject(ref);
         assertTrue("Check the FooService invocation", fs.foo());
         assertTrue("Check the FooService invocation-2", fs2.foo());
-        assertEquals("Check the creation of 1 object",1, lazzyArchSev.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check the creation of 1 object",1, ((PrimitiveInstanceDescription) lazzyArchSev.getInstanceDescription()).getCreatedObjects().length);
     }
 	
 	/**
 	 * Check immediate creation.
 	 */
 	public void testImmediateCreation() {
-		assertEquals("Check that one object is created ", 1, immeArch.getInstanceDescription().getCreatedObjects().length);
+		assertEquals("Check that one object is created ", 1, ((PrimitiveInstanceDescription) immeArch.getInstanceDescription()).getCreatedObjects().length);
 		ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_immediate.getInstanceName());
 		assertNotNull("Check that a FooService from " + ci_immediate.getInstanceName() + " is available", ref);
 		FooService fs = (FooService) getServiceObject(ref);
 		assertTrue("Check the FooService invocation", fs.foo());
-		assertEquals("Check the creation of 1 object", 1, immeArch.getInstanceDescription().getCreatedObjects().length);
+		assertEquals("Check the creation of 1 object", 1, ((PrimitiveInstanceDescription) immeArch.getInstanceDescription()).getCreatedObjects().length);
 	}
     
     /**
@@ -165,19 +166,19 @@
         FooService fs = (FooService) getServiceObject(ref);
         Properties p = fs.fooProps();
         assertNotNull("Check the bundle context", p.get("context"));
-        assertEquals("Check the creation of 1 object",1, lazzyArch.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check the creation of 1 object",1, ((PrimitiveInstanceDescription) lazzyArch.getInstanceDescription()).getCreatedObjects().length);
     }
 
     /**
      * Test immediate singleton creation.
      */
     public void testImmediateSingletonCreation() {
-    	assertEquals("Check that one object is created ", 1, immeArchSing.getInstanceDescription().getCreatedObjects().length);
+    	assertEquals("Check that one object is created ", 1, ((PrimitiveInstanceDescription) immeArchSing.getInstanceDescription()).getCreatedObjects().length);
     	ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_immediate_singleton.getInstanceName());
     	assertNotNull("Check that a FooService from " + ci_immediate_singleton.getInstanceName() + " is available",ref);
     	FooService fs = (FooService) getServiceObject(ref);
     	assertTrue("Check the FooService invocation", fs.foo());
-    	assertEquals("Check the creation of 1 object", 1, immeArchSing.getInstanceDescription().getCreatedObjects().length);
+    	assertEquals("Check the creation of 1 object", 1, ((PrimitiveInstanceDescription) immeArchSing.getInstanceDescription()).getCreatedObjects().length);
     }
 
     /**
@@ -185,14 +186,14 @@
      * (lazy & singleton creation)
      */
     public void testLazyCreationSingletonM() {
-        assertEquals("Check that no objects are created ", 0, lazzyArchSingM.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check that no objects are created ", 0, ((PrimitiveInstanceDescription) lazzyArchSingM.getInstanceDescription()).getCreatedObjects().length);
         ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy_singM.getInstanceName());
         assertNotNull("Check that a FooService from " + ci_lazzy_singM.getInstanceName() + " is available",ref);
         FooService fs = (FooService) getServiceObject(ref);
         FooService fs2 = (FooService) getServiceObject(ref);
         assertTrue("Check the FooService invocation", fs.foo());
         assertTrue("Check the FooService invocation", fs2.foo());
-        assertEquals("Check the creation of 1 object",1, lazzyArchSingM.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check the creation of 1 object",1, ((PrimitiveInstanceDescription) lazzyArchSingM.getInstanceDescription()).getCreatedObjects().length);
     }
 
     /**
@@ -200,16 +201,16 @@
      * (lazy & several creation)
      */
     public void testLazyCreationSeveralM() {
-        assertEquals("Check that no objects are created ", 0, lazzyArchSevM.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check that no objects are created ", 0, ((PrimitiveInstanceDescription) lazzyArchSevM.getInstanceDescription()).getCreatedObjects().length);
         ServiceReference ref= helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy_sevM.getInstanceName());
         assertNotNull("Check that a FooService from " + ci_lazzy_sevM.getInstanceName() + " is available",ref);
         FooService fs = (FooService) getServiceObject(ref);
         assertTrue("Check the FooService invocation", fs.foo());
-        assertEquals("Check the creation of 1 object",1, lazzyArchSevM.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check the creation of 1 object",1, ((PrimitiveInstanceDescription) lazzyArchSevM.getInstanceDescription()).getCreatedObjects().length);
         FooService fs2 = (FooService) getServiceObject(ref);
         assertTrue("Check the FooService invocation-2", fs2.foo());
         // Only one object as the getService method is called only once (service factory) despite the policy="method".
-        assertEquals("Check the creation of 1 object",1, lazzyArchSevM.getInstanceDescription().getCreatedObjects().length);
+        assertEquals("Check the creation of 1 object",1, ((PrimitiveInstanceDescription) lazzyArchSevM.getInstanceDescription()).getCreatedObjects().length);
     }
     
     /**

Modified: felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java?rev=730353&r1=730352&r2=730353&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java (original)
+++ felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java Wed Dec 31 01:02:55 2008
@@ -23,6 +23,7 @@
 import org.apache.felix.ipojo.ComponentInstance;
 import org.apache.felix.ipojo.Factory;
 import org.apache.felix.ipojo.Pojo;
+import org.apache.felix.ipojo.PrimitiveInstanceDescription;
 import org.apache.felix.ipojo.architecture.InstanceDescription;
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
 import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
@@ -82,7 +83,7 @@
 		assertEquals("Check component instance name", instance.getInstanceName(), compName);
 		assertEquals("Check component factory name", instance.getFactory().getName(), factName);
 		assertNotNull("Instance description not null", instance.getInstanceDescription());
-		InstanceDescription id = instance.getInstanceDescription();
+		PrimitiveInstanceDescription id = (PrimitiveInstanceDescription) instance.getInstanceDescription();
 		assertTrue("Check instance state", id.getState() == ComponentInstance.VALID);
 		assertEquals("Check created pojo count", id.getCreatedObjects().length, 1);
 		assertEquals("Check instance description name", id.getName(), compName); 



Mime
View raw message