diff --git a/ipojo/tests/bundleAsiPOJO/helpers/pom.xml b/ipojo/tests/bundleAsiPOJO/helpers/pom.xml
index 906263f..647d632 100644
--- a/ipojo/tests/bundleAsiPOJO/helpers/pom.xml
+++ b/ipojo/tests/bundleAsiPOJO/helpers/pom.xml
@@ -7,11 +7,13 @@
   <version>1.5.0-SNAPSHOT</version>
   <name>iPOJO Test Helpers</name>
 
+  
+
   <dependencies>
     <dependency>
       <groupId>org.apache.felix</groupId>
       <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${pom.version}</version>
+      <version>1.4.0</version>
     </dependency>
     <dependency>
       <groupId>org.osgi</groupId>
@@ -26,6 +28,11 @@
       <scope>compile</scope>
     </dependency>
   </dependencies>
+  <parent>
+    <artifactId>felix-parent</artifactId>
+    <groupId>org.apache.felix</groupId>
+    <version>1.2.0</version>
+  </parent>
 
   <build>
     <plugins>
diff --git a/ipojo/tests/bundleAsiPOJO/helpers/src/main/java/org/apache/felix/ipojo/test/helpers/IPOJOHelper.java b/ipojo/tests/bundleAsiPOJO/helpers/src/main/java/org/apache/felix/ipojo/test/helpers/IPOJOHelper.java
index bb1cd4d..e723f9f 100644
--- a/ipojo/tests/bundleAsiPOJO/helpers/src/main/java/org/apache/felix/ipojo/test/helpers/IPOJOHelper.java
+++ b/ipojo/tests/bundleAsiPOJO/helpers/src/main/java/org/apache/felix/ipojo/test/helpers/IPOJOHelper.java
@@ -347,6 +347,17 @@
     public Element getMetadata(String component) {
         return getMetadata(m_context.getBundle(), component);
     }
+    
+    /**
+     * Returns the instance metadata of a component defined in this bundle.
+     * 
+     * @param component the name of the locally defined component.
+     * @return the list of instance metadata of the component with the given name,
+     *         defined in this given bundle, or {@code null} if not found.
+     */
+    public Element[] getInstanceMetadata(String component) {
+        return getInstanceMetadata(m_context.getBundle(), component);
+    }
 
     /**
      * Returns the component factory with the given name in the given bundle.
@@ -483,6 +494,53 @@
                             + bundle.getSymbolicName() + "): " + e.getMessage());
         }
     }
+    
+    /**
+     * Returns the instance metadatas of the component with the given name,
+     * defined in the given bundle.
+     * 
+     * @param bundle the bundle from which the component is defined.
+     * @param component the name of the defined component.
+     * @return the list of instance metadata of the component with the given name,
+     *         defined in the given bundle, or {@code null} if not found.
+     */
+    public static Element[] getInstanceMetadata(Bundle bundle, String component) {
+
+        // Retrieves the component description from the bundle's manifest.
+        String elem = (String) bundle.getHeaders().get("iPOJO-Components");
+        if (elem == null) {
+            throw new IllegalArgumentException(
+                    "Cannot find iPOJO-Components descriptor in the specified bundle ("
+                            + bundle.getSymbolicName()
+                            + "). Not an iPOJO bundle.");
+        }
+
+        // Parses the retrieved description and find the component with the
+        // given name.
+        List list = new ArrayList();
+        try {
+            Element element = ManifestMetadataParser.parseHeaderMetadata(elem);
+            Element[] childs = element.getElements("instance");
+            for (int i = 0; i < childs.length; i++) {
+                String name = childs[i].getAttribute("component");
+                if (name != null && name.equalsIgnoreCase(component)) {
+                    list.add(childs[i]);
+                }
+            }
+            
+            if (list.isEmpty()) {
+                // Component not found...
+                return null;
+            } else {
+                return (Element[]) list.toArray(new Element[list.size()]);
+            }
+
+        } catch (ParseException e) {
+            throw new IllegalStateException(
+                    "Cannot parse the components from specified bundle ("
+                            + bundle.getSymbolicName() + "): " + e.getMessage());
+        }
+    }
 
     /**
      * Returns the service object of a service registered in the specified
