felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r722146 [3/15] - in /felix/trunk/ipojo: examples/junit4osgi/felix-command/ examples/junit4osgi/immediate-launcher/ examples/junit4osgi/junit4osgi/ examples/junit4osgi/maven-junit4osgi-plugin/ examples/junit4osgi/swing-runner/ tests/composit...
Date Mon, 01 Dec 2008 17:44:17 GMT
Modified: felix/trunk/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp7.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp7.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp7.java (original)
+++ felix/trunk/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp7.java Mon Dec  1 09:44:13 2008
@@ -40,9 +40,9 @@
     private ComponentInstance under;
     
     public void setUp() {
-        tataFactory = (ComponentFactory) Utils.getFactoryByName(context, "tata");
-        totoFactory = (ComponentFactory) Utils.getFactoryByName(context, "toto");
-        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(context, "comp-6");
+        tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
+        totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
+        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "comp-6");
         tataFactory2.stop();
         
         Properties props = new Properties();
@@ -64,7 +64,7 @@
         totoProv.stop();
         totoProv2.stop();
         
-        Factory factory = Utils.getFactoryByName(context, "comp-7");
+        Factory factory = Utils.getFactoryByName(getContext(), "comp-7");
         Properties props2 = new Properties();
         props2.put("instance.name","ff");
         try {
@@ -95,19 +95,19 @@
     public void testSimple() {
         // Neither factory nor instance
         assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 1", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 1", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the importer
         totoProv.start();
         assertTrue("Assert under state - 2", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 2", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 2", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the factory
         tataFactory.start();
         assertTrue("Assert under state - 3", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 3", context.getServiceReference(Tota.class.getName()));
-        ServiceReference ref = context.getServiceReference(Tota.class.getName());
-        Tota tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 3", getContext().getServiceReference(Tota.class.getName()));
+        ServiceReference ref = getContext().getServiceReference(Tota.class.getName());
+        Tota tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         Properties props = tota.getProps();
@@ -141,15 +141,15 @@
         assertEquals("Assert tata5 - 3", tata5.intValue(), 1);
         assertEquals("Assert tata5_1 - 3", tata5_1.intValue(), 1);
         assertEquals("Assert tata5_2 - 3", tata5_2.intValue(), 1);
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Start a second import
         totoProv2.start();
         assertTrue("Assert under state - 4", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 4", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 4", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         props = tota.getProps();
@@ -184,19 +184,19 @@
         assertEquals("Assert tata5_1 - 4", tata5_1.intValue(), 2);
         assertEquals("Assert tata5_2 - 4", tata5_2.intValue(), 2);
 
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         tataFactory.stop();
         assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 5", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 5", getContext().getServiceReference(Tota.class.getName()));
         
         totoProv2.stop();
         tataFactory.start();
         assertTrue("Assert under state - 6", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 6", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 6", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         props = tota.getProps();
@@ -230,17 +230,17 @@
         assertEquals("Assert tata5 - 6", tata5.intValue(), 1);
         assertEquals("Assert tata5_1 - 6", tata5_1.intValue(), 1);
         assertEquals("Assert tata5_2 - 6", tata5_2.intValue(), 1);
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Is arch exposed
-        assertNotNull("Test arch", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
+        assertNotNull("Test arch", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
         
         totoProv.stop();
         
         assertTrue("Assert under state - 7", under.getState() == ComponentInstance.INVALID);
-        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
-        assertNull("Assert no tota service - 7", context.getServiceReference(Tota.class.getName()));
+        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
+        assertNull("Assert no tota service - 7", getContext().getServiceReference(Tota.class.getName()));
         
         under.dispose();
         under = null;

Modified: felix/trunk/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp8.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp8.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp8.java (original)
+++ felix/trunk/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp8.java Mon Dec  1 09:44:13 2008
@@ -41,9 +41,9 @@
     private ComponentInstance under;
     
     public void setUp() {
-        tataFactory = (ComponentFactory) Utils.getFactoryByName(context, "tata");
-        totoFactory = (ComponentFactory) Utils.getFactoryByName(context, "toto");
-        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(context, "comp-6");
+        tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
+        totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
+        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "comp-6");
         tataFactory2.stop();
         
         Properties props = new Properties();
@@ -65,7 +65,7 @@
         totoProv.stop();
         totoProv2.stop();
         
-        Factory factory = Utils.getFactoryByName(context, "comp-8");
+        Factory factory = Utils.getFactoryByName(getContext(), "comp-8");
         Properties props2 = new Properties();
         props2.put("instance.name","ff");
         try {
@@ -101,19 +101,19 @@
     public void testSimple() {        
         // Neither factory nor instance
         assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 1", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 1", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the importer
         totoProv.start();
         assertTrue("Assert under state - 2", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 2", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 2", getContext().getServiceReference(Tota.class.getName()));
         
         // Start the factory
         tataFactory.start();
         assertTrue("Assert under state - 3", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 3", context.getServiceReference(Tota.class.getName()));
-        ServiceReference ref = context.getServiceReference(Tota.class.getName());
-        Tota tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 3", getContext().getServiceReference(Tota.class.getName()));
+        ServiceReference ref = getContext().getServiceReference(Tota.class.getName());
+        Tota tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         Properties props = tota.getProps();
@@ -155,15 +155,15 @@
         assertEquals("Assert tata5 - 3", tata5.intValue(), 1);
         assertEquals("Assert tata5_1 - 3", tata5_1.intValue(), 1);
         assertEquals("Assert tata5_2 - 3", tata5_2.intValue(), 1);
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Start a second import
         totoProv2.start();
         assertTrue("Assert under state - 4", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 4", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 4", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         props = tota.getProps();
@@ -206,19 +206,19 @@
         assertEquals("Assert tata5_1 - 4", tata5_1.intValue(), 2);
         assertEquals("Assert tata5_2 - 4", tata5_2.intValue(), 2);
 
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         tataFactory.stop();
         assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 5", context.getServiceReference(Tota.class.getName()));
+        assertNull("Assert no tota service - 5", getContext().getServiceReference(Tota.class.getName()));
         
         totoProv2.stop();
         tataFactory.start();
         assertTrue("Assert under state - 6", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 6", context.getServiceReference(Tota.class.getName()));
-        ref = context.getServiceReference(Tota.class.getName());
-        tota = (Tota) context.getService(ref);
+        assertNotNull("Assert tota service - 6", getContext().getServiceReference(Tota.class.getName()));
+        ref = getContext().getServiceReference(Tota.class.getName());
+        tota = (Tota) getContext().getService(ref);
         invokeAll(tota);
         // Check toto
         props = tota.getProps();
@@ -260,17 +260,17 @@
         assertEquals("Assert tata5 - 6", tata5.intValue(), 1);
         assertEquals("Assert tata5_1 - 6", tata5_1.intValue(), 1);
         assertEquals("Assert tata5_2 - 6", tata5_2.intValue(), 1);
-        context.ungetService(ref);
+        getContext().ungetService(ref);
         tota = null;
         
         // Is arch exposed
-        assertNotNull("Test arch", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
+        assertNotNull("Test arch", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
         
         totoProv.stop();
         
         assertTrue("Assert under state - 7", under.getState() == ComponentInstance.INVALID);
-        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(context, Architecture.class.getName(), "ff"));
-        assertNull("Assert no tota service - 7", context.getServiceReference(Tota.class.getName()));
+        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
+        assertNull("Assert no tota service - 7", getContext().getServiceReference(Tota.class.getName()));
         
         under.dispose();
         under = null;

Modified: felix/trunk/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/test/CompositeTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/test/CompositeTest.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/test/CompositeTest.java (original)
+++ felix/trunk/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/test/CompositeTest.java Mon Dec  1 09:44:13 2008
@@ -34,7 +34,7 @@
 public class CompositeTest extends OSGiTestCase {
 	
 	public void testAPI() {
-		Factory fact1 = Utils.getFactoryByName(context, "composite.empty");
+		Factory fact1 = Utils.getFactoryByName(getContext(), "composite.empty");
 		Properties p = new Properties();
 		p.put("instance.name","empty-1");
 		ComponentInstance empty = null;
@@ -47,10 +47,10 @@
 		
 		ServiceContext sc = Utils.getServiceContext(empty);
 		
-		Factory fact2 = Utils.getFactoryByName(context, "composite.test.2");
+		Factory fact2 = Utils.getFactoryByName(getContext(), "composite.test.2");
 		Properties props2 = new Properties();
 		props2.put("instance.name","2"); // 2
-		Factory fact3 = Utils.getFactoryByName(context, "composite.test.3");
+		Factory fact3 = Utils.getFactoryByName(getContext(), "composite.test.3");
 		Properties props3 = new Properties();
 		props3.put("instance.name","3");
 		ComponentInstance comp2 = null;
@@ -81,7 +81,7 @@
 	
 	public void testInstantiator() {
 		String type = "composite.instantiator";
-		Factory fact = Utils.getFactoryByName(context, type);
+		Factory fact = Utils.getFactoryByName(getContext(), type);
 		ComponentInstance ci = null;
 		Properties p = new Properties();
 		p.put("instance.name","mon_coeur");
@@ -92,21 +92,21 @@
 		}
 				
 		assertTrue("Check ci", ci.getState() == ComponentInstance.VALID);
-		ServiceReference ref = Utils.getServiceReferenceByName(context, BazService.class.getName(), "mon_coeur");
+		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), "mon_coeur");
 		assertNotNull("Check ref",ref);
-		BazService bs = (BazService) context.getService(ref);
+		BazService bs = (BazService) getContext().getService(ref);
 		assertTrue("Check invocation", bs.foo());
-		context.ungetService(ref);
-		ref = Utils.getServiceReferenceByName(context, FooService.class.getName(), "mon_coeur");
+		getContext().ungetService(ref);
+		ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "mon_coeur");
 		assertNotNull("Check ref 2 ",ref);
-		FooService fs = (FooService) context.getService(ref);
+		FooService fs = (FooService) getContext().getService(ref);
 		assertTrue("Check invocation", fs.foo());
-		context.ungetService(ref);
+		getContext().ungetService(ref);
 		ci.dispose();
 	}
 	
 	public void testAPI2() {
-		Factory fact1 = Utils.getFactoryByName(context, "composite.empty");
+		Factory fact1 = Utils.getFactoryByName(getContext(), "composite.empty");
 		Properties p = new Properties();
 		p.put("instance.name","empty-2");
 		ComponentInstance empty = null;
@@ -151,7 +151,7 @@
 
 	
 	public void testApplication() {
-		Factory factory = Utils.getFactoryByName(context, "composite.test.1");
+		Factory factory = Utils.getFactoryByName(getContext(), "composite.test.1");
 		ComponentInstance ci = null;
 		Properties props = new Properties();
 		props.put("instance.name","Test");
@@ -165,12 +165,12 @@
 		
 		ServiceReference[] refs = null;
 		try {
-			refs = context.getServiceReferences(CheckService.class.getName(), "(instance.name=Test)");
+			refs = getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=Test)");
 		} catch (InvalidSyntaxException e) {
 			fail("Invalid filter : " + e.getMessage());
 		}
 		assertNotNull("Check refs not null", refs);
-		CheckService cs = (CheckService) context.getService(refs[0]);
+		CheckService cs = (CheckService) getContext().getService(refs[0]);
 		
 		assertTrue("Check invocation", cs.check());
 		ci.dispose();

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AggregateDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AggregateDependency.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AggregateDependency.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AggregateDependency.java Mon Dec  1 09:44:13 2008
@@ -1,15 +1,18 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class AggregateDependency extends OSGiTestCase {
     
-    private Element[] deps ;
+    private Element[] deps;
+    
+    private IPOJOHelper helper;
     
     public void setUp() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.AggregateDependency");
+        helper = new IPOJOHelper(this);
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.AggregateDependency");
         deps = meta.getElements("requires");
     }
     

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Architecture.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Architecture.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Architecture.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Architecture.java Mon Dec  1 09:44:13 2008
@@ -1,20 +1,28 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class Architecture extends OSGiTestCase {
     
+    
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
+    
     public void testArch() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Arch");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Arch");
         String arch = meta.getAttribute("architecture");
         assertNotNull("Architecture exists ", arch);
         assertEquals("Architecture value", "true", arch);
     }
     
     public void testNoArch() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NoArch");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.NoArch");
         String arch = meta.getAttribute("architecture");
         assertNotNull("Architecture exists ", arch);
         assertEquals("Architecture value", "false", arch);

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java Mon Dec  1 09:44:13 2008
@@ -1,13 +1,19 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class Dependency extends OSGiTestCase {
     
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
     public void testDependencyDeclaration() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Dependency");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Dependency");
         Element[] deps = meta.getElements("requires");
         
         // Check fs

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java Mon Dec  1 09:44:13 2008
@@ -1,17 +1,19 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class EventAdmin extends OSGiTestCase {
     String type = "org.apache.felix.ipojo.test.scenarios.component.event.PubSub";
     String namespace = "org.apache.felix.ipojo.handlers.event";
     
     Element component;
+    private IPOJOHelper helper;
     
     public void setUp() {
-        component = Utils.getMetatadata(context, type);
+        helper = new IPOJOHelper(this);
+        component = helper.getMetadata(type);
         assertNotNull("Check component", component);
     }
     

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java Mon Dec  1 09:44:13 2008
@@ -1,17 +1,22 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class Extender extends OSGiTestCase {
     
     String type = "org.apache.felix.ipojo.test.scenarios.component.extender.Extender";
     String namespace = "org.apache.felix.ipojo.extender";
-
+    
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
     
     public void testMetadata() {
-        Element meta = Utils.getMetatadata(context, type);
+        Element meta = helper.getMetadata(type);
         assertNotNull("Check meta", meta);
         Element[] ext = meta.getElements("extender", namespace);
         assertEquals("Check size", 1, ext.length);

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java Mon Dec  1 09:44:13 2008
@@ -1,13 +1,19 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class Factory extends OSGiTestCase {
     
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
     public void testArch() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Factory");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Factory");
         String fact = meta.getAttribute("public");
         String name = meta.getAttribute("name");
         assertNotNull("Factory exists ", fact);
@@ -17,7 +23,7 @@
     }
     
     public void testNoArch() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NoFactory");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.NoFactory");
         String fact = meta.getAttribute("public");
         String name = meta.getAttribute("name");
         assertNotNull("Factory exists ", fact);

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/FilteredDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/FilteredDependency.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/FilteredDependency.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/FilteredDependency.java Mon Dec  1 09:44:13 2008
@@ -1,19 +1,21 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class FilteredDependency extends OSGiTestCase {
     
     private Element[] deps ;
     private Element[] froms;
+    private IPOJOHelper helper;
     
     public void setUp() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.FilteredDependency");
+        helper = new IPOJOHelper(this);
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.FilteredDependency");
         deps = meta.getElements("requires");
         
-        Element meta2 = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.FromDependency");
+        Element meta2 = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.FromDependency");
         froms = meta2.getElements("requires");
     }
     

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java Mon Dec  1 09:44:13 2008
@@ -1,13 +1,19 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class JMX extends OSGiTestCase {
     
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
     public void testSimple() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.jmx.JMXSimple");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.jmx.JMXSimple");
         /*
          * org.apache.felix.ipojo.handlers.jmx:config domain="my-domain" usesmosgi="false"
         org.apache.felix.ipojo.handlers.jmx:property field="m_foo" name="prop" rights="w" notification="true"

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleCallbacks.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleCallbacks.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleCallbacks.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleCallbacks.java Mon Dec  1 09:44:13 2008
@@ -1,13 +1,19 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class LifecycleCallbacks extends OSGiTestCase {
     
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
     public void testCallbacks() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Lifecycle");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Lifecycle");
         Element[] cbs = meta.getElements("callback");
         assertNotNull("Callbacks exists ", cbs);
         assertEquals("Callbacks count ", 2, cbs.length);
@@ -22,13 +28,13 @@
     }
     
     public void testImmediate() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Immediate");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Immediate");
         assertNotNull("Immediate attribute", meta.getAttribute("immediate"));
         assertEquals("Immediate attribute value", "true", meta.getAttribute("immediate"));
     }
     
     public void testNoImmediate() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NoImmediate");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.NoImmediate");
         assertNotNull("Immediate attribute", meta.getAttribute("immediate"));
         assertEquals("Immediate attribute value", "false", meta.getAttribute("immediate"));
     }

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleController.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleController.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleController.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleController.java Mon Dec  1 09:44:13 2008
@@ -1,13 +1,19 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class LifecycleController extends OSGiTestCase {
     
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
     public void testLFC() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Lifecycle");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Lifecycle");
         Element[] ctrls = meta.getElements("controller");
         assertNotNull("Controller exists ", ctrls);
         Element ctrl = ctrls[0];

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/OptionalDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/OptionalDependency.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/OptionalDependency.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/OptionalDependency.java Mon Dec  1 09:44:13 2008
@@ -1,16 +1,18 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.test.scenarios.component.ProvidesSimple;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class OptionalDependency extends OSGiTestCase {
     
     private Element[] deps ;
+    private IPOJOHelper helper;
     
     public void setUp() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.OptionalDependency");
+        helper = new IPOJOHelper(this);
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.OptionalDependency");
         deps = meta.getElements("requires");
     }
     
@@ -57,7 +59,7 @@
     }
     
     public void testNullable() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NullableDependency");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.NullableDependency");
         Element[] deps = meta.getElements("requires");
         Element fs = getDependencyById(deps, "fs");
         String nullable = fs.getAttribute("nullable");
@@ -66,7 +68,7 @@
     }
     
     public void testNoNullable() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NullableDependency");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.NullableDependency");
         Element[] deps = meta.getElements("requires");
         Element fs = getDependencyById(deps, "fs2");
         String nullable = fs.getAttribute("nullable");
@@ -75,7 +77,7 @@
     }
     
     public void testDefaultImplmentation() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.DefaultImplementationDependency");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.DefaultImplementationDependency");
         Element[] deps = meta.getElements("requires");
         Element fs = getDependencyById(deps, "fs");
         String di = fs.getAttribute("default-implementation");
@@ -99,25 +101,5 @@
         fail("Dependency  " + name + " not found");
         return null;
     }
-    
-    private String getBind(Element dep) {
-        Element[] elem = dep.getElements("callback");
-        for (int i = 0; elem != null && i < elem.length; i++) {
-            if (elem[i].getAttribute("type").equalsIgnoreCase("bind")) {
-                return elem[i].getAttribute("method");
-            }
-        }
-        return null;
-    }
-    
-    private String getUnbind(Element dep) {
-        Element[] elem = dep.getElements("callback");
-        for (int i = 0; elem != null && i < elem.length; i++) {
-            if (elem[i].getAttribute("type").equalsIgnoreCase("unbind")) {
-                return elem[i].getAttribute("method");
-            }
-        }
-        return null;
-    }
 
 }

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/PolicyDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/PolicyDependency.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/PolicyDependency.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/PolicyDependency.java Mon Dec  1 09:44:13 2008
@@ -1,15 +1,17 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class PolicyDependency extends OSGiTestCase {
     
     private Element[] deps ;
+    private IPOJOHelper helper;
     
     public void setUp() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.PolicyDependency");
+        helper = new IPOJOHelper(this);
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.PolicyDependency");
         deps = meta.getElements("requires");
     }
     
@@ -71,25 +73,5 @@
         fail("Dependency  " + name + " not found");
         return null;
     }
-    
-    private String getBind(Element dep) {
-        Element[] elem = dep.getElements("callback");
-        for (int i = 0; elem != null && i < elem.length; i++) {
-            if (elem[i].getAttribute("type").equalsIgnoreCase("bind")) {
-                return elem[i].getAttribute("method");
-            }
-        }
-        return null;
-    }
-    
-    private String getUnbind(Element dep) {
-        Element[] elem = dep.getElements("callback");
-        for (int i = 0; elem != null && i < elem.length; i++) {
-            if (elem[i].getAttribute("type").equalsIgnoreCase("unbind")) {
-                return elem[i].getAttribute("method");
-            }
-        }
-        return null;
-    }
 
 }

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java Mon Dec  1 09:44:13 2008
@@ -1,13 +1,19 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class Properties extends OSGiTestCase {
     
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
     public void testProperties() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Properties");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Properties");
         Element[] provs = meta.getElements("properties");
         assertNotNull("Properties exists ", provs);
         Element prov = provs[0];
@@ -40,7 +46,7 @@
     }
     
     public void testAbsentPropagation() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Properties");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Properties");
         Element[] provs = meta.getElements("properties");
         assertNotNull("Properties exists ", provs);
         Element prov = provs[0];
@@ -49,7 +55,7 @@
     }
     
     public void testPropagation() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Propagation");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Propagation");
         Element[] provs = meta.getElements("properties");
         assertNotNull("Properties exists ", provs);
         Element prov = provs[0];
@@ -59,7 +65,7 @@
     }
     
     public void testNoPropagation() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NoPropagation");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.NoPropagation");
         Element[] provs = meta.getElements("properties");
         assertNotNull("Properties exists ", provs);
         Element prov = provs[0];
@@ -69,7 +75,7 @@
     }
     
     public void testPID() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.ManagedServicePID");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.ManagedServicePID");
         Element[] provs = meta.getElements("properties");
         assertNotNull("Properties exists ", provs);
         Element prov = provs[0];
@@ -79,7 +85,7 @@
     }
     
     public void testAbsentPID() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Properties");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Properties");
         Element[] provs = meta.getElements("properties");
         assertNotNull("Properties exists ", provs);
         Element prov = provs[0];
@@ -88,7 +94,7 @@
     }
     
     public void testPropagationAndPID() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.PropagationandPID");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.PropagationandPID");
         Element[] provs = meta.getElements("properties");
         assertNotNull("Properties exists ", provs);
         Element prov = provs[0];
@@ -101,7 +107,7 @@
     }
     
     public void testPIDAndPropagation() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.PIDandPropagation");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.PIDandPropagation");
         Element[] provs = meta.getElements("properties");
         assertNotNull("Properties exists ", provs);
         Element prov = provs[0];

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/RankedDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/RankedDependency.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/RankedDependency.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/RankedDependency.java Mon Dec  1 09:44:13 2008
@@ -1,16 +1,19 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.test.scenarios.component.MyComparator;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class RankedDependency extends OSGiTestCase {
     
     private Element[] deps ;
     
+    private IPOJOHelper helper;
+    
     public void setUp() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.RankedDependency");
+        helper = new IPOJOHelper(this);
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.RankedDependency");
         deps = meta.getElements("requires");
     }
     

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java Mon Dec  1 09:44:13 2008
@@ -3,30 +3,34 @@
 import java.util.List;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.parser.ParseUtils;
 import org.apache.felix.ipojo.test.scenarios.annotations.service.CheckService;
 import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class ServiceProdiving extends OSGiTestCase {
     
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
     public void testProvidesSimple() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.ProvidesSimple");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.ProvidesSimple");
         Element[] provs = meta.getElements("provides");
         assertNotNull("Provides exists ", provs);
-        Element prov = provs[0];
     }
     
     public void testProvidesDouble() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.ProvidesDouble");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.ProvidesDouble");
         Element[] provs = meta.getElements("provides");
         assertNotNull("Provides exists ", provs);
-        Element prov = provs[0];
     }
     
     public void testProvidesTriple() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.ProvidesTriple");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.ProvidesTriple");
         Element[] provs = meta.getElements("provides");
         assertNotNull("Provides exists ", provs);
         Element prov = provs[0];
@@ -36,7 +40,7 @@
     }
     
     public void testProvidesQuatro() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.ProvidesQuatro");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.ProvidesQuatro");
         Element[] provs = meta.getElements("provides");
         assertNotNull("Provides exists ", provs);
         Element prov = provs[0];
@@ -47,7 +51,7 @@
     }
     
     public void testProperties() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.ProvidesProperties");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.ProvidesProperties");
         Element[] provs = meta.getElements("provides");
         assertNotNull("Provides exists ", provs);
         Element prov = provs[0];

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/TemporalDependencies.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/TemporalDependencies.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/TemporalDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/TemporalDependencies.java Mon Dec  1 09:44:13 2008
@@ -1,13 +1,19 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class TemporalDependencies extends OSGiTestCase {
     
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
     public void testSimple() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalSimple");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalSimple");
         Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
         assertNotNull("Temporal exists ", provs);
         String field = provs[0].getAttribute("field");
@@ -20,7 +26,7 @@
     }
     
     public void testDI() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithDI");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithDI");
         Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
         assertNotNull("Temporal exists ", provs);
         String field = provs[0].getAttribute("field");
@@ -33,7 +39,7 @@
     }
     
     public void testEmptyArray() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithEmptyArray");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithEmptyArray");
         Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
         assertNotNull("Temporal exists ", provs);
         String field = provs[0].getAttribute("field");
@@ -46,7 +52,7 @@
     }
     
     public void testNull() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithNull");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithNull");
         Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
         assertNotNull("Temporal exists ", provs);
         String field = provs[0].getAttribute("field");
@@ -59,7 +65,7 @@
     }
     
     public void testNullable() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithNullable");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithNullable");
         Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
         assertNotNull("Temporal exists ", provs);
         String field = provs[0].getAttribute("field");
@@ -72,7 +78,7 @@
     }
     
     public void testFilter() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithFilter");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithFilter");
         Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
         assertNotNull("Temporal exists ", provs);
         String field = provs[0].getAttribute("field");
@@ -85,7 +91,7 @@
     }
     
     public void testTimeout() {
-        Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithTimeout");
+        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalWithTimeout");
         Element[] provs = meta.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
         assertNotNull("Temporal exists ", provs);
         String field = provs[0].getAttribute("field");

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java Mon Dec  1 09:44:13 2008
@@ -1,8 +1,8 @@
 package org.apache.felix.ipojo.test.scenarios.annotations;
 
 import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
 
 public class WhiteBoard extends OSGiTestCase {
     
@@ -10,8 +10,14 @@
     String typeWO = "org.apache.felix.ipojo.test.scenarios.component.whiteboard.WhiteBoardWOModification";
     String namespace = "org.apache.felix.ipojo.whiteboard";
     
+    private IPOJOHelper helper;
+    
+    public void setUp() {
+        helper = new IPOJOHelper(this);
+    }
+    
     public void testMetadataWithOnModification() {
-        Element meta = Utils.getMetatadata(context, typeWI);
+        Element meta = helper.getMetadata(typeWI);
         assertNotNull("Check meta", meta);
         Element[] ext = meta.getElements("wbp", namespace);
         assertEquals("Check size", 1, ext.length);
@@ -29,7 +35,7 @@
     }
     
     public void testMetadataWithoutOnModification() {
-        Element meta = Utils.getMetatadata(context, typeWO);
+        Element meta = helper.getMetadata(typeWO);
         assertNotNull("Check meta", meta);
         Element[] ext = meta.getElements("wbp", namespace);
         assertEquals("Check size", 1, ext.length);

Modified: felix/trunk/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java (original)
+++ felix/trunk/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java Mon Dec  1 09:44:13 2008
@@ -50,7 +50,7 @@
     
     public void testBadFactory() {
         try {
-            new ComponentFactory(context, getElementFactoryWithNoClassName());
+            new ComponentFactory(getContext(), getElementFactoryWithNoClassName());
             fail("A factory with no class name must be rejected");
         } catch (ConfigurationException e) {
           // OK.   
@@ -59,7 +59,7 @@
     
     public void testBadHandlerFactory1() {
         try {
-            new HandlerManagerFactory(context, getElementHandlerFactoryWithNoClassName());
+            new HandlerManagerFactory(getContext(), getElementHandlerFactoryWithNoClassName());
             fail("An handler factory with no class name must be rejected");
         } catch (ConfigurationException e) {
           // OK.   
@@ -68,7 +68,7 @@
     
     public void testBadHandlerFactory2() {
         try {
-            new HandlerManagerFactory(context, getElementHandlerFactoryWithNoName());
+            new HandlerManagerFactory(getContext(), getElementHandlerFactoryWithNoName());
             fail("An handler factory with no name must be rejected");
         } catch (ConfigurationException e) {
           // OK.   
@@ -76,7 +76,7 @@
     }
     
     public void testCreationOnBadConstructor() {
-            Factory factory = Utils.getFactoryByName(context, "BAD-BadConstructor");
+            Factory factory = Utils.getFactoryByName(getContext(), "BAD-BadConstructor");
             ComponentInstance ci;
             try {
                 ci = factory.createComponentInstance(null);
@@ -88,7 +88,7 @@
     }
     
     public void testCreationOnBadFactory() {
-        Factory factory = Utils.getFactoryByName(context, "BAD-BadFactory");
+        Factory factory = Utils.getFactoryByName(getContext(), "BAD-BadFactory");
         ComponentInstance ci;
         try {
             ci = factory.createComponentInstance(null);
@@ -100,7 +100,7 @@
     }
     
     public void testCreationOnBadFactory2() {
-        Factory factory = Utils.getFactoryByName(context, "BAD-BadFactory2");
+        Factory factory = Utils.getFactoryByName(getContext(), "BAD-BadFactory2");
         ComponentInstance ci;
         try {
             ci = factory.createComponentInstance(null);
@@ -115,7 +115,7 @@
         Element elem = new Element("component", "");
         elem.addAttribute(new Attribute("classname", "org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"));
         try {
-            ComponentFactory fact = new ComponentFactory(context, elem);
+            ComponentFactory fact = new ComponentFactory(getContext(), elem);
             fact.stop();
             fail("A factory with no manipulation metadata must be rejected");
         } catch (ConfigurationException e) {

Modified: felix/trunk/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCCallback.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCCallback.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCCallback.java (original)
+++ felix/trunk/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCCallback.java Mon Dec  1 09:44:13 2008
@@ -114,7 +114,7 @@
     }
     
     private Element getManipulationForComponent() {
-        String header = (String) context.getBundle().getHeaders().get("iPOJO-Components");
+        String header = (String) getContext().getBundle().getHeaders().get("iPOJO-Components");
         Element elem = null;
         try {
             elem = ManifestMetadataParser.parseHeaderMetadata(header);
@@ -144,7 +144,7 @@
     
     public void testNothing() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getNothing());
+            ComponentFactory cf = new ComponentFactory(getContext(), getNothing());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();
@@ -161,7 +161,7 @@
     
     public void testNoTransition() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getNoTransition());
+            ComponentFactory cf = new ComponentFactory(getContext(), getNoTransition());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();
@@ -178,7 +178,7 @@
     
     public void testNoMethod() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getNoMethod());
+            ComponentFactory cf = new ComponentFactory(getContext(), getNoMethod());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();
@@ -195,7 +195,7 @@
     
     public void testBadMethod() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getBadMethod());
+            ComponentFactory cf = new ComponentFactory(getContext(), getBadMethod());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             if (ci.isStarted()) {
@@ -215,7 +215,7 @@
     
     public void testBadMethod2() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getBadMethod2());
+            ComponentFactory cf = new ComponentFactory(getContext(), getBadMethod2());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.stop();
@@ -236,7 +236,7 @@
     
     public void testBadTransition() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getBadTransition());
+            ComponentFactory cf = new ComponentFactory(getContext(), getBadTransition());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();

Modified: felix/trunk/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCController.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCController.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCController.java (original)
+++ felix/trunk/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCController.java Mon Dec  1 09:44:13 2008
@@ -50,7 +50,7 @@
     }
     
     private Element getManipulationForComponent(String comp_name) {
-        String header = (String) context.getBundle().getHeaders().get("iPOJO-Components");
+        String header = (String) getContext().getBundle().getHeaders().get("iPOJO-Components");
         Element elem = null;
         try {
             elem = ManifestMetadataParser.parseHeaderMetadata(header);
@@ -77,7 +77,7 @@
     
     public void testNoField() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getNoFieldController());
+            ComponentFactory cf = new ComponentFactory(getContext(), getNoFieldController());
             cf.start();
             cf.stop();
             fail("A lifecycle controller with a missing field must be rejected " + cf);
@@ -88,7 +88,7 @@
     
     public void testBadField() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getBadFieldController());
+            ComponentFactory cf = new ComponentFactory(getContext(), getBadFieldController());
             cf.start();
             cf.stop();
             fail("A lifecycle controller with a bad field must be rejected " + cf);

Modified: felix/trunk/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadServiceDependencies.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadServiceDependencies.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadServiceDependencies.java (original)
+++ felix/trunk/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadServiceDependencies.java Mon Dec  1 09:44:13 2008
@@ -128,7 +128,7 @@
     
     
     private Element getManipulationForComponent() {
-        String header = (String) context.getBundle().getHeaders().get("iPOJO-Components");
+        String header = (String) getContext().getBundle().getHeaders().get("iPOJO-Components");
         Element elem = null;
         try {
             elem = ManifestMetadataParser.parse(header);
@@ -158,7 +158,7 @@
     
     public void testNothing() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getNothing());
+            ComponentFactory cf = new ComponentFactory(getContext(), getNothing());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();
@@ -175,7 +175,7 @@
     
     public void testNoField() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getNoField());
+            ComponentFactory cf = new ComponentFactory(getContext(), getNoField());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();
@@ -192,7 +192,7 @@
     
     public void testBadField() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getBadField());
+            ComponentFactory cf = new ComponentFactory(getContext(), getBadField());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();
@@ -209,7 +209,7 @@
     
     public void testBadFilter() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getBadFilter());
+            ComponentFactory cf = new ComponentFactory(getContext(), getBadFilter());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();
@@ -226,7 +226,7 @@
     
     public void testBadFrom() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getBadFrom());
+            ComponentFactory cf = new ComponentFactory(getContext(), getBadFrom());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();
@@ -243,7 +243,7 @@
     
     public void testBadType() {
         try {
-            ComponentFactory cf = new ComponentFactory(context, getBadType());
+            ComponentFactory cf = new ComponentFactory(getContext(), getBadType());
             cf.start();
             ComponentInstance ci = cf.createComponentInstance(props);
             ci.dispose();

Modified: felix/trunk/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForImmediate.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForImmediate.java?rev=722146&r1=722145&r2=722146&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForImmediate.java (original)
+++ felix/trunk/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForImmediate.java Mon Dec  1 09:44:13 2008
@@ -20,8 +20,8 @@
     private ConfigurationAdmin admin;
     
     public void setUp() {
-        factory = (ComponentFactory) Utils.getFactoryByName(context, "CA-ImmConfigurableProvider");
-        admin = (ConfigurationAdmin) Utils.getServiceObject(context, ConfigurationAdmin.class.getName(), null);
+        factory = (ComponentFactory) Utils.getFactoryByName(getContext(), "CA-ImmConfigurableProvider");
+        admin = (ConfigurationAdmin) Utils.getServiceObject(getContext(), ConfigurationAdmin.class.getName(), null);
         assertNotNull("Check configuration admin availability", admin);
         try {
             Configuration[] configurations = admin.listConfigurations("(service.factoryPid=CA-ImmConfigurableProvider)");
@@ -77,16 +77,16 @@
         String pid = configuration.getPid();
         
         //  The instance should be created, wait for the architecture service
-        Utils.waitForService(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
-        Architecture architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Check object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
         
-        FooService fs = (FooService) Utils.getServiceObject(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message", mes);
         assertEquals("Assert count", 1, count);
@@ -101,11 +101,11 @@
             fail(e.getMessage());
         }
         
-        fs = (FooService) Utils.getServiceObject(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         assertEquals("Assert count", 2, count);
@@ -118,7 +118,7 @@
             fail(e.getMessage());
         }
         
-        ServiceReference ref = Utils.getServiceReference(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         assertNull("Check unavailability", ref);
     }
     
@@ -146,8 +146,8 @@
         System.out.println("PID : " + pid);
         
         //  The instance should be created, wait for the architecture service
-        Utils.waitForService(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
-        Architecture architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Check object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
         
@@ -160,16 +160,16 @@
             fail(e.getMessage());
         }
         
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Check object -2", 1, architecture.getInstanceDescription().getCreatedObjects().length);
         
         //Invoke
-        FooService fs = (FooService) Utils.getServiceObject(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         assertEquals("Assert count", 2, count);
@@ -182,7 +182,7 @@
             fail(e.getMessage());
         }
         
-        ServiceReference ref = Utils.getServiceReference(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         assertNull("Check unavailability", ref);
     }
     
@@ -208,22 +208,22 @@
         
         String pid = configuration.getPid();
         
-        assertNull("check no instance", Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")"));
+        assertNull("check no instance", Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")"));
         
         factory.start();
         
         
         //  The instance should be created, wait for the architecture service
-        Utils.waitForService(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
-        Architecture architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Check object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
         
-        FooService fs = (FooService) Utils.getServiceObject(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message", mes);
         assertEquals("Assert count", 1, count);
@@ -238,11 +238,11 @@
             fail(e.getMessage());
         }
         
-        fs = (FooService) Utils.getServiceObject(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         p = fs.fooProps();
         mes = p.getProperty("message");
         count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         //assertEquals("Assert count", 2, count);
@@ -256,7 +256,7 @@
             fail(e.getMessage());
         }
         
-        ServiceReference ref = Utils.getServiceReference(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         assertNull("Check unavailability", ref);
     }
     
@@ -283,14 +283,14 @@
         
         String pid = configuration.getPid();
         
-        assertNull("check no instance", Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")"));
+        assertNull("check no instance", Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")"));
         
         factory.start();
         
         
         //  The instance should be created, wait for the architecture service
-        Utils.waitForService(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
-        Architecture architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
+        Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Check object", 1, architecture.getInstanceDescription().getCreatedObjects().length);
         
@@ -303,16 +303,16 @@
             fail(e.getMessage());
         }
         
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Check object -1", 1, architecture.getInstanceDescription().getCreatedObjects().length);
         
         //Invoke
-        FooService fs = (FooService) Utils.getServiceObject(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         Properties p = fs.fooProps();
         String mes = p.getProperty("message");
         int count = ((Integer) p.get("count")).intValue();
-        architecture = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance="+pid+")");
+        architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
         
         assertEquals("Assert Message", "message2", mes);
         assertEquals("Assert count", 2, count);
@@ -325,7 +325,7 @@
             fail(e.getMessage());
         }
         
-        ServiceReference ref = Utils.getServiceReference(context, FooService.class.getName(), "(instance.name=" + pid + ")");
+        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
         assertNull("Check unavailability", ref);
     }
     



Mime
View raw message