diff --git a/ipojo/tests/api/pom.xml b/ipojo/tests/api/pom.xml
index 6424e52..4d8faed 100644
--- a/ipojo/tests/api/pom.xml
+++ b/ipojo/tests/api/pom.xml
@@ -17,6 +17,19 @@
 					<target>1.5</target>
 				</configuration>
 			</plugin>
+			<plugin>
+				<groupId>org.apache.servicemix.tooling</groupId>
+				<artifactId>depends-maven-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>generate-depends-file</id>
+						<goals>
+							<goal>generate-depends-file</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			
 			<!--  <plugin>
 				<groupId>org.ops4j.pax.exam</groupId>
 				<artifactId>maven-paxexam-plugin</artifactId>
diff --git a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/AppTest.java b/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/AppTest.java
deleted file mode 100644
index fc6e827..0000000
--- a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/AppTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.apache.felix.ipojo.tests.api;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Unit test for simple App.
- */
-public class AppTest 
-    extends TestCase
-{
-    /**
-     * Create the test case
-     *
-     * @param testName name of the test case
-     */
-    public AppTest( String testName )
-    {
-        super( testName );
-    }
-
-    /**
-     * @return the suite of tests being tested
-     */
-    public static Test suite()
-    {
-        return new TestSuite( AppTest.class );
-    }
-
-    /**
-     * Rigourous Test :-)
-     */
-    public void testApp()
-    {
-        assertTrue( true );
-    }
-}
diff --git a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/CompositeTest.java b/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/CompositeTest.java
index e9f1aa1..e2b3128 100644
--- a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/CompositeTest.java
+++ b/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/CompositeTest.java
@@ -32,7 +32,7 @@
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
-
+import static org.ops4j.pax.exam.MavenUtils.*;
 
 
 @RunWith( JUnit4TestRunner.class )
@@ -61,9 +61,9 @@
     public static Option[] configure() {    
         Option[] opt =  options(
                 provision(
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version("1.3.0-SNAPSHOT"),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.composite").version("1.3.0-SNAPSHOT"),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.api").version("1.3.0-SNAPSHOT")
+                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
+                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.composite").version(asInProject()),
+                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.api").version(asInProject())
                     )
                 );
         return opt;
@@ -143,9 +143,7 @@
            .addSubService(new InstantiatedService().setSpecification(Foo.class.getName()).setOptional(true));
        
        ComponentInstance ci = type.createInstance();
-       
-       System.out.println(ci.getInstanceDescription().getDescription());
-       
+              
        assertThat("ci is valid", ci.getState(), is(ComponentInstance.VALID));
        
        // Stop prov
@@ -204,9 +202,7 @@
            .addSubService(new ImportedService().setSpecification(Foo.class.getName()).setOptional(true));
        
        ComponentInstance ci = type.createInstance();
-       
-       System.out.println(ci.getInstanceDescription().getDescription());
-       
+              
        assertThat("ci is valid", ci.getState(), is(ComponentInstance.VALID));
        
        // Stop prov
@@ -236,8 +232,6 @@
        
        ComponentInstance ci = type.createInstance();
        
-       System.out.println(ci.getInstanceDescription().getDescription());
-
        assertThat("ci is valid", ci.getState(), is(ComponentInstance.VALID));
        assertThat("c is valid", c.getState(), is(ComponentInstance.VALID));
        
@@ -271,14 +265,6 @@
         .addDependency(new Dependency().setField("myFoo"))
         .setValidateMethod("start");
     }
-    
-    private PrimitiveComponentType createAnOptionalConsumer() {
-        return new PrimitiveComponentType()
-        .setBundleContext(context)
-        .setClassName(org.example.service.impl.MyComponentImpl.class.getName())
-        .addDependency(new Dependency().setField("myFoo").setOptional(true))
-        .setValidateMethod("start");
-    }
 
 
 
diff --git a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/PrimitiveComponentTest.java b/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/PrimitiveComponentTest.java
index 66b9789..a0a3761 100644
--- a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/PrimitiveComponentTest.java
+++ b/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/PrimitiveComponentTest.java
@@ -3,14 +3,17 @@
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.notNullValue;
 import static org.hamcrest.CoreMatchers.nullValue;
-
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.fail;
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.options;
 import static org.ops4j.pax.exam.CoreOptions.provision;
+import static org.ops4j.pax.exam.MavenUtils.asInProject;
 
 import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.ConfigurationException;
+import org.apache.felix.ipojo.MissingHandlerException;
+import org.apache.felix.ipojo.UnacceptableConfiguration;
 import org.apache.felix.ipojo.api.Dependency;
 import org.apache.felix.ipojo.api.PrimitiveComponentType;
 import org.apache.felix.ipojo.api.Service;
@@ -56,65 +59,57 @@
     public static Option[] configure() {    
         Option[] opt =  options(
                 provision(
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version("1.3.0-SNAPSHOT"),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.api").version("1.3.0-SNAPSHOT")
+                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
+                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.api").version(asInProject())
                     )
                 );
         return opt;
     }
 
     @Test
-    public void createAServiceProvider()
-    {
+    public void createAServiceProvider() throws Exception {
         assertThat( context, is( notNullValue() ) );
         ComponentInstance ci = null;
-        
-        try {
-            PrimitiveComponentType type = createAProvider();
-            ci = type.createInstance();
-            assertThat("Ci is valid", ci.getState(), is(ComponentInstance.VALID));
-            ServiceReference ref = ipojo.getServiceReferenceByName(Foo.class.getName(), ci.getInstanceName());
-            assertThat( ref, is( notNullValue() ) );
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+
+        PrimitiveComponentType type = createAProvider();
+        ci = type.createInstance();
+        assertThat("Ci is valid", ci.getState(), is(ComponentInstance.VALID));
+        ServiceReference ref = ipojo.getServiceReferenceByName(Foo.class
+                .getName(), ci.getInstanceName());
+        assertThat(ref, is(notNullValue()));
+
     }
     
     @Test
-    public void killTheFactory()
-    {
+    public void killTheFactory() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
         assertThat( context, is( notNullValue() ) );
         ComponentInstance ci = null;
-        
-        try {
-            PrimitiveComponentType type = createAProvider();
-            ci = type.createInstance();
-            assertThat("Ci is valid", ci.getState(), is(ComponentInstance.VALID));
-            ServiceReference ref = ipojo.getServiceReferenceByName(Foo.class.getName(), ci.getInstanceName());
-            assertThat( ref, is( notNullValue() ) );
-            type.stop();
-            assertThat("Ci is disposed", ci.getState(), is(ComponentInstance.DISPOSED));
-            ref = ipojo.getServiceReferenceByName(Foo.class.getName(), ci.getInstanceName());
-            assertThat( ref, is( nullValue() ) );
-            
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+
+        PrimitiveComponentType type = createAProvider();
+        ci = type.createInstance();
+        assertThat("Ci is valid", ci.getState(), is(ComponentInstance.VALID));
+        ServiceReference ref = ipojo.getServiceReferenceByName(Foo.class
+                .getName(), ci.getInstanceName());
+        assertThat(ref, is(notNullValue()));
+        type.stop();
+        assertThat("Ci is disposed", ci.getState(),
+                is(ComponentInstance.DISPOSED));
+        ref = ipojo.getServiceReferenceByName(Foo.class.getName(), ci
+                .getInstanceName());
+        assertThat(ref, is(nullValue()));
+
     }
     
     @Test
-    public void createAServiceCons()
-    {
+    public void createAServiceCons() throws Exception {
         assertThat( context, is( notNullValue() ) );
         ComponentInstance ci = null;
-        
-        try {
-            PrimitiveComponentType type = createAConsumer();
-            ci = type.createInstance();
-            assertThat("Ci is invalid", ci.getState(), is(ComponentInstance.INVALID));
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+
+        PrimitiveComponentType type = createAConsumer();
+        ci = type.createInstance();
+        assertThat("Ci is invalid", ci.getState(),
+                is(ComponentInstance.INVALID));
+
     }
     
     @Test
diff --git a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/SingletonComponentTest.java b/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/SingletonComponentTest.java
index 7eb54c8..ecb9923 100644
--- a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/SingletonComponentTest.java
+++ b/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/SingletonComponentTest.java
@@ -10,6 +10,9 @@
 import static org.ops4j.pax.exam.CoreOptions.provision;
 
 import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.ConfigurationException;
+import org.apache.felix.ipojo.MissingHandlerException;
+import org.apache.felix.ipojo.UnacceptableConfiguration;
 import org.apache.felix.ipojo.api.Dependency;
 import org.apache.felix.ipojo.api.PrimitiveComponentType;
 import org.apache.felix.ipojo.api.Service;
@@ -28,7 +31,7 @@
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
-
+import static org.ops4j.pax.exam.MavenUtils.*;
 
 
 @RunWith( JUnit4TestRunner.class )
@@ -57,65 +60,56 @@
     public static Option[] configure() {    
         Option[] opt =  options(
                 provision(
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version("1.3.0-SNAPSHOT"),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.api").version("1.3.0-SNAPSHOT")
+                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
+                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.api").version(asInProject())
                     )
                 );
         return opt;
     }
 
     @Test
-    public void createAServiceProvider()
+    public void createAServiceProvider() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException
     {
         assertThat( context, is( notNullValue() ) );
         ComponentInstance ci = null;
-        
-        try {
-            SingletonComponentType type = createAProvider();
-            ci = type.create();
-            assertThat("Ci is valid", ci.getState(), is(ComponentInstance.VALID));
-            ServiceReference ref = ipojo.getServiceReferenceByName(Foo.class.getName(), ci.getInstanceName());
-            assertThat( ref, is( notNullValue() ) );
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+
+        SingletonComponentType type = createAProvider();
+        ci = type.create();
+        assertThat("Ci is valid", ci.getState(), is(ComponentInstance.VALID));
+        ServiceReference ref = ipojo.getServiceReferenceByName(Foo.class
+                .getName(), ci.getInstanceName());
+        assertThat(ref, is(notNullValue()));
+
     }
     
     @Test
-    public void killTheFactory()
-    {
+    public void killTheFactory() throws Exception {
         assertThat( context, is( notNullValue() ) );
         ComponentInstance ci = null;
-        
-        try {
-            SingletonComponentType type = createAProvider();
-            ci = type.create();
-            assertThat("Ci is valid", ci.getState(), is(ComponentInstance.VALID));
-            ServiceReference ref = ipojo.getServiceReferenceByName(Foo.class.getName(), ci.getInstanceName());
-            assertThat( ref, is( notNullValue() ) );
-            type.stop();
-            assertThat("Ci is disposed", ci.getState(), is(ComponentInstance.DISPOSED));
-            ref = ipojo.getServiceReferenceByName(Foo.class.getName(), ci.getInstanceName());
-            assertThat( ref, is( nullValue() ) );
-            
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        SingletonComponentType type = createAProvider();
+        ci = type.create();
+        assertThat("Ci is valid", ci.getState(), is(ComponentInstance.VALID));
+        ServiceReference ref = ipojo.getServiceReferenceByName(Foo.class
+                .getName(), ci.getInstanceName());
+        assertThat(ref, is(notNullValue()));
+        type.stop();
+        assertThat("Ci is disposed", ci.getState(),
+                is(ComponentInstance.DISPOSED));
+        ref = ipojo.getServiceReferenceByName(Foo.class.getName(), ci
+                .getInstanceName());
+        assertThat(ref, is(nullValue()));
     }
     
     @Test
-    public void createAServiceCons()
-    {
+    public void createAServiceCons() throws Exception {
         assertThat( context, is( notNullValue() ) );
         ComponentInstance ci = null;
-        
-        try {
-            SingletonComponentType type = createAConsumer();
-            ci = type.create();
-            assertThat("Ci is invalid", ci.getState(), is(ComponentInstance.INVALID));
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+
+        SingletonComponentType type = createAConsumer();
+        ci = type.create();
+        assertThat("Ci is invalid", ci.getState(),
+                is(ComponentInstance.INVALID));
+
     }
     
     @Test
